What problem does it solve?
This Skill provides structured test-driven development guidance for Spring Boot services to help teams produce fast, deterministic unit and integration tests and achieve high coverage, reducing regressions during feature work, bug fixes, and refactors.
Core Features & Use Cases
- JUnit 5 unit testing patterns with Mockito for isolating service logic and using test data builders for clear fixtures.
- Web-layer testing with MockMvc and @WebMvcTest for controller behavior and JSON assertions.
- Integration and persistence testing with @SpringBootTest, @DataJpaTest, and Testcontainers to run realistic database-backed scenarios.
- Coverage enforcement using JaCoCo integrated into Maven/Gradle and CI to maintain a minimum threshold.
- Use Case: Add a new API endpoint by writing failing tests first, implement minimal code to pass, add repository tests with Testcontainers, then enforce coverage in CI.
Quick Start
Create failing JUnit 5 unit and MockMvc controller tests for the new MarketService.create endpoint, implement minimal production code until tests pass, and run the full test suite with JaCoCo coverage.