This skill enforces modern Java testing practices with JUnit 5 and AssertJ assertions instead of old-school JUnit assertions. It activates when you say "add tests" or "improve test coverage" and pushes you toward readable patterns like the AAA structure, descriptive @DisplayName annotations, and AssertJ's fluent chains that actually tell you what failed. The source shows good taste: nested test classes for organization, extracting() for collection verification, and soft assertions when you need multiple checks. It steers you away from assertEquals toward assertThat() with clear failure messages. If you're still writing assertTrue and basic JUnit assertions, this will modernize your test style fast.

skills.sh installs
336
GitHub stars
771
last updated
Feb 8, 2026

Install

$ npx -y skills add decebals/claude-code-java --skill test-quality --agent claude-code

Installs into .claude/skills of the current project.

Files

Test Quality Skill (JUnit 5 + AssertJ)

Write high-quality, maintainable tests for Java projects using modern best practices.

When to Use

  • Writing new test classes
  • Reviewing/improving existing tests
  • User asks to "add tests" / "improve test coverage"
  • Code review mentions missing tests

Framework Preferences

JUnit 5 (Jupiter)

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Nested;
import static org.assertj.core.api.Assertions.*;

AssertJ over standard assertions

✅ Use AssertJ:

assertThat(plugin.getState())
    .as("Plugin should be started after initialization")
    .isEqualTo(PluginState.STARTED);

assertThat(plugins)
    .hasSize(3)
    .extracting(Plugin::getId)
    .containsExactly("plugin1", "plugin2", "plugin3");

❌ Avoid JUnit assertions:

assertEquals(PluginState.STARTED, plugin.getState()); // Less readable
assertTrue(plugins.size() == 3); // Less descriptive failures

Test Structure (AAA Pattern)

Always use Arrange-Act-Assert pattern:

Sponsors

Details

Repository
github.com/decebals/claude-code-java
Categories
Testing & QA, Code Review & Quality, Java & JVM
License
MIT
First seen
Jun 11, 2026

More from decebals/claude-code-java

All 18
1secondsky avatarbun-test-mockingsecondsky/claude-skillsUse for mock functions in Bun tests, spyOn, mock.module, implementations, and test doubles.335skills.sh installs
2secondsky avatarbun-jest-migrationsecondsky/claude-skillsUse when migrating from Jest to Bun's test runner, import compatibility, mocks, and config.326skills.sh installs
3davila7 avatartdd-workflowdavila7/claude-code-templatesTest-Driven Development workflow principles. RED-GREEN-REFACTOR cycle.290skills.sh installs
4dhruvanbhalara avatarflutter-testingdhruvanbhalara/skillsDefine testing strategy, test pyramid, and pattern-based conventions (Golden Variants, State Matrix, Interaction Contracts). Use when establishing test architec283skills.sh installs
5dubzzz avatarjavascript-testing-expertdubzzz/fast-checkExpert-level JavaScript testing skill focused on writing high-quality tests that find bugs, serve as documentation, and prevent regressions. Advocates for prope269skills.sh installs
6patricio0312rev avatarintegration-test-builderpatricio0312rev/skillsCreates integration tests for API endpoints with database flows, including test harness setup, fixtures, setup/teardown, database seeding, and CI-friendly strat263skills.sh installs