What problem does it solve?
This Skill prevents brittle, flaky Spring Boot test suites by standardizing how to structure slice tests, wire Testcontainers, and choose the right test client for each layer.
Core Features & Use Cases
- Spring slice test patterns: Uses JUnit 5 + Mockito + AssertJ with correct slice annotations like WebMvcTest, DataJpaTest, and SB4 full-stack MOCK testing.
- Testcontainers wiring that works in SB4: Provides container setup guidance and the safest wiring approach (including tc: JDBC URLs) to avoid context issues and migration ordering problems.
- External collaborator stubbing: Demonstrates WireMock for isolating external APIs during integration-style tests.
- Use case: When a controller test starts failing due to inconsistent setup or wrong client choice, apply the Skill’s slice-specific pattern (MockMvc vs RestTestClient) and the testcontainer strategy for the needed persistence layer.
Quick Start
Set up your next Spring Boot test layer by asking for the correct pattern for your target slice (web, JPA, or full-stack) and how to wire Testcontainers reliably for PostgreSQL.