$npx skillfedfor your agent

test-quality

Test Quality guides you through writing maintainable Java tests using JUnit 5 and AssertJ. It covers the Arrange-Act-Assert pattern, collection and exception assertions, nested test organization, and parameterized testing to improve code coverage and test readability.

Test Quality writes high-quality JUnit 5 tests with AssertJ assertions for Java projects.

AI-generated summary based on this skill's SKILL.md

693 135 MITupdated by decebals

Decision gist · record as of 2026-02-08

Test Quality writes high-quality JUnit 5 tests with AssertJ assertions for Java projects. Test Quality guides you through writing maintainable Java tests using JUnit 5 and AssertJ. It covers the Arrange-Act-Assert pattern, collection and exception assertions, nested test organization, and parameterized testing to improve code coverage and test readability.

manual: git clone https://github.com/decebals/claude-code-java → cp -r claude-code-java/.claude/skills/test-quality ~/.claude/skills/test-quality
.claude/skills/test-quality/SKILL.md · version 68d9abf5

Use it when

  • Test Quality explains that AssertJ provides a fluent, chainable API with more readable assertions than JUnit's built-in methods.
  • Test Quality guides you through AssertJ's fluent syntax for common scenarios: use assertThat() with chainable methods like isEqualTo().

Verify before relying

Read SKILL.md below before installing (2 files). Open directory: indexed for reading, not audited.

Same gist for agents: .md · .json

Install

decebals/claude-code-java/test-quality · repository language: Shell

Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

How do I write JUnit 5 tests for Java?

Test Quality helps you write JUnit 5 tests using the Arrange-Act-Assert pattern. Start by organizing your test class with @Test methods, set up your test data in the arrange phase, execute the code being tested in the act phase, and verify results using AssertJ assertions in the assert phase. Test Quality covers structuring tests with nested classes for better organization and using parameterized tests to reduce duplication.

What are the key differences between AssertJ and JUnit assertions?

Test Quality explains that AssertJ provides a fluent, chainable API with more readable assertions than JUnit's built-in methods. AssertJ offers richer matchers for collections, strings, and exceptions, supports soft assertions to check multiple conditions without stopping on first failure, and delivers clearer error messages. This makes AssertJ ideal for writing high-quality, maintainable tests that are easier to debug.

How to use AssertJ assertions effectively in tests?

Test Quality guides you through AssertJ's fluent syntax for common scenarios: use assertThat() with chainable methods like isEqualTo(), contains(), and hasSize() for collections. For strings, leverage startsWith(), endsWith(), and matches(). AssertJ also supports soft assertions via SoftAssertions class to verify multiple conditions, and specialized methods like assertThatThrownBy() for exception testing, all improving test readability and maintainability.

What are JUnit 5 best practices for test organization?

Test Quality recommends organizing tests with nested classes using @Nested to group related test cases by behavior or scenario, improving readability and structure. Use @DisplayName for clear test descriptions, @ParameterizedTest with various sources for testing multiple inputs, and the Arrange-Act-Assert pattern consistently. This approach enhances test coverage, makes tests self-documenting, and simplifies maintenance as your test suite grows.

How do I improve test coverage and quality in Java projects?

Test Quality teaches you to improve coverage by writing parameterized tests that check multiple scenarios with less code, using nested test classes to organize related tests, and leveraging AssertJ's collection and exception assertions for thorough verification. Focus on testing edge cases, exception handling, and async operations. Regular refactoring of tests using these patterns ensures your test suite remains maintainable and provides genuine value.

How can I test exception handling and async operations with JUnit 5?

Test Quality covers exception testing using AssertJ's assertThatThrownBy() to verify both exception type and message, and assertThatCode() for code that should not throw. For async operations, use JUnit 5's timeout support with @Timeout annotation and combine it with AssertJ assertions. These techniques ensure your error handling is robust and async code behaves correctly under various conditions.

SKILL.md

Rendered from the published skill. Quoted content, verbatim.

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: ```java assertEquals(PluginState.STARTED, plugin.getState());

(truncated - see the full file via the links below)

File tree — 2 files
.claude/skills/test-quality/README.md
.claude/skills/test-quality/SKILL.md

Let your AI agent find skills like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.

wish › “Write high-quality JUnit 5 tests with AssertJ for Java projects”

Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →

Related skills

Java Test Generator
by dawiddutoit · dawiddutoit/custom-claude

Automatically generate well-structured JUnit 5 test cases for Java classes, complete with Mockito mocking, parameterized test scenarios, and edge case handling. The skill follows Arrange-Act-Assert patterns, creates tests for exception handling, verifies mock interactions, and targets high test coverage across service layers and Spring Boot components.

no license declared → metadata onlyupdated Jan 2026
★ 1repo stars
unit-test-boundary-conditions
by giuseppe-trisciuoglio · giuseppe-trisciuoglio/developer-kit

This skill provides systematic testing patterns for Java boundary conditions and corner cases using JUnit 5 and AssertJ. It covers numeric limits, string edge states, collection boundaries, floating-point precision, date/time edges, and array indexing scenarios. Use parameterized tests and tolerance-based assertions to validate that your code handles limits, special inputs, and overflow/underflow correctly.

MITupdated Jun 2026
★ 311repo stars
Java Testing
by pluginagentmarketplace · pluginagentmarketplace/custom-plugin-java

Build reliable unit tests for Java applications using JUnit 5, Mockito, and AssertJ with support for mocking, parameterized tests, and fluent assertions. Includes integration testing patterns with Testcontainers and Spring Boot Test, plus TDD and test coverage best practices to improve code quality.

no license declared → metadata onlyupdated Jan 2026
★ 40repo stars
unit-test-utility-methods
by giuseppe-trisciuoglio · giuseppe-trisciuoglio/developer-kit

This skill generates test patterns for utility classes with static methods and pure functions. It covers null handling, edge cases, boundary conditions, and common utilities like string manipulation, math helpers, validators, and collection operations using AssertJ assertions and parameterized tests.

MITupdated Jun 2026
★ 311repo stars
junit-5-skill
by LambdaTest · LambdaTest/agent-skills

This skill equips you to write robust JUnit 5 tests in Java, from basic assertions and exception handling to parameterized test cases and Mockito-driven mocking. It covers lifecycle management, nested test organization, and anti-patterns to avoid, with quick reference commands for Maven and Gradle execution.

MITupdated Jul 2026
★ 339repo stars
test-driven-development
by ShaftHQ · ShaftHQ/SHAFT_ENGINE

This skill teaches the red-green-refactor cycle: write a failing test, verify it fails for the right reason, implement just enough code to pass, then refactor. Follow the iron law—no production code without a failing test first—and use this approach for all features, bug fixes, and refactoring work.

MITfor claude-codeupdated Jul 2026
★ 404repo stars

More skills vitest-testing-patterns (MIT)

Tags
assertion-frameworktest-structurecode-coveragemock-testingparameterized-testsexception-handlingtest-organizationfluent-api