# java-testing

Generates unit and integration tests for Java services. Helps configure JUnit 5, Mockito stubs, and Testcontainers environments.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 902 installs · ★ 41
- Author: pluginagentmarketplace
- License: LicenseRef-Proprietary · policy=link-only · description only; the file stays with the author
- Source: https://github.com/pluginagentmarketplace/custom-plugin-java/tree/HEAD/skills/java-testing/SKILL.md
- Updated: 2026-01-05
- HTML: https://affpapa.org/en/nevibecode/skills/java-testing

## What it does

This skill instructs the agent to create test suites for Java codebases. JUnit 5 acts as the default runner, with TestNG available as an option. The assistant handles unit checks, contract validations, and end-to-end flows. It structures Mockito mocks, AssertJ assertions, and builder patterns.

Integration workflows rely on Spring Boot test slices and Testcontainers. The skill also covers JaCoCo configuration for tracking code coverage.

Uninitialized mocks break test runs immediately. If `@ExtendWith(MockitoExtension.class)` is missing, Mockito stubs will not work. The skill includes a troubleshooting checklist for shared state issues and missing `@MockBean` entries. The agent requires file access tools (`Read`, `Write`, `Glob`, `Grep`) and terminal execution through `Bash`.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-java --skill java-testing -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/java-testing/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/java-testing/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-java --skill java-testing -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/java-testing/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-java --skill java-testing -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/java-testing/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install pluginagentmarketplace/custom-plugin-java java-testing
```

2. **Manually: put the files in place**
- File: `.github/skills/java-testing/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-java --skill java-testing -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/pluginagentmarketplace/custom-plugin-java --path skills/java-testing
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/java-testing/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-java --skill java-testing -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/pluginagentmarketplace/custom-plugin-java/tree/HEAD/skills/java-testing/SKILL.md

## When to use it
- generate unit tests with Mockito mocks and AssertJ assertions
- set up database integration tests with Testcontainers in Spring Boot
- write parameterized test cases using `@ParameterizedTest`
- resolve test failures caused by uninitialized mocks or missing Spring beans

## Example prompts
- Write a unit test for `UserService` using Mockito and AssertJ
- Create an integration test for `OrderRepository` using Testcontainers with PostgreSQL
- Add parameterized test cases for email validation in JUnit 5

## Similar
- [improve-codebase-architecture](https://affpapa.org/en/nevibecode/skills/improve-codebase-architecture.md) — skill · 1163035 installs
- [design-taste-frontend](https://affpapa.org/en/nevibecode/skills/design-taste-frontend.md) — skill · 678700 installs
- [tdd](https://affpapa.org/en/nevibecode/skills/tdd.md) — skill · 1141062 installs
- [skill-creator](https://affpapa.org/en/nevibecode/skills/skill-creator.md) — skill · 414180 installs
- [agent-browser](https://affpapa.org/en/nevibecode/skills/vercel-labs-agent-browser.md) — skill · 1200000 installs
- [prototype](https://affpapa.org/en/nevibecode/skills/prototype.md) — skill · 986201 installs

From the same set: [pluginagentmarketplace/custom-plugin-java](https://affpapa.org/en/nevibecode/by/pluginagentmarketplace/custom-plugin-java.md) — 6 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
