Refactor code structure and optimize performance across multiple modules

This commit is contained in:
StellaOps Bot
2025-12-26 20:03:22 +02:00
parent c786faae84
commit f10d83c444
1385 changed files with 69732 additions and 10280 deletions

View File

@@ -30,7 +30,8 @@ public sealed class IdempotencyMiddlewareTests
config["Scanner:Idempotency:Window"] = "24:00:00";
});
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task PostRequest_WithContentDigest_ReturnsIdempotencyKey()
{
// Arrange
@@ -50,7 +51,8 @@ public sealed class IdempotencyMiddlewareTests
Assert.NotEqual(HttpStatusCode.InternalServerError, response.StatusCode);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task DuplicateRequest_WithSameContentDigest_ReturnsCachedResponse()
{
// Arrange
@@ -75,7 +77,8 @@ public sealed class IdempotencyMiddlewareTests
Assert.NotEqual(HttpStatusCode.InternalServerError, response2.StatusCode);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task DifferentRequests_WithDifferentDigests_AreProcessedSeparately()
{
// Arrange
@@ -100,7 +103,8 @@ public sealed class IdempotencyMiddlewareTests
Assert.NotEqual(HttpStatusCode.InternalServerError, response2.StatusCode);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task GetRequest_BypassesIdempotencyMiddleware()
{
// Arrange
@@ -114,13 +118,15 @@ public sealed class IdempotencyMiddlewareTests
Assert.NotEqual(HttpStatusCode.InternalServerError, response.StatusCode);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task PostRequest_WithoutContentDigest_ComputesDigest()
{
// Arrange
await using var factory = CreateFactory();
using var client = factory.CreateClient();
using StellaOps.TestKit;
var content = new StringContent("""{"test":"nodigest"}""", Encoding.UTF8, "application/json");
// Not adding Content-Digest header - middleware should compute it