Testing
Generated Java applications should be testable from the first commit. Skills and examples should prefer small, deterministic tests over manual-only verification.
Expectations
Section titled “Expectations”- Include at least one automated test that fails if the primary endpoint regresses
- Prefer ephemeral ports for embedded servers
- Keep unit tests fast; use integration tests for HTTP and persistence boundaries
- When adding databases, include Testcontainers or an equivalent strategy when practical
Framework notes
Section titled “Framework notes”| Framework | Testing focus |
|---|---|
| Spring Boot | @SpringBootTest, web slice tests, Testcontainers for persistence |
| Helidon | HTTP tests against SE/MP endpoints and health checks |
| Jetty | Start embedded server in tests; assert handler/servlet responses |
Prompt patterns
Section titled “Prompt patterns”Add integration tests that start the application on an ephemeral portand verify the primary JSON endpoint and health check.Add PostgreSQL persistence and Testcontainers to this Spring Boot project.Keep tests hermetic and document required Docker availability.