feat(audit)!: ScadaBridge C3 — swap to canonical ZB.MOM.WW.Audit.AuditEvent across seams/emitters/DTO/redactor wiring; transitional 24-col storage shim (Task 2.5)
This commit is contained in:
@@ -10,7 +10,7 @@ using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using NSubstitute;
|
||||
using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit;
|
||||
using ZB.MOM.WW.Audit;
|
||||
using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories;
|
||||
using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit;
|
||||
using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums;
|
||||
@@ -35,16 +35,18 @@ public class AuditEndpointsTests
|
||||
{
|
||||
private const string BasicCredential = "auditor:password";
|
||||
|
||||
private static AuditEvent SampleEvent(Guid? id = null, DateTime? occurredAt = null) => new()
|
||||
{
|
||||
EventId = id ?? Guid.Parse("11111111-1111-1111-1111-111111111111"),
|
||||
OccurredAtUtc = occurredAt ?? new DateTime(2026, 5, 20, 12, 0, 0, DateTimeKind.Utc),
|
||||
Channel = AuditChannel.ApiOutbound,
|
||||
Kind = AuditKind.ApiCall,
|
||||
SourceSiteId = "plant-a",
|
||||
Status = AuditStatus.Delivered,
|
||||
HttpStatus = 200,
|
||||
};
|
||||
// C3 (Task 2.5): canonical ZB.MOM.WW.Audit.AuditEvent via the shared factory;
|
||||
// the endpoint serializes the canonical record (eventId + occurredAtUtc top-level,
|
||||
// domain fields out of DetailsJson) so these tests assert on the JSON/CSV output.
|
||||
private static AuditEvent SampleEvent(Guid? id = null, DateTime? occurredAt = null) =>
|
||||
ScadaBridgeAuditEventFactory.Create(
|
||||
channel: AuditChannel.ApiOutbound,
|
||||
kind: AuditKind.ApiCall,
|
||||
status: AuditStatus.Delivered,
|
||||
eventId: id ?? Guid.Parse("11111111-1111-1111-1111-111111111111"),
|
||||
occurredAtUtc: occurredAt ?? new DateTime(2026, 5, 20, 12, 0, 0, DateTimeKind.Utc),
|
||||
sourceSiteId: "plant-a",
|
||||
httpStatus: 200);
|
||||
|
||||
/// <summary>
|
||||
/// Builds an in-process TestServer hosting the audit endpoints with stubbed
|
||||
|
||||
Reference in New Issue
Block a user