Use when you need to write unit tests for Spring Boot applications — including pure unit tests with @ExtendWith(MockitoExtension.class) for @Service/@Component, slice tests with @WebMvcTest and @MockitoBean for controllers, @JsonTest for JSON serialization, parameterized tests with @CsvSource/@MethodSource, test profiles, and @TestConfiguration. For framework-agnostic Java use @131-java-testing-unit-testing. For integration tests use @322-frameworks-spring-boot-testing-integration-tests. This sh
SkillScore73Maintained
Automatic
◆QA & Test Engineering pack
Last verified 8/20/2026
What it changes
Passed 14 of 19 test cases with the skill, and 11 of 19 without it.
Without skill59%
With skill73%
Checks it passed that the model alone missed
Specifies running `./mvnw compile` or `mvn compile`.
Advises stopping immediately without applying test changes.
Reports missing required files or tooling and asks whether to proceed with setup guidance.
3 fixed13 passed either way6 still failing0 broke
Pass-rate lift
+14 pp
Tokens
+19%
Agent turns
0%
Response time
-25%
Model gemini-3.6-flashMeasured 8/20/2026v116 of 22 cases passed with skill · 19 comparable
Tokens, turns and time describe resource use, not a dollar price.
See it in action
One of 3 test cases the skill fixed. Same model, same prompt, with and without the skill.
1 of 3
Prompt
Before making any unit test modifications or refactorings in a Java Maven project, what build command must be executed first to verify the code base is stable?
What was checked, without and with the skill
Checked
Without skill
With skill
Specifies running `./mvnw compile` or `mvn compile`.
Missed
Passed
case-13 · gemini-3.6-flash · 8/20/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md56 lines2 files
Spring Boot Unit Testing with Mockito
Apply Spring Boot unit testing guidelines with Mockito.
What is covered in this Skill?
Pure unit tests: @ExtendWith(MockitoExtension.class), @Mock, @InjectMocks for @Service/@Component (no Spring context)
@JsonTest for JSON serialization with correct JSON value assertions (extractingJsonPathStringValue, etc.)
Parameterized tests: @ParameterizedTest with @CsvSource or @MethodSource over copy-pasted methods
Java records for domain objects in tests
@TestConfiguration, @ActiveProfiles, @Primary fixed-clock beans for deterministic test setup
Modern mocking API: @MockitoBean / @MockitoSpyBean; @MockBean/@SpyBean are deprecated/removed in Boot 4.0.x
Scope: Apply recommendations based on the reference rules and good/bad code examples. For integration tests use @322-frameworks-spring-boot-testing-integration-tests.
Constraints
Before applying any test changes, ensure the project compiles. If compilation fails, stop immediately. After applying improvements, run full verification.
MANDATORY: Run ./mvnw compile or mvn compile before applying any change
SAFETY: If compilation fails, stop immediately
VERIFY: Run ./mvnw clean verify or mvn clean verify after applying improvements
BEFORE APPLYING: Read the reference for detailed rules and good/bad patterns
EDGE CASE: If request scope is ambiguous, stop and ask a clarifying question before applying changes
EDGE CASE: If required inputs, files, or tooling are missing, report what is missing and ask whether to proceed with setup guidance
When to use this skill
Review Java code for Spring Boot unit tests
Apply best practices for Spring Boot unit tests in Java code
Write Mockito-first unit tests for Spring Boot services
Avoid unnecessary @SpringBootTest in Spring unit tests
Review Spring Boot slice-free unit test design
Workflow
Read reference and assess project context
Read references/321-frameworks-spring-boot-testing-unit-tests.md and inspect the current project setup before proposing changes.
Use when you need to create a new Maven-based Quarkus 3.x project using SDKMAN-managed Java and Quarkus CLI tooling. This should trigger for requests such as Create a Quarkus Maven project; Bootstrap Quarkus project with SDKMAN; Generate a new Quarkus service; Create Quarkus 3 Maven project; Scaffold Quarkus service with Java 25. Part of Plinth Toolkit