132-java-testing-integration-testing — Claude Code skill for Java
A skill that gets an AI agent to set up and clean up Java integration tests: WireMock stubs, per-test isolation, no mocked HTTP clients.
npx skills add jabrena/plinth --skill 132-java-testing-integration-testing -a claude-codeWhat 132-java-testing-integration-testing does
The skill covers integration tests for Java services that call outbound HTTP dependencies. The agent scans imports and detects the client stack: HttpClient, feign.*, retrofit2.*, RestTemplate. From there it builds an abstract BaseIntegrationTest, wires in WireMockExtension with @RegisterExtension and allocates a dynamic port via dynamicPort().
Service coordinates reach the tests through System.setProperty() inside @BeforeAll. Stub bodies live under wiremock/files/ and are referenced by bodyFileName. Stubs are registered inside each test method, so one test does not leak into the next. Call checks go through WIREMOCK.verify, and fault injection covers 503 responses plus latency with withFixedDelay. The wiremock-standalone dependency goes in test scope.
Before touching anything, the skill runs ./mvnw compile or mvn compile and stops dead if the build fails. That is a blocking condition, not a suggestion. After the changes it expects ./mvnw clean verify. It also hunts anti-patterns: global stubs in @BeforeAll, Mockito-mocked HTTP clients, hardcoded ports and URLs. If your project already does it that way, expect friction with the existing code. Worth a look at which side is right.
What it helps with
- build a base integration test class with WireMock
- detect the HTTP client from imports and stub it
- pass service coordinates into tests via system properties
- move response bodies into JSON mappings with
bodyFileName - drop mocked HTTP clients and global stubs from the suite
Example prompts for the agent
- Set up integration tests for this Java service with WireMock
- Review the integration tests and remove the mocked HTTP client
- Add per-test stub isolation and verify the HTTP interactions
How to install 132-java-testing-integration-testing
1Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 132-java-testing-integration-testing -a claude-code2Manually: put the files in place
~/.claude/skills/132-java-testing-integration-testing/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/132-java-testing-integration-testing/
1Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 132-java-testing-integration-testing -a codex2Manually: put the files in place
.agents/skills/132-java-testing-integration-testing/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 132-java-testing-integration-testing -a cursor2Manually: put the files in place
.cursor/skills/132-java-testing-integration-testing/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install jabrena/plinth 132-java-testing-integration-testing2Manually: put the files in place
.github/skills/132-java-testing-integration-testing/SKILL.md1Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 132-java-testing-integration-testing -a gemini-cli2Platform CLI
gemini skills install https://github.com/jabrena/plinth --path skills/132-java-testing-integration-testingManually: put the files in place
.devin/skills/132-java-testing-integration-testing/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 132-java-testing-integration-testing -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about 132-java-testing-integration-testing
How do I install 132-java-testing-integration-testing in Claude?
Run npx skills add jabrena/plinth --skill 132-java-testing-integration-testing -a claude-code. The skill lands in ~/.claude/skills/132-java-testing-integration-testing/SKILL.md.
What does 132-java-testing-integration-testing do?
It helps the agent set up, review or rewrite Java integration tests: a BaseIntegrationTest class, WireMock stubs, per-method isolation and HTTP call verification.
What has to happen before the tests are changed?
The project must compile first: ./mvnw compile or mvn compile. If that fails, the skill stops and applies nothing until the error is fixed.
Source text
SKILL.md · Apache-2.0
--- name: 132-java-testing-integration-testing description: Use when you need to set up, review, or improve Java integration tests — including generating a BaseIntegrationTest.java with WireMock for HTTP stubs, detecting HTTP client infrastructure from import signals, injecting service coordinates dynamically via System.setProperty(), creating WireMock JSON mapping files with bodyFileName, isolating stubs per test method, verifying HTTP interactions, or eliminating anti-patterns such as Mockito-mocked HTTP clients or globally registered WireMock stubs. This should trigger for requests such as Review Java code for integration tests; Apply best practices for integration tests in Java code; Write Java integration tests with real infrastructure boundaries; Improve Testcontainers integration tests for Java code; Review integration test setup and teardown in Java projects. Part of Plinth Toolkit license: Apache-2.0 metadata: author: Juan Antonio Breña Moral version: 0.19.0 --- # Java Integration testing guidelines Set up robust integration-test infrastructure for Java services using WireMock to stub outbound HTTP dependencies. **What is covered in this Skill?** - Infrastructure topology detection: scanning imports for `HttpClient`, `feign.*`, `retrofit2.*`, `RestTemplate` - Abstract `BaseIntegrationTest` base class - `WireMockExtension` with `@RegisterExtension`, dynamic port allocation (`dynamicPort()`) - `usingFilesUnderClasspath(wiremock)`, `@BeforeAll` + `System.setProperty()` for coordinate propagation - WireMock JSON mapping files (`bodyFileName` referencing `wiremock/files/`) - Programmatic stub registration via WireMock DSL - Per-test stub isolation: register stubs inside each test method - Fault injection: 503 service unavailable, network latency with `withFixedDelay` - Request verification via `WIREMOCK.verify` - `wiremock-standalone` Maven dependency (test scope) - Anti-patterns: global `@BeforeAll` stubs, Mockito-mocked HTTP clients, hardcoded ports or URLs **Scope:** The reference is organized by examples (good/bad code patterns) for each core area. Apply recommendations based on applicable examples. ## Constraints Before applying any integration test changes, ensure the project compiles. If compilation fails, stop immediately — do not proceed until resolved. After applying improvements, run full verification. - **MANDATORY**: Run `./mvnw compile` or `mvn compile` before applying any change - **SAFETY**: If compilation fails, stop immediately and do not proceed — compilation failure is a blocking condition - **VERIFY**: Run `./mvnw clean verify` or `mvn clean verify` after applying improvements - **BEFORE APPLYING**: Read the reference for detailed examples, good/bad patterns, and constraints ## When to use this skill - Review Java code for integration tests - Apply best practices for integration tests in Java code - Write Java integration tests with real infrastructure boundaries - Improve Testcontainers integration tests for Java code - Review integration test setup and teardown in Java projects ## Workflow 1. **Compile project before integration-test changes** Run `./mvnw compile` or `mvn compile` and stop immediately if compilation fails. 2. **Read integration-testing reference and detect topology** Read `references/132-java-testing-integration-testing.md` and detect HTTP client and external dependency integration points. 3. **Set up resilient integration-test infrastructure** Implement BaseIntegrationTest, WireMock mappings/stubs, per-test isolation, and verification patterns. 4. **Verify with full build** Run `./mvnw clean verify` or `mvn clean verify` after applying improvements. ## Reference For detailed guidance, examples, and constraints, see [references/132-java-testing-integration-testing.md](references/132-java-testing-integration-testing.md).
© Juan Antonio Breña Moral · Apache-2.0 · jabrena/plinth