docs consolidation and others
This commit is contained in:
@@ -8,10 +8,12 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
using Npgsql;
|
||||
using StellaOps.Infrastructure.Postgres.Testing;
|
||||
using StellaOps.Scanner.Reachability.Slices;
|
||||
using StellaOps.Scanner.Storage;
|
||||
using StellaOps.Scanner.Surface.Validation;
|
||||
using StellaOps.Scanner.Triage;
|
||||
using StellaOps.Scanner.WebService.Diagnostics;
|
||||
using StellaOps.Scanner.WebService.Services;
|
||||
|
||||
namespace StellaOps.Scanner.WebService.Tests;
|
||||
|
||||
@@ -143,6 +145,7 @@ public sealed class ScannerApplicationFactory : WebApplicationFactory<ServiceSta
|
||||
configureServices?.Invoke(services);
|
||||
services.RemoveAll<ISurfaceValidatorRunner>();
|
||||
services.AddSingleton<ISurfaceValidatorRunner, TestSurfaceValidatorRunner>();
|
||||
services.TryAddSingleton<ISliceQueryService, NullSliceQueryService>();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -208,4 +211,30 @@ public sealed class ScannerApplicationFactory : WebApplicationFactory<ServiceSta
|
||||
".."));
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class NullSliceQueryService : ISliceQueryService
|
||||
{
|
||||
public Task<SliceQueryResponse> QueryAsync(SliceQueryRequest request, CancellationToken cancellationToken = default)
|
||||
=> Task.FromResult(new SliceQueryResponse
|
||||
{
|
||||
SliceDigest = "sha256:null",
|
||||
Verdict = "unknown",
|
||||
Confidence = 0.0,
|
||||
CacheHit = false
|
||||
});
|
||||
|
||||
public Task<ReachabilitySlice?> GetSliceAsync(string digest, CancellationToken cancellationToken = default)
|
||||
=> Task.FromResult<ReachabilitySlice?>(null);
|
||||
|
||||
public Task<object?> GetSliceDsseAsync(string digest, CancellationToken cancellationToken = default)
|
||||
=> Task.FromResult<object?>(null);
|
||||
|
||||
public Task<SliceReplayResponse> ReplayAsync(SliceReplayRequest request, CancellationToken cancellationToken = default)
|
||||
=> Task.FromResult(new SliceReplayResponse
|
||||
{
|
||||
Match = true,
|
||||
OriginalDigest = request.SliceDigest ?? "sha256:null",
|
||||
RecomputedDigest = request.SliceDigest ?? "sha256:null"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user