
132 Java Testing Integration Testing
This is a solid foundation for Java integration testing that pushes you toward WireMock over Mockito for HTTP mocking. It scans your imports to detect HTTP clients (Feign, Retrofit, RestTemplate), then sets up a BaseIntegrationTest with dynamic port allocation and proper stub isolation per test method. The workflow is strict about compilation checks before making changes, which will save you from breaking things. What I like here is the explicit anti-pattern list: no global stubs, no hardcoded ports, no mocking HTTP clients with Mockito. It's opinionated in a good way. Use this when you're setting up or cleaning up integration test infrastructure and want WireMock best practices baked in from the start.
- skills.sh installs
- 128
- GitHub stars
- 393
- last updated
- Jun 3, 2026
Install
$ npx -y skills add jabrena/cursor-rules-java --skill 132-java-testing-integration-testing --agent claude-codeInstalls into .claude/skills of the current project.
Files
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
BaseIntegrationTestbase class WireMockExtensionwith@RegisterExtension, dynamic port allocation (dynamicPort())usingFilesUnderClasspath(wiremock),@BeforeAll+System.setProperty()for coordinate propagation- WireMock JSON mapping files (
bodyFileNamereferencingwiremock/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-standaloneMaven dependency (test scope)- Anti-patterns: global
@BeforeAllstubs, 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
Sponsors
Details
- Repository
- github.com/jabrena/cursor-rules-java
- Categories
- Testing & QA, Java & JVM
- First seen
- Jun 3, 2026
More from jabrena/cursor-rules-java
All 16- 113 Java Maven Documentation125
- 110 Java Maven Best Practices160
- 121 Java Object Oriented Design153
- 124 Java Secure Coding146
- 111 Java Maven Dependencies136
- 125 Java Concurrency135
- 128 Java Generics135
- 141 Java Refactoring With Modern Features135
- 142 Java Functional Programming135
- 131 Java Testing Unit Testing134
- 112 Java Maven Plugins133
- 143 Java Functional Exception Handling133
- 122 Java Type Design132
- 144 Java Data Oriented Programming129
- 170 Java Documentation129