| name | testing |
| description | Expert knowledge on testing strategies - covers unit testing, integration testing, test data builders, async verification patterns, external API mocking, and debugging test failures. Use when writing tests, debugging test failures, understanding test infrastructure, creating test data, or setting up mocks. |
Testing Skill
Project-specific testing knowledge and conventions.
Key Principles
Real Objects Over Mocks
Prefer real objects over mocks whenever possible. This is a recommended default — adjust per project needs.
When mocks ARE acceptable:
- External HTTP clients
- Database repositories (when not using test slices)
- External service clients
- Infrastructure boundaries
If a setter is missing: Add it to the production class rather than mocking.
Test Structure
Follow the Given-When-Then (Arrange-Act-Assert) pattern:
- Given: Set up test data and preconditions
- When: Execute the action under test
- Then: Verify expected outcomes
Customization
Add your project-specific testing knowledge below:
Test Infrastructure
- Test base classes: [e.g.,
AbstractIntegrationTest]
- Test containers: [e.g., PostgreSQL, Redis, Kafka]
- Test configuration: [e.g.,
application-test.yml]
Test Data Builders
- Location: [e.g.,
src/test/java/.../builders/]
- Pattern: [e.g., Builder pattern with defaults]
Common Test Patterns
- [Document project-specific test patterns here]
Running Tests
- Unit tests: [e.g.,
./gradlew test, npm test, cargo test]
- Integration tests: [e.g.,
./gradlew integrationTest]
- Single test: [e.g.,
./gradlew test --tests "ClassName.methodName"]