release orchestration strengthening
This commit is contained in:
@@ -328,7 +328,9 @@ public sealed class LayerSbomEndpointsTests
|
||||
{
|
||||
var scanId = "scan-" + Guid.NewGuid().ToString("N");
|
||||
var mockService = new InMemoryLayerSbomService();
|
||||
var coordinator = new StubScanCoordinator();
|
||||
mockService.AddScan(scanId, "sha256:image123", CreateTestLayers(2));
|
||||
coordinator.AddScan(scanId, "sha256:image123");
|
||||
mockService.SetVerificationResult(scanId, new CompositionRecipeVerificationResult
|
||||
{
|
||||
Valid = true,
|
||||
@@ -342,6 +344,8 @@ public sealed class LayerSbomEndpointsTests
|
||||
{
|
||||
services.RemoveAll<ILayerSbomService>();
|
||||
services.AddSingleton<ILayerSbomService>(mockService);
|
||||
services.RemoveAll<IScanCoordinator>();
|
||||
services.AddSingleton<IScanCoordinator>(coordinator);
|
||||
});
|
||||
await factory.InitializeAsync();
|
||||
using var client = factory.CreateClient();
|
||||
@@ -362,7 +366,9 @@ public sealed class LayerSbomEndpointsTests
|
||||
{
|
||||
var scanId = "scan-" + Guid.NewGuid().ToString("N");
|
||||
var mockService = new InMemoryLayerSbomService();
|
||||
var coordinator = new StubScanCoordinator();
|
||||
mockService.AddScan(scanId, "sha256:image123", CreateTestLayers(2));
|
||||
coordinator.AddScan(scanId, "sha256:image123");
|
||||
mockService.SetVerificationResult(scanId, new CompositionRecipeVerificationResult
|
||||
{
|
||||
Valid = false,
|
||||
@@ -376,6 +382,8 @@ public sealed class LayerSbomEndpointsTests
|
||||
{
|
||||
services.RemoveAll<ILayerSbomService>();
|
||||
services.AddSingleton<ILayerSbomService>(mockService);
|
||||
services.RemoveAll<IScanCoordinator>();
|
||||
services.AddSingleton<IScanCoordinator>(coordinator);
|
||||
});
|
||||
await factory.InitializeAsync();
|
||||
using var client = factory.CreateClient();
|
||||
@@ -400,6 +408,8 @@ public sealed class LayerSbomEndpointsTests
|
||||
{
|
||||
services.RemoveAll<ILayerSbomService>();
|
||||
services.AddSingleton<ILayerSbomService, InMemoryLayerSbomService>();
|
||||
services.RemoveAll<IScanCoordinator>();
|
||||
services.AddSingleton<IScanCoordinator, StubScanCoordinator>();
|
||||
});
|
||||
await factory.InitializeAsync();
|
||||
using var client = factory.CreateClient();
|
||||
|
||||
Reference in New Issue
Block a user