Payroll API Testing Guide
Summary
Payroll has smoke, scenario, parity, and cutover scripts but no formal Payroll .NET test project.
Audience
Frontend and backend developers, QA and support engineers, architects, security reviewers, and implementation partners.
Overview
Existing test assets
Source-backed scripts cover native Payroll scenarios, compatibility behavior, route-source cutover, monolith/service parity, go/no-go evidence, and broader scenario validation. Run them only in isolated test environments with synthetic data; this page does not provide production commands or credentials.
Recommended coverage matrix
| Layer | Required coverage |
|---|---|
| Contract tests | Methods, routes, binding, response types, status/body conventions, files and content types |
| Application integration | Run list/retrieve, invalid periods, duplicate editable runs, missing Attendance, optional inputs, recalculation and Frozen block |
| Freeze/unfreeze | Duplicate freeze, insufficient recovery, recovery application/reversal, native/compatibility parity |
| Components | Create/update/deactivate, active listing, unknown category/basis behavior, missing component |
| Payslips/PDF | Frozen eligibility, structured generation, PDF content type, regeneration, missing detail, employee-self/admin authorization once confirmed |
| Exports | Frozen bank eligibility, general CSV, empty run, data minimization, and no payment assumption |
| Gateway | Direct/shadow, compatibility ownership, rollback, route-source evidence and parity |
| Consumer/read model | Missing Attendance, optional Leave/Expense, duplicate/stale events and projection reconciliation |
| Negative/security | Missing/invalid tenant, cross-tenant access, absent/invalid bearer context, unauthorized role, malformed body and identifier |
Safe execution sequence
- Create synthetic tenant-period projections in an isolated environment.
- Exercise list/retrieve and invalid-period paths.
- Calculate with complete and missing Attendance coverage; add optional Leave, Expense, overtime, advance and component inputs independently.
- Recalculate, freeze, repeat freeze, generate payslip/PDF/exports, then unfreeze and verify recovery behavior.
- Repeat through compatibility routes and compare only supported contract fields.
- Verify gateway cutover and rollback without allowing production writes.
Recommended tests are not claimed to exist.
Source References
microservices/scripts/smoke-payroll.ps1microservices/scripts/smoke-payroll-cutover.ps1microservices/scripts/compare-payroll-parity.ps1microservices/scripts/payroll-cutover-go-no-go.ps1scripts/validate-payroll-scenarios.ps1microservices/src/payroll-service/Api/PayrollRunEndpoints.csmicroservices/src/payroll-service/Api/PayrollCompatEndpoints.cs
Related Articles
See Also
Keywords
- Payroll API
- Payroll API Testing Guide
Revision Information
- Status: Draft
- Last reviewed: 2026-07-15
- Review cycle: Quarterly