JUnit 5 Testing

JUnit 5 Testing is a skill for Claude Code, Codex from PramodDutta/qaskills. It costs 36 tokens per session (3,629 once invoked), scanned A, original, MIT.

A guide to writing Java tests with JUnit 5, including assertions, repeated input checks, lifecycle hooks, nested tests, and Mockito-based test doubles.

In plain words
What is it for?
Use it to create, review, or debug Java unit and integration tests and to test several inputs without duplicating test code.
Why use it?
It helps you isolate code from databases, web services, and other outside systems while keeping each test focused and readable.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for aider. Also seen: mentions Codex; built for aider.

Good fit Use it to create, review, or debug Java unit and integration tests and to test several inputs without duplicating test code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/pramoddutta/qaskills/junit5-testing
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add PramodDutta/qaskills --skill junit5-testing
Clone the repo
git clone --depth 1 https://github.com/PramodDutta/qaskills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for JUnit 5 Testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/pramoddutta/qaskills/junit5-testing/github.svg)](https://agentmods.dev/skills/pramoddutta/qaskills/junit5-testing)
Your own site
<a href="https://agentmods.dev/skills/pramoddutta/qaskills/junit5-testing"><img src="https://agentmods.dev/badge/skills/pramoddutta/qaskills/junit5-testing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for JUnit 5 Testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/pramoddutta/qaskills/junit5-testing"><img src="https://agentmods.dev/badge/skills/pramoddutta/qaskills/junit5-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,629 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00036 $0.03629
Opus 5.5 $0.00014 $0.01452
Sonnet 5.5 $0.00007 $0.00726
Haiku 4.5 $0.00004 $0.00363

Measured 1mo ago against content hash 3a89c240b62f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

JUnit 5 Testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

seed-skills/junit5-testing/SKILL.md · 493 lines

How it starts

The opening of the file, as written. The whole thing — 493 lines — stays where its author put it; the contents beside it link to each section on GitHub.

JUnit 5 Testing Skill

You are an expert Java developer specializing in testing with JUnit 5 (Jupiter). When the user asks you to write, review, or debug JUnit 5 tests, follow these detailed instructions to produce production-grade test suites with clear structure, comprehensive assertions, and effective use of the JUnit 5 API.

Core Principles

  1. Test behavior, not implementation -- Verify what the code does from a caller's perspective, not internal mechanics that may change during refactoring.
  2. One logical assertion per test -- Each @Test method should verify a single behavior so failures pinpoint the exact issue immediately.
  3. Arrange-Act-Assert -- Structure every test into setup, execution, and verification sections separated by blank lines.
  4. Isolate external dependencies -- Use Mockito to mock databases, HTTP clients, and third-party services in unit tests.
  5. Descriptive display names -- Use @DisplayName to create human-readable test descriptions that serve as living documentation.
  6. Leverage parameterized tests -- Use @ParameterizedTest with sources like @ValueSource, @CsvSource, and @MethodSource to test multiple inputs without code duplication.
  7. Use nested tests for organization -- Group related tests with @Nested inner classes to mirror conditions and behavior hierarchies.

Project Structure

src/
  main/java/com/example/
    service/
      UserService.java
      PaymentService.java
    model/
      User.java
      Order.java
    repository/
      UserRepository.java
    util/
      Validators.java
  test/java/com/example/
    service/
      UserServiceTest.java
      PaymentServiceTest.java
    model/
      UserTest.java
      OrderTest.java
    repository/
      UserRepositoryTest.java
    util/
      ValidatorsTest.java
    integration/
      UserPaymentFlowIT.java
    fixtures/
      TestDataFactory.java
pom.xml (or build.gradle)

Dependencies

Maven (pom.xml)

<dependencies>
    <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter</artifactId>
        <version>5.11.0</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-junit-jupiter</artifactId>
        <version>5.14.0</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
        <version>3.26.0</version>
        <scope>test</scope>
    </dependency>
</dependencies>

Read the full file on GitHub · 493 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 493 lines · 36 tokens per session scan A 3a89c240b62f

Subscribe to this mod's changes

JUnit 5 Testing is a skill published in the GitHub repository PramodDutta/qaskills (238 stars, last pushed 10d ago), licensed MIT. It adds 36 tokens to every session and 3,629 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

archunit-rules

Encode architecture invariants as ArchUnit rules. Use when defining or reviewing layer boundaries, package dependencies, naming conventions, or cross-module access.

loiane/specs-driven-development-spring-angular · 33 tokens

rust-testing

Rust testing patterns including unit tests, integration tests, async testing, property-based testing, mocking, and coverage. Follows TDD methodology.

affaan-m/ECC · 31 tokens

cpp-testing

Use only when writing/updating/fixing C++ tests, configuring GoogleTest/CTest, diagnosing failing or flaky tests, or adding coverage/sanitizers.

affaan-m/ECC · 34 tokens

java-affected-tests

Use before opening or updating an OpenMetadata PR that changes Java, a JSON schema, an index mapping, a SQL migration, seed data or a pom — PR CI no longer runs the Java integration tests (they run only in the merge queue) and the JavaUIIT/search-it suites run only nightly, so this selects the unit tests and…

open-metadata/OpenMetadata · 120 tokens

java-unit-test

A code-generation guide for Java unit tests in Spring Boot projects. Unit tests check one small piece of code in isolation; Spring Boot is a Java framework for building web applications and services.

hashgraph-online/awesome-codex-plugins · 113 tokens

testng-skill

Generates TestNG tests in Java with groups, data providers, parallel execution, XML suite configuration, and listeners. Use when user mentions "TestNG", "@DataProvider", "testng.xml", "groups". Triggers on: "TestNG", "@DataProvider", "testng.xml", "TestNG suite", "parallel tests Java".

LambdaTest/agent-skills · 75 tokens