| name | acceptance-scenario-scaffold |
|---|---|
| description | Use when adding or extending Docker-based black-box acceptance tests in the acceptance-test module. |
Use when a change needs end-to-end confidence through the acceptance-test/ module instead of, or in addition to, unit tests.
acceptance-test/src/test/java/...acceptance-test/src/test/java/br/com/helpdev/acceptance/mock/acceptance-test/src/test/resources/__files/
- new REST scenarios against the built application container
- asynchronous flows that cross REST, Kafka, database, and external HTTP integrations
- actuator and health endpoint smoke checks
- failure and retry scenarios that depend on Testcontainers or WireMock
- Scenario name and observable outcome
- Entry point such as an HTTP request, startup behavior, or async side effect
- External integrations to stub or observe
- Success and failure assertions
- Whether the scenario is synchronous or eventually consistent
- Reuse
DefaultContainerStarterunless the scenario truly needs a different container topology. - Keep the test black-box: drive behavior through HTTP, container startup, or externally visible side effects.
- Use RestAssured assertions for HTTP contracts and follow the request style already used in
UserEndpointsIT. - Reuse or extend mock helpers like
RandomDataApiMockand add payload files under__files/when fixture bodies are needed. - For async flows, follow the
waitAtMost(...).untilAsserted(...)pattern used inUserEnrichProcessIT. - Assert outcomes that users or integrators can observe: status codes, headers, follow-up reads, and WireMock invocation counts.
- Keep shared-container tests deterministic, and opt into same-thread execution when timing or shared state requires it.
- Acceptance test class extending
DefaultContainerStarter - Any required mock helper updates
- Mock payload files, if the scenario needs fixture bodies
- Minimal happy-path and critical failure-path assertions
- Prefer one scenario per business behavior instead of mirroring every unit test here.
- Do not reach into Spring beans, repositories, or internal classes from acceptance tests.
- Prefer existing container wiring and helpers over bespoke setup.
- Use
make run-acceptance-testsas the default validation target. - If the change is only internal and fully covered by unit tests, skip acceptance coverage explicitly instead of forcing one.