Skip to main content

Asset Event Testing

Summary

Existing coverage is smoke-test based: it drives the lifecycle, then asserts that outbox rows of the expected event types appear, and separately exercises the Notification parity path. Deeper automated event tests are recommended, not claimed.

Audience

Engineering, integration, QA, architecture, and security reviewers.

Reference Content

Existing smoke coverage (verified)

The asset smoke script produces the real lifecycle and inspects the outbox through the read endpoint:

CoverageEvidence
Outbox row present after a transitionCount-Event reads /asset/outbox and filters by eventType
AssetAssigned produced on assignAsserted after the assign path
AssetRejected produced on rejectAsserted after the reject path
Audit, timeline, and outbox side effectsAsserted together after lifecycle steps
Notification parity (-Notifications)Drives all six payloads, checks completeness, feeds the notification dispatcher (broker-free)
Correlation header propagationRequests set an X-Correlation-Id

The notification parity smoke starts notification-service and asset-service, generates the real AssetRequested/Assigned/Returned/Rejected/LostOrDamaged/Retired payloads, verifies payload completeness, then routes each (with an enriched recipient email) through the broker-free notification test path.

Test types (do not conflate)

Test typePresent today
Lifecycle-to-outbox smokeYes
Notification parity smokeYes
Contract unit testsNot claimed
Producer/mapper unit testsNot claimed
Consumer integration tests (broker)Not claimed
End-to-end broker delivery testsNot claimed
  • Mapper unit tests asserting each domain event produces the correct contract and EventType.
  • Completeness-guard tests asserting an incomplete snapshot rolls back and writes no outbox row.
  • Consumer tests asserting each event maps to the correct Asset.* template and recipient resolution branch.
  • Retry tests asserting a failed publish increments RetryCount and is retried.

Public-safety note

Test commands, connection strings, hosts, and ports are intentionally excluded.

Source References

  • microservices/scripts/smoke-asset.ps1
  • microservices/src/asset-service/Api/AssetEndpoints.cs
  • microservices/src/notification-service/Application/EventNotificationResolver.cs

See Also

Keywords

  • Event testing
  • Smoke tests
  • Outbox assertions

Revision Information

  • Status: Draft
  • Last reviewed: 2026-07-17
  • Review cycle: Quarterly