Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use when you need to review, improve, or write Java unit tests — including migrating from JUnit 4 to JUnit 5, adopting AssertJ for fluent assertions, structuring tests with Given-When-Then, ensuring test independence, applying parameterized tests, mocking dependencies with Mockito, verifying boundary conditions (RIGHT-BICEP, CORRECT, A-TRIP), leveraging JSpecify null-safety annotations, or eliminating testing anti-patterns such as reflection-based tests or shared mutable state. This should trigg
.claude/skills/jabrena-131-java-testing-unit-testing/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -23% | 0% |
| case-21 | ✓→✗ | ▼ Worse | -49% | 0% |
| case-19 | ✓→✗ | ▼ Worse | -70% | 0% |
| case-02 | ✓→✓ | = Same ✓ | -5% | 0% |
| case-15 | ✓→✓ | = Same ✓ | 6% | 0% |
Review and improve Java unit tests using modern JUnit 5, AssertJ, and Mockito best practices.
What is covered in this Skill?
@Test, @BeforeEach, @AfterEach, @DisplayName, @Nested, @ParameterizedTestassertThat, assertThatThrownBy@ValueSource/@CsvSource/@MethodSource@Mock, @InjectMocks, MockitoExtensionassertThatThrownBy, exception messages@NullMarked, @NullableScope: The reference is organized by examples (good/bad code patterns) for each core area. Apply recommendations based on applicable examples.
Before applying any unit test changes, ensure the project compiles. If compilation fails, stop immediately — do not proceed until resolved. After applying improvements, run full verification.
./mvnw compile or mvn compile before applying any change./mvnw clean verify or mvn clean verify after applying improvementsRun ./mvnw compile or mvn compile and stop immediately if compilation fails.
Read references/131-java-testing-unit-testing.md and identify modernization and quality gaps in current tests.
Implement or refactor tests using JUnit 5, AssertJ, Mockito, parameterization, and stronger boundary checks.
Run ./mvnw clean verify or mvn clean verify after applying improvements.
For detailed guidance, examples, and constraints, see references/131-java-testing-unit-testing.md.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-21 | pass→fail | 8,834 | 5,341 | -40% | 1 | 1 | 0% | 1,647 | 844 | -49% | 0 | 0 | — |
case-01 | fail→pass | 8,350 | 2,104 | -75% | 1 | 1 | 0% | 1,266 | 974 | -23% | 0 | 0 | — |
case-02 | pass→pass | 8,546 | 3,844 | -55% | 1 | 1 | 0% | 1,219 | 1,157 | -5% | 0 | 0 | — |
case-15 | pass→pass | 5,795 | 2,539 | -56% | 1 | 1 | 0% | 935 | 989 | +6% | 0 | 0 | — |
case-03 | pass→pass | 9,171 | 5,111 | -44% | 1 | 1 | 0% | 1,444 | 1,393 | -4% | 0 | 0 | — |
case-04 | pass→pass | 9,307 | 5,422 | -42% | 1 | 1 | 0% | 1,619 | 1,419 | -12% | 0 | 0 | — |
case-05 | pass→pass | 11,698 | 6,675 | -43% | 1 | 1 | 0% | 1,891 | 1,735 | -8% | 0 | 0 | — |
case-06 | pass→pass | 3,087 | 3,031 | -2% | 1 | 1 | 0% | 528 | 1,128 | +114% | 0 | 0 | — |
case-07 | pass→pass | 15,549 | 11,027 | -29% | 1 | 1 | 0% | 2,553 | 2,478 | -3% | 0 | 0 | — |
case-08 | pass→pass | 12,249 | 9,976 | -19% | 1 | 1 | 0% | 1,826 | 2,075 | +14% | 0 | 0 | — |
case-09 | pass→pass | 10,497 | 8,560 | -18% | 1 | 1 | 0% | 1,678 | 1,894 | +13% | 0 | 0 | — |
case-10 | pass→pass | 9,730 | 8,136 | -16% | 1 | 1 | 0% | 1,491 | 1,869 | +25% | 0 | 0 | — |
case-20 | pass→pass | 16,841 | 19,673 | +17% | 1 | 1 | 0% | 2,946 | 4,249 | +44% | 0 | 0 | — |
case-11 | pass→pass | 13,073 | 11,196 | -14% | 1 | 1 | 0% | 2,229 | 2,770 | +24% | 0 | 0 | — |
case-12 | pass→pass | 14,928 | 9,946 | -33% | 1 | 1 | 0% | 2,361 | 2,216 | -6% | 0 | 0 | — |
case-13 | pass→pass | 8,330 | 5,372 | -36% | 1 | 1 | 0% | 1,383 | 1,441 | +4% | 0 | 0 | — |
case-14 | pass→pass | 4,533 | 3,162 | -30% | 1 | 1 | 0% | 675 | 1,141 | +69% | 0 | 0 | — |
case-16 | pass→pass | 8,141 | 4,283 | -47% | 1 | 1 | 0% | 1,377 | 1,330 | -3% | 0 | 0 | — |
case-17 | pass→pass | 13,903 | 9,112 | -34% | 1 | 1 | 0% | 1,941 | 1,940 | -0% | 0 | 0 | — |
case-18 | pass→pass | 7,396 | 4,341 | -41% | 1 | 1 | 0% | 1,208 | 1,263 | +5% | 0 | 0 | — |
case-19 | pass→fail | 17,967 | 6,140 | -66% | 1 | 1 | 0% | 3,103 | 925 | -70% | 0 | 0 | — |
case-22 | pass→pass | 10,454 | 8,345 | -20% | 1 | 1 | 0% | 1,895 | 2,068 | +9% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 20 counted toward the lift figure. The other 2 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of -5 percentage points is the difference between those two pass rates over the 20 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.