Agent skill

Java Testing Junit Mockito

by makifbaysal in makifbaysal/tasktrooper

A skill your agent uses when writing tests for Java (Quarkus or Spring) code - JUnit Jupiter structure, Mockito for collaborators, test slices, Testcontainers, and framework-native integration…

Apache-2.0Auto-check passedTesting & QA

Install Java Testing Junit Mockito

skills CLI
$ npx skills add makifbaysal/tasktrooper --skill java-testing-junit-mockito -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install makifbaysal/tasktrooper java-testing-junit-mockito --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/makifbaysal/tasktrooper.git skills-src && mkdir -p .claude/skills && cp -r skills-src/catalog/agents/backend-developer/skills/java-testing-junit-mockito .claude/skills/java-testing-junit-mockito && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
java-testing-junit-mockito
GitHub stars
109
Token cost
~1.1k tokens
SKILL.md length
435 words
Files
1
Skills in repo
99
Repo updated
First seen
Licence
Apache-2.0

At a glance

A skill your agent uses when writing tests for Java (Quarkus or Spring) code - JUnit Jupiter structure, Mockito for collaborators, test slices, Testcontainers, and framework-native integration…

  • Writing tests for Java (Quarkus
  • SKILL.md covers Overview, Test levels, JUnit Jupiter + Mockito unit… and Rules, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Spring) code - JUnit Jupiter structure

What it does

Java Testing Junit Mockito is an agent skill from makifbaysal/tasktrooper. Use when writing tests for Java (Quarkus or Spring) code - JUnit Jupiter structure, Mockito for collaborators, test slices, Testcontainers, and framework-native integration tests, test-first

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Integration testing, Unit testing and Test-driven development. It works with JUnit and Java. The repository describes itself as: Local-first agent platform: board + role agents + agent CLI runs (Claude Code, Cursor, Antigravity, OpenCode) or local and API models (Ollama, LM Studio), all on your own Mac. The licence is Apache-2.0.

When your agent uses it

  • Writing tests for Java (Quarkus
  • Spring) code - JUnit Jupiter structure
  • Mockito for collaborators
  • Framework-native integration tests

Example prompts

  • “/java-testing-junit-mockito”

What it can do on your machine

Read from SKILL.md and the folder at commit f3d59b5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are java).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Java Testing Junit Mockito loads about 1.1k tokens when it runs. Until then it costs about 54 tokens; SKILL.md has 435 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~54
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from makifbaysal/tasktrooper at commit f3d59b5, republished under its Apache-2.0 licence (© makifbaysal). 435 words, ~1,122 tokens.

