# java-testing-advanced

A Java testing skill that spins up real databases and Kafka in containers, checks API contracts, and hunts coverage gaps with mutation testing.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 328 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-advanced/SKILL.md
- Updated: 2026-01-05
- HTML: https://affpapa.org/en/nevibecode/skills/java-testing-advanced

## What it does

The skill hands your agent four advanced Java testing techniques. Testcontainers starts PostgreSQL and Kafka inside the test, and `@DynamicPropertySource` wires their addresses into the Spring config. Pact contract tests describe what the consumer expects and run it against a mock server. Mutation testing is configured through the `pitest-maven` plugin with a mutation threshold. Property-based tests check invariants against generated data.

Inside are ready code samples for each technique plus a troubleshooting table: slow containers, port conflicts, flaky tests. A `technique` parameter takes `testcontainers`, `contract`, `mutation` or `property_based`, so the agent picks the right branch from your prompt.

Testcontainers needs Docker running on the machine — without it the integration tests never start. The sample sets the mutation threshold to 80, which is worth checking against your project before you wire it into the build.

## Install

### Claude Code (native platform)

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

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

### Codex

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

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

### Cursor

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

2. **Manually: put the files in place**
- File: `.cursor/skills/java-testing-advanced/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-advanced
```

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

### Gemini CLI

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

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

### Windsurf (Devin Desktop)

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

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-java --skill java-testing-advanced -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-advanced/SKILL.md

## When to use it
- run integration tests against a real PostgreSQL and Kafka
- verify the contract between a consumer service and its provider
- find untested branches with mutation testing
- generate test cases from random data instead of hand-written examples
- deal with slow containers and port conflicts

## Example prompts
- Set up Testcontainers for the order repository test with PostgreSQL and Kafka
- Add a Pact contract test between order-service and user-service
- Configure pitest-maven with a mutation threshold of 80 for com.example.service

## Similar
- [java-architect](https://affpapa.org/en/nevibecode/agents/java-architect.md) — subagent · 558 installs
- [spring-boot-test-patterns](https://affpapa.org/en/nevibecode/skills/spring-boot-test-patterns.md) — skill · 4300 installs
- [322-frameworks-spring-boot-testing-integration-tests](https://affpapa.org/en/nevibecode/skills/322-frameworks-spring-boot-testing-integration-tests.md) — skill · 357 installs
- [323-frameworks-spring-boot-testing-acceptance-tests](https://affpapa.org/en/nevibecode/skills/323-frameworks-spring-boot-testing-acceptance-tests.md) — skill · 324 installs
- [langchain4j-testing-strategies](https://affpapa.org/en/nevibecode/skills/langchain4j-testing-strategies.md) — skill · 3700 installs
- [java-mcp-server-generator](https://affpapa.org/en/nevibecode/skills/java-mcp-server-generator.md) — skill · 8800 installs

From the same set: [pluginagentmarketplace/custom-plugin-java](https://affpapa.org/en/nevibecode/by/pluginagentmarketplace/custom-plugin-java.md) — 4 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
