Skip to main content

Payroll Event Integration Testing Guide

Summary​

This page documents confirmed payroll event integration testing guide behavior and explicitly marks incomplete integration boundaries.

Audience​

Payroll and integration developers, QA and support engineers, solution and security architects, and implementation partners.

Test scope​

Use isolated environments and synthetic, non-sensitive payloads. Do not use production broker topology, credentials, employee data, or payroll values.

Contract tests​

  • Verify the four shared outbound types derive from IntegrationEvent and publishers set schema version 1.
  • Verify concrete serialization retains common and event-specific fields without asserting sensitive values.
  • Verify outbox mapping preserves event identity/type, payload, occurrence, correlation, tenant metadata, source, and Pending state as implemented.

Publisher tests​

  • For calculate, freeze, unfreeze, and payslip generation, verify business state, evidence, and outbox intent commit together.
  • Force local commit failure and confirm neither business state nor intent persists.
  • Verify current null/empty envelope behavior explicitly until corrected.

Consumer tests​

  • Exercise all 11 Payroll inbound types with valid, missing, duplicate, older, equal-time, malformed, and unsupported cases.
  • Confirm projection, audit, and processed marker commit before acknowledgement.
  • Confirm exceptions requeue and successful duplicates do not mutate projection state.

Outbox and failure tests​

  • Test Pending/Failed selection order, success/failure status updates, retry-count increments, and duplicate-publish failure windows.
  • Test the actual deployed relay separately once its invocation is confirmed.

Landscape tests​

  • Confirm Document handles calculated/frozen/payslip, Notification handles frozen/payslip, and Platform records frozen receipt.
  • Assert no behavior for unconfirmed subscriptions.

Expected result​

The source inventory remains four outbound contracts, 11 inbound subscriptions, three confirmed downstream service consumers, and schema version 1, with no exactly-once assertion.

Requires confirmation​

  • Approved broker test harness, relay fixture, replay testing, and operational acceptance criteria.

Source References​

  • microservices/src/contracts/Events/IntegrationEvent.cs
  • microservices/src/contracts/Events/PayrollCalculatedEvent.cs
  • microservices/src/contracts/Events/PayslipGeneratedEvent.cs
  • microservices/src/payroll-service/Application/PayrollCalculationService.cs
  • microservices/src/payroll-service/Application/PayrollOutputsService.cs
  • microservices/src/shared-kernel/Outbox/IntegrationEventJsonSerializer.cs
  • microservices/src/shared-kernel/Outbox/OutboxMessage.cs
  • microservices/src/shared-kernel/Messaging/OutboxProcessor.cs
  • microservices/src/payroll-service/Infrastructure/Persistence.cs
  • microservices/src/payroll-service/Program.cs
  • microservices/src/payroll-service/Messaging/PayrollReadModelConsumer.cs
  • microservices/src/payroll-service/Domain/PayrollEntities.cs
  • microservices/src/document-service/Messaging/DocumentReadModelConsumer.cs
  • microservices/src/notification-service/Application/EventNotificationResolver.cs
  • microservices/src/notification-service/Messaging/NotificationEventConsumer.cs
  • microservices/src/platform-service/Messaging/PlatformEventConsumer.cs
  • microservices/src/integration-service/Domain/IntegrationEntities.cs

See Also​

Keywords​

  • Payroll events
  • Payroll Event Integration Testing Guide
  • Integration contracts

Revision Information​

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