Download SKILL.mdSave it as .claude/skills/java-testing-junit-mockito/SKILL.md (or your agent's skills folder).
name
java-testing-junit-mockito
description
Use when writing tests for Java (Quarkus or Spring) code - JUnit Jupiter structure, Mockito for collaborators, test slices, Testcontainers, and framework-native integration tests, test-first
category
testing
tech_stack
Java
source
sivaprasadreddy/sivalabs-agent-skills (MIT), adapted

Java Testing (JUnit Jupiter + Mockito)

Overview

Test-first in Java, same discipline as everywhere (see tdd-workflow): write the failing test, watch it fail, minimal code to pass. This skill is the Java mechanics for that cycle.

Core principle: Unit-test the domain and services as plain Java without booting the framework. Reserve framework-integration tests for the boundary (HTTP, persistence).

Test levels

LevelWhat it coversTools
UnitDomain entity / value object, no mocksJUnit Jupiter
Unit with mocksService (mock its ports)JUnit Jupiter + Mockito
Persistence sliceRepository against a real DB, no HTTP layer@DataJpaTest (Spring) + Testcontainers @ServiceConnection; Quarkus @QuarkusTest with Dev Services
Web sliceController/resource wiring, serialization, validation — mocked service@WebMvcTest (Spring); Quarkus @QuarkusTest + @InjectMock
End-to-endFull app boot, real DB, real HTTP@SpringBootTest(webEnvironment=RANDOM_PORT) + RestTestClient (Spring Boot 4); @QuarkusTest + RestAssured

Most tests are the first two — fast, no container. Boot the framework only where you're testing wiring, serialization, or SQL; reach for the narrowest slice that proves it before a full @SpringBootTest/plain @QuarkusTest.

JUnit Jupiter + Mockito unit test

java
class TaskServiceTest {
    private final TaskRepository repo = mock(TaskRepository.class);
    private final TaskService service = new TaskService(repo);   // constructor injection pays off

    @Test
    void create_persists_and_returns_task() {
        Task t = service.create("Write the report");
        verify(repo).persist(any(Task.class));   // or save(...) for Spring
        assertEquals("Write the report", t.title());
    }

    @Test
    void create_rejects_blank_title() {
        assertThrows(InvalidTaskTitle.class, () -> service.create("  "));
        verifyNoInteractions(repo);              // invalid input never hits the DB
    }
}

Rules

  • Mock collaborators (ports), never the class under test. A test whose asserts only exercise the mock proves nothing — assert on the real object's behavior/return.
  • One behavior per @Test, named for the behavior (create_rejects_blank_title).
  • Prefer real value objects over mocking them — they're cheap to construct.
  • @ParameterizedTest for boundary tables (200 chars ok, 201 rejected).
  • Integration tests use Testcontainers for a real Postgres, not H2 — test against the DB you deploy on. Seed per test with the repository's real migrations plus minimal inserts; never share state between tests.
  • AssertJ (assertThat(...)) is fine and reads well; match the repo's existing assertion style.
  • Spring Boot 4: @MockitoBean/@MockitoSpyBean replace @MockBean/@SpyBean, which were removed in Boot 4.0 — use the old annotations only on a repo still pinned to Boot 3.x.
  • Quarkus: @InjectMock inside a @QuarkusTest for a CDI-bean mock; RestAssured for the HTTP-level assertion: given().when().post("/tasks").then().statusCode(201).
  • Testcontainers Java 2.x coordinates: artifacts are prefixed testcontainers-* (e.g. org.testcontainers:testcontainers-postgresql), class org.testcontainers.postgresql.PostgreSQLContainer; JUnit 4 support was removed, Jupiter only.
  • On JDK 21+, register mockito-core as a -javaagent in the build's surefire/failsafe config if the repo doesn't already, to avoid the dynamic-agent-loading warning.
Show full SKILL.md (85 more words)Show less

Common Mistakes

  • @SpringBootTest/plain @QuarkusTest on everything — slow, and hides design problems that plain unit tests would surface.
  • Mocking the service you're testing.
  • Asserting verify(mock) only, never checking the returned/observable value.
  • H2 in tests but Postgres in prod — dialect gaps ship bugs.
  • Using @MockBean on a Spring Boot 4 repo (removed; use @MockitoBean).

Red Flags

  • The test passes without the production code being written (it tests the mock).
  • A unit test that needs a running database.
  • No failing-first run — you wrote the test after the code.

© makifbaysal, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in catalog/agents/backend-developer/skills/java-testing-junit-mockito of makifbaysal/tasktrooper.

Open the folder on GitHubat commit f3d59b5

Compare with similar skills

Java Testing Junit Mockito next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Java Testing Junit Mockito compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Java Testing Junit Mockito this skillmakifbaysal/tasktrooper109—~1.1kAutomated safety check: PassApache-2.0
Junit 5 Skillsickn33/agentic-awesome-skills47k1 repos~1.8kAutomated safety check: PassMIT
TDD GuideLeoYeAI/openclaw-master-skills2.2k—~1.4kAutomated safety check: PassMIT
Test Driven GenerationArabelaTso/Skills-4-SE253—~1.1kAutomated safety check: PassApache-2.0
Rust Testingkurealnum/dotfiles2906 repos~2.9kAutomated safety check: PassNone
Springboot TDDaffaan-m/ECC274k5 repos~947Automated safety check: PassMIT

Similar skills

  • Junit 5 Skill

    sickn33/agentic-awesome-skills

    Generates production-grade JUnit 5 unit and integration tests in Java.

    47k GitHub starsUsed in 1 repo~1.8k tokens
    Testing & QAAuto-check passed
  • TDD Guide

    LeoYeAI/openclaw-master-skills

    Test-driven development skill for writing unit tests, generating test fixtures and mocks, analyzing coverage gaps, and guiding red-green-refactor workflows across Jest, Pytest, JUnit, Vitest, and…

    2.2k GitHub stars~1.4k tokensUpdated 2 mo ago
    Testing & QAAuto-check passed
  • Test Driven Generation

    ArabelaTso/Skills-4-SE

    Generate implementation code that passes existing unit tests.

    253 GitHub stars~1.1k tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • Rust Testing

    kurealnum/dotfiles

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

    290 GitHub starsUsed in 6 repos~2.9k tokens
    Testing & QAAuto-check passed
  • Springboot TDD

    affaan-m/ECC

    Test-driven development for Spring Boot using JUnit 5, Mockito, MockMvc, Testcontainers, and JaCoCo.

    274k GitHub starsUsed in 5 repos~947 tokens
    Testing & QAAuto-check passed
  • Debug Surefire

    eclipse-rdf4j/rdf4j

    Debug Maven Surefire unit tests by running them in JDWP "wait for debugger" mode (-Dmaven.surefire.debug) and attaching to the forked test JVM using jdb (preferred for CLI/agent debugging)…

    420 GitHub stars~2.4k tokensUpdated today
    Testing & QAAuto-check passed

More from makifbaysal/tasktrooper

All 99 skills in this repo
  • API Contract Testing

    makifbaysal/tasktrooper

    A skill your agent uses when a task adds or changes an HTTP endpoint, its request/response shape, status codes, auth or error format - the request matrix, curl templates and what counts as a…

    109 GitHub starsUsed in 1 repo~754 tokens
    Auto-check passed
  • Acceptance Criteria Gwt

    makifbaysal/tasktrooper

    A skill your agent uses when writing acceptance criteria for a task - express each as an observable Given/When/Then that QA can execute, including negative cases

    109 GitHub stars~1.7k tokensUpdated yesterday
    Auto-check passed
  • Accessibility Check

    makifbaysal/tasktrooper

    A skill your agent uses when a task changes any screen, form, dialog, menu or control - Lighthouse/axe scan of the changed screens, a keyboard walk, and the thresholds that fail a task

    109 GitHub stars~1k tokensUpdated yesterday
    Auto-check passed
  • Analiz Gate

    makifbaysal/tasktrooper

    A skill your agent uses when deciding whether a request needs an analiz task before implementation - the conditions that require the architect's analysis versus going straight to implementation

    109 GitHub stars~641 tokensUpdated yesterday
    Auto-check passed
  • Analiz HTML Report

    makifbaysal/tasktrooper

    A skill your agent uses when you write or revise the analiz deliverable - the ONE self-contained HTML report (spec and plan as sections) a human reviews passage by passage

    109 GitHub stars~3.9k tokensUpdated yesterday
    Auto-check passed
  • Analiz Human Review Gate

    makifbaysal/tasktrooper

    A skill your agent uses when you finish an analiz report - the human must approve the analysis before any implementation task is created, via the analizreview column

    109 GitHub stars~2.2k tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about Java Testing Junit Mockito

What does Java Testing Junit Mockito do?

A skill your agent uses when writing tests for Java (Quarkus or Spring) code - JUnit Jupiter structure, Mockito for collaborators, test slices, Testcontainers, and framework-native integration…. Java Testing Junit Mockito is an agent skill from makifbaysal/tasktrooper.

When should I use Java Testing Junit Mockito?

Java Testing Junit Mockito fits situations like: writing tests for Java (Quarkus; spring) code - JUnit Jupiter structure; mockito for collaborators; framework-native integration tests.

How do I install Java Testing Junit Mockito in Claude Code?

Run `npx skills add makifbaysal/tasktrooper --skill java-testing-junit-mockito -a claude-code`. Or copy the skill folder (catalog/agents/backend-developer/skills/java-testing-junit-mockito in makifbaysal/tasktrooper) into .claude/skills/java-testing-junit-mockito in your project. Claude Code loads it when a task matches its description.

How do I install Java Testing Junit Mockito in Codex?

Run `npx skills add makifbaysal/tasktrooper --skill java-testing-junit-mockito -a codex`. Or copy the skill folder (catalog/agents/backend-developer/skills/java-testing-junit-mockito in makifbaysal/tasktrooper) into .agents/skills/java-testing-junit-mockito in your project. Codex loads it when a task matches its description.

Can I use Java Testing Junit Mockito in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add makifbaysal/tasktrooper --skill java-testing-junit-mockito -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/java-testing-junit-mockito, .gemini/skills/java-testing-junit-mockito, .github/skills/java-testing-junit-mockito and .opencode/skills/java-testing-junit-mockito in your project.

What does Java Testing Junit Mockito need to run?

SKILL.md names no scripts, command-line tools or credentials: Java Testing Junit Mockito is instructions for the agent only.

Does Java Testing Junit Mockito access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Java Testing Junit Mockito safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Java Testing Junit Mockito use?

Java Testing Junit Mockito is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Java Testing Junit Mockito use?

About 1.1k tokens (SKILL.md is roughly 4.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Java Testing Junit Mockito?

Skills that share tags, products or a category with Java Testing Junit Mockito: Junit 5 Skill (sickn33/agentic-awesome-skills, 47k stars), TDD Guide (LeoYeAI/openclaw-master-skills, 2.2k stars), Test Driven Generation (ArabelaTso/Skills-4-SE, 253 stars) and Rust Testing (kurealnum/dotfiles, 290 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Java Testing Junit Mockito?

makifbaysal (a GitHub user) maintains it in makifbaysal/tasktrooper, which has 109 GitHub stars. The repository holds 99 skills in this directory. The repository was last updated on October 6, 2026.

Source: makifbaysal/tasktrooper on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.