java-junit

java-junit is a skill for Codex from PracticalSwan/agent-skills. It costs 24 tokens per session (2,663 once invoked), scanned A, original, MIT.

A guide to writing Java unit tests with JUnit 5, including tests that run the same checks against several inputs.

In plain words
What is it for?
Use it when writing or reviewing unit tests in Java projects built with Maven or Gradle.
Why use it?
It helps keep tests focused on observable behavior and avoids fragile patterns such as fixed delays or tests tied to implementation details.

Skill for Codex

Written for Codex: reads $CODEX_HOME. Also seen: mentions Claude Code; mentions Codex.

Good fit Use it when writing or reviewing unit tests in Java projects built with Maven or Gradle.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/practicalswan/agent-skills/java-junit
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 PracticalSwan/agent-skills --skill java-junit
Clone the repo
git clone --depth 1 https://github.com/PracticalSwan/agent-skills

Made for: 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 java-junit

README.md
[![agentmods](https://agentmods.dev/badge/skills/practicalswan/agent-skills/java-junit/github.svg)](https://agentmods.dev/skills/practicalswan/agent-skills/java-junit)
Your own site
<a href="https://agentmods.dev/skills/practicalswan/agent-skills/java-junit"><img src="https://agentmods.dev/badge/skills/practicalswan/agent-skills/java-junit/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 java-junit

Your own site · 80×15
<a href="https://agentmods.dev/skills/practicalswan/agent-skills/java-junit"><img src="https://agentmods.dev/badge/skills/practicalswan/agent-skills/java-junit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,663 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 warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Prompt Injection · line 116
    Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
    Fix: Audit all comments and invisible characters. Remove any instructions that direct the agent to perform unauthorized actions. Use plain, reviewable content.
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.00024 $0.02663
Opus 5.5 $0.00010 $0.01065
Sonnet 5.5 $0.00005 $0.00533
Haiku 4.5 $0.00002 $0.00266

Measured 16d ago against content hash ba89710ebc7b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

java-junit 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 16d 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.

java-junit/SKILL.md · 139 lines

How it starts

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

Java Testing with JUnit 5/6, AssertJ and Mockito

Framework-neutral guidance for fast, deterministic unit tests. For Spring slices use spring-boot-testing (if installed); for real databases/brokers in Docker use java-testcontainers; for failures you cannot explain, java-debugging.

First: detect, don't impose

  1. Read pom.xml/build.gradle*: JUnit version (junit-jupiter, junit-bom, or inherited from a Spring Boot BOM), assertion library, Mockito, Surefire/Failsafe versions, Java release.
  2. Copy the conventions already in src/test/java (naming, assertion library, static imports, mocking style). Do not introduce AssertJ, Mockito or JaCoCo into a project that lacks them without asking.
  3. Never bump the JUnit major version implicitly; upgrading is its own task (see java-upgrade if installed).

JUnit 5 vs JUnit 6

JUnit 5 (last 5.14.x) JUnit 6 (6.0 released; 6.1.x current)
Java baseline 8 17 (verified in the published Gradle module metadata)
Versioning Platform 1.x, Jupiter 5.x, Vintage 5.x One version number for Platform, Jupiter and Vintage
API org.junit.jupiter.api.* Same packages; the Jupiter tests in this skill compile and pass unchanged on 5.14.4 and 6.0.3
Removed in 6.0 MethodOrderer.Alphanumeric, the deprecated two-argument InvocationInterceptor.interceptDynamicTest(Invocation, ExtensionContext) overload (the three-argument one remains), junit.jupiter.tempdir.scope, @CsvFileSource(lineSeparator)
CSV univocity-parsers FastCSV: stricter parsing (no characters after a closing quote); header-field options now apply to headers
Other junit-jupiter-migrationsupport deprecated; invalid enum-style config values now fail discovery; @Nested class order deterministic but non-obvious

Source: JUnit 6.0.0 release notes (https://docs.junit.org/6.0.0/release-notes.html). Read the notes for the target version (https://docs.junit.org/current/release-notes/) and prefer them over this table. JUnit 4 tests need the Vintage engine; do not mix org.junit.Test and org.junit.jupiter.api.Test in one class.

Read the full file on GitHub · 139 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 16d ago Changed · +23 lines ba89710ebc7b
  2. 2mo ago Changed · -31 lines 062d032f51c0
  3. 2mo ago Changed e72c5f43075d
  4. 2mo ago First seen · 147 lines · 24 tokens per session scan A d3bfa30d4f8e

Subscribe to this mod's changes

java-junit is a skill published in the GitHub repository PracticalSwan/agent-skills (25 stars, last pushed 16d ago), licensed MIT. It adds 24 tokens to every session and 2,663 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

java-junit compared with skills from other repositories

java-junit next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
java-junitPracticalSwan/agent-skillsSkill2516d agoMITA24Codex
java-affected-testsopen-metadata/OpenMetadataSkill16ktodayApache-2.0A120Claude Code
java-unit-testhashgraph-online/awesome-codex-pluginsSkill1.6kyesterdayApache-2.0A113Codex
test-qualitydecebals/claude-code-javaSkill7801mo agoMITA45Claude Code, Codex
testng-skillLambdaTest/agent-skillsSkill39914d agoMITA75Claude Code, Codex
111-java-maven-dependenciesjabrena/plinthSkill4702d agoApache-2.0A133Claude Code, Codex
130-java-testing-strategiesjabrena/plinthSkill4702d agoApache-2.0A96Claude Code, Codex