junit-testing

junit-testing is a skill for Claude Code from VersoXBT/claude-initial-setup. It costs 86 tokens per session (1,838 once invoked), scanned A, original, MIT.

A collection of JUnit 5 patterns for testing Java applications. JUnit is a Java testing framework; the guide also covers Mockito, Spring Boot test slices, MockMvc, Testcontainers, and parameterized tests.

In plain words
What is it for?
Use it when writing Java unit tests, Spring Boot controller or data tests, integration tests with real databases, or tests that run across several inputs.
Why use it?
It helps you test individual pieces and larger integrations with repeatable checks. The examples reduce uncertainty around mocking, web controllers, databases, and multiple test inputs.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the claude-initial-setup plugin — 75 skills, 15 commands, 14 agents, 2 hooks shipped together

Good fit Use it when writing Java unit tests, Spring Boot controller or data tests, integration tests with real databases, or tests that run across several inputs.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/versoxbt/claude-initial-setup/junit-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 VersoXBT/claude-initial-setup --skill junit-testing
Clone the repo
git clone --depth 1 https://github.com/VersoXBT/claude-initial-setup

Made for: Claude Code.

Or install claude-initial-setup, the plugin that ships this one along with the rest of its 75 skills, 15 commands, 14 agents, 2 hooks.

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-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/versoxbt/claude-initial-setup/junit-testing.svg)](https://agentmods.dev/skills/versoxbt/claude-initial-setup/junit-testing)
Your own site
<a href="https://agentmods.dev/skills/versoxbt/claude-initial-setup/junit-testing"><img src="https://agentmods.dev/badge/skills/versoxbt/claude-initial-setup/junit-testing.svg" alt="Measured on agentmods" height="20"></a>
Per session 86 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,838 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.
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.00086 $0.01838
Opus 5 $0.00043 $0.00919
Sonnet 5 $0.00017 $0.00368
Haiku 4.5 $0.00009 $0.00184

Measured 4d ago against content hash 7aa445731cee, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

junit-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 4d 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.

skills/java/junit-testing/SKILL.md · 232 lines

How it starts

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

JUnit 5 Testing Patterns

Patterns for writing effective unit, integration, and slice tests in Java.

When to Use

  • User is writing JUnit 5 tests
  • User needs to mock dependencies with Mockito
  • User asks about Spring Boot test slices (@WebMvcTest, @DataJpaTest)
  • User wants integration tests with real databases (Testcontainers)
  • User needs parameterized tests for multiple inputs

Core Patterns

JUnit 5 Annotations and Lifecycle

import org.junit.jupiter.api.*;
import static org.junit.jupiter.api.Assertions.*;

class UserServiceTest {
    private UserService userService;
    private UserRepository userRepository;

    @BeforeEach
    void setUp() {
        userRepository = new InMemoryUserRepository();
        userService = new UserService(userRepository);
    }

    @Test
    @DisplayName("creates a user with valid input")
    void createsUserWithValidInput() {
        User result = userService.createUser(new CreateUserRequest("Alice", "[email protected]"));
        assertAll(
            () -> assertNotNull(result.getId()),
            () -> assertEquals("Alice", result.getName()),
            () -> assertEquals("[email protected]", result.getEmail())
        );
    }

    @Test
    @DisplayName("throws when email is already taken")
    void throwsWhenEmailTaken() {
        userRepository.save(new User("Bob", "[email protected]"));
        assertThrows(ConflictException.class,
            () -> userService.createUser(new CreateUserRequest("Bob2", "[email protected]")));
    }

    @Nested
    @DisplayName("when user exists")
    class WhenUserExists {
        private User existingUser;

        @BeforeEach
        void setUp() {
            existingUser = userRepository.save(new User("Alice", "[email protected]"));
        }

        @Test
        void findsById() {
            Optional<User> found = userService.findById(existingUser.getId());
            assertTrue(found.isPresent());
            assertEquals("Alice", found.get().getName());
        }
    }
}

Read the full file on GitHub · 232 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. 4d ago First seen · 232 lines · 86 tokens per session scan A 7aa445731cee

Subscribe to this mod's changes

junit-testing is a skill published in the GitHub repository VersoXBT/claude-initial-setup (4 stars, last pushed 4mo ago), licensed MIT. It adds 86 tokens to every session and 1,838 once invoked, about $0.0004 per session on Opus 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

java-conventions

Use when a ticket adds or changes Java code and it must follow the repo's Java conventions — modern Java (records, sealed types, pattern matching, switch expressions), Optional discipline, immutability, Spring Boot constructor injection, and JUnit 5 + Mockito tests. Invoke for "add this in Java", "fix the Java build"…

tmj-90/gaffer · 89 tokens

implement

Use in the Implement phase whenever writing or editing production Java code, or fixing a bug, in a Spring/Spring Boot project. Enforces test-first (red-green-refactor), executes the approved plan step by step, and honors the project's path-scoped tech-stack rules and the task's enforcement set. Preloaded into…

taipt1504/claudehut · 73 tokens

temporal-python-testing

Test Temporal workflows with pytest, time-skipping, and mocking strategies. Covers unit testing, integration testing, replay testing, and local development setup. Use when implementing Temporal workflow tests or debugging test failures.

wshobson/agents · 45 tokens

qa-testing-nunit

Designs NUnit-based C# test suites for API, component, and integration coverage. Use when creating fixtures, wiring Testcontainers, or reducing flaky CI behavior.

vasilyu1983/AI-Agents-public · 37 tokens

python-conventions

Use when a ticket adds or changes Python code and it must follow the repo's Python conventions — PEP 8, full type hints, dataclasses, pythonic idioms, explicit error handling, and pytest with coverage. Invoke for "add this in Python", "fix the type/lint errors", "add the FastAPI/Django endpoint", or as the language…

tmj-90/gaffer · 84 tokens

golang-testing

Provides a comprehensive guide for writing production-ready Golang tests. Covers table-driven tests, test suites with testify, mocks, unit tests, integration tests, benchmarks, code coverage, parallel tests, fuzzing, fixtures, goroutine leak detection with goleak, snapshot testing, memory leaks, CI with GitHub…

yzfly/skills · 100 tokens