spring-mvc-testing
Boot 4+ replaced MockMvc assertions with MockMvcTester — incompatible API your training data gets wrong. Read before writing any @WebMvcTest. Triggers: @WebMvcTest, MockMvc, MockMvcTester, @RestController, jsonPath, @GetMapping, @PostMapping, @AutoConfigureMockMvc, MockMvcRequestBuilders, status().isOk(), @RestControllerAdvice, contentType(APPLICATION_JSON).
How do I install this agent skill?
npx skills add https://github.com/spring-ai-community/spring-testing-skills --skill spring-mvc-testingIs this agent skill safe to install?
- Gen Agent Trust Hubpass
This skill provides documentation and code patterns for testing Spring MVC applications, specifically focusing on the transition from Spring Boot 3 to Spring Boot 4. No security issues were detected.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
- Runlayerpass
2 files scanned · No issues
What does this agent skill do?
Spring MVC Testing
Signals: @WebMvcTest, MockMvc, jsonPath, @AutoConfigureMockMvc, @RestController, MockMvcRequestBuilders, MockMvcResultMatchers, objectMapper
Tested With
- Spring Boot 3.2+ / Spring Boot 4.x
- Spring Framework 6.x / Spring Framework 7.x
- Spring Security 6.x / 7.x (auto-configured in
@WebMvcTest) - JUnit 5
Do NOT Use This Skill When
- Testing authentication, authorization, CSRF, JWT, or OAuth2 specifically → use
spring-security-testing - Testing reactive endpoints (
WebFlux,WebClient, SSE) → usespring-webflux-testing - Testing JPA repositories or database persistence → use
spring-jpa-testing - Testing WebSocket or STOMP messaging → use
spring-websocket-testing - Writing pure unit tests without a Spring context → use
spring-testing-fundamentals
When to Read References
| Situation | Read |
|---|---|
Setting up @WebMvcTest, MockMvc configuration, static imports | references/mvc-rest-testing-patterns.md |
| GET, POST, PUT, DELETE request patterns | references/mvc-rest-testing-patterns.md |
jsonPath assertions, response headers, multipart uploads | references/mvc-rest-testing-patterns.md |
Testing @Valid bean validation, @RestControllerAdvice exception handlers | references/mvc-rest-testing-patterns.md |
Boot 4 RestTestClient migration | references/mvc-rest-testing-patterns.md |
| Anti-patterns and common mistakes | references/mvc-rest-testing-patterns.md |
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/spring-ai-community/spring-testing-skills/spring-mvc-testing">View spring-mvc-testing on skillZs</a>