Skip to content
Agentmart
Submit a tool

java-testing

Design JUnit 5, Mockito, and Spring Boot tests with clear scope and business assertions.

Skill by cong1ling

IndexedMIT★ 1
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/cong1ling-java-testing

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Design JUnit 5, Mockito, and Spring Boot tests with clear scope and business assertions.

Use cases: design, testing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/java-testing

What's inside

Skill name
java-testing
Description
Design JUnit 5, Mockito, and Spring Boot tests with clear scope and business assertions.
License
MIT
Instructions
69 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Java Testing

Use this skill when adding or improving test coverage for Java backend code.

## First decide the test scope

Choose the smallest test type that gives confidence:

- **Unit test**: pure business logic, deterministic branching, mapper-independent rules
- **Slice test**: web layer, JSON binding, validation, repository slice, or focused Spring wiring
- **Integration test**: full flow involving framework wiring, database behavior, or real infrastructure contracts

## Rules

- Test business behavior, not private implementation details.
- Prefer explicit assertions over broad “no exception” checks.
- Avoid loading the full Spring context unless it validates something important.
- Mock only boundaries you truly do not want to exercise.
- Prioritize high-risk and high-value paths first.

## Workflow

1. **Identify the behavior under test**
   - happy path
   - validation failure
   - business rule rejection
   - persistence edge case
   - side effect such as cache/message interaction

2. **Choose the smallest useful test set**
   - one happy path
   - one representative negative path
   - one edge case only if it changes behavior meaningfully

3. **Define clear assertions**
   - returned data
   - thrown exception type/message if stable
   - state transition
   - persistence result
   - side-effect occurrence or non-occurrence

4. **Minimize setup noise**
   - build small fixtures
   - avoid giant object graphs unless necessary
   - use helper builders only when they improve readability

5. **Call out what should not be tested here**
   - framework internals
   - duplicate coverage from lower-cost tests
   - unstable implementation details

## Output format

1. Recommended test type
2. Behaviors to cover
3. Suggested test cases
4. Key assertions
5. Setup notes
6. Risks not covered by this test layer

## JUnit 5 / Spring guidance

- Prefer JUnit 5 naming that reads like behavior.
- Use Mockito for service-boundary isolation, not as the main subject of assertions.
- Use `@WebMvcTest` for request/response and validation-focused checks.
- Use `@DataJpaTest` or equivalent slice patterns where appropriate.
- Use full `@SpringBootTest` selectively for wiring-sensitive paths.

From cong1ling/pi-java-enterprise, MIT.

More from cong1ling/pi-java-enterprise

Signals

Stars
1
Forks
0
Open issues
0
Last commit (this folder)
May 7, 2026 (5 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from cong1ling

Cite this page

java-testing skill. Agent Mart. https://agentmart.dev/skills/cong1ling-java-testing (last updated 2026-10-24)