Testing Authentication¶
Use one test for every important allow rule and at least one test for every denial boundary.
Current lab¶
RequestAuthorizationLabTest demonstrates a public endpoint, anonymous rejection, USER access, USER-to-ADMIN denial, and ADMIN access. It currently uses a test security chain.
LAB-001 now loads the production chain so configuration drift becomes visible. LAB-002 uses the production AuthenticationManager and provider to prove credentials are validated before token issuance.
Workflow¶
- Write the expected denial test first.
- Run the focused test and confirm it fails for the expected reason.
- Implement the smallest security change.
- Run the focused module and full repository tests.
- Update the coverage status only after both allow and deny cases pass.
See the Authentication Testing Reference for the full test matrix.