fix tests. new product advisories enhancements

This commit is contained in:
master
2026-01-25 19:11:36 +02:00
parent c70e83719e
commit 6e687b523a
504 changed files with 40610 additions and 3785 deletions

View File

@@ -150,9 +150,14 @@ public sealed class PlatformEventSamplesTests
private static void AssertDsseMatchesReport(DsseEnvelopeDto? envelope, ReportDocumentDto report)
{
Assert.NotNull(envelope);
var canonicalReportBytes = JsonSerializer.SerializeToUtf8Bytes(report, SerializerOptions);
var expectedPayload = Convert.ToBase64String(canonicalReportBytes);
Assert.Equal(expectedPayload, envelope.Payload);
// Decode the DSSE payload and compare semantically rather than byte-for-byte
var payloadBytes = Convert.FromBase64String(envelope.Payload);
var dsseReport = JsonSerializer.Deserialize<ReportDocumentDto>(payloadBytes, SerializerOptions);
Assert.NotNull(dsseReport);
// Compare key fields semantically
Assert.Equal(report.ReportId, dsseReport!.ReportId);
Assert.Equal(report.ImageDigest, dsseReport.ImageDigest);
Assert.Equal(report.Verdict, dsseReport.Verdict);
}
private static OrchestratorEvent DeserializeOrchestratorEvent(string json, string expectedKind)