/quality-skills:wiremockfrom quality-skills
Virtualizes HTTP services for testing — mocking downstream dependencies, simulating slow/error responses, recording-and-replay, or building a stub server for development.
Ships in quality-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are an expert in WireMock — a JVM-based HTTP service virtualization tool that can run embedded in tests or standalone. Your goal is to help engineers stand up reliable, deterministic stubs of HTTP dependencies so that tests for the system-under-test aren't blocked by flaky or unavailable downstream services. Don't fabricate WireMock matcher names, response transformers, or Java APIs. When uncertain, point the reader to wiremock.org or the GitHub docs.
Check .agents/qa-context.md (fallback: .claude/qa-context.md) before answering. Pay attention to:
If the file does not exist, ask: deployment mode (embedded / standalone / cloud), language of the system-under-test, stateful or stateless stubs, and how stubs will be versioned (in code vs JSON mapping files).
When not to use WireMock:
responses (Python) or nock (Node) is simpler.| Mode | When |
|---|---|
| Embedded in JVM test | Java/Kotlin/Groovy unit/integration tests. JUnit extension starts/stops it per class or method. |
| Standalone server | Polyglot teams — Docker container or jar. Configure via JSON mappings on disk. |
| WireMock Cloud | Hosted SaaS. Shared environment for cross-team integration. |
@WireMockTest(httpPort = 0) // 0 = random port
class BillingClientTest {
@Test
void chargesCard(WireMockRuntimeInfo wm) {
stubFor(post("/charge")
.withRequestBody(matchingJsonPath("$.amount", equalTo("1999")))
.willReturn(jsonResponse("{\"id\":\"ch_synthetic_123\",\"status\":\"succeeded\"}", 201)));
// ... invoke code that calls wm.getHttpBaseUrl() + "/charge"
verify(postRequestedFor(urlEqualTo("/charge")));
}
}
docker run --rm -p 8080:8080 \
-v $(pwd)/mappings:/home/wiremock/mappings \
wiremock/wiremock:<pinned-version>
Mappings folder contains JSON files like:
{
"request": {
"method": "GET",
"urlPath": "/users/user-42"
},
"response": {
"status": 200,
"headers": { "Content-Type": "application/json" },
"jsonBody": { "id": "user-42", "email": "[email protected]" }
}
}
Re-load mappings without restart via the /__admin/mappings/reset admin endpoint.
| Match on | Operators |
|---|---|
| URL path | urlEqualTo, urlPathEqualTo, urlMatching (regex), urlPathMatching. |
| Query string | withQueryParam("k", equalTo("v")). |
| Headers | withHeader("Authorization", matching("Bearer .*")). |
| Body | withRequestBody(equalToJson(...)), matchingJsonPath(...), equalToXml(...), matchingXPath(...), containing(...). |
| Multiple criteria | All criteria must match — they AND together. |
Specificity beats priority: most specific stub wins for a given request. Explicit .atPriority(N) lets you order overlapping stubs.
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody("{\"id\":\"user-42\"}")
.withFixedDelay(500) // simulate 500ms latency
);
Templating (response built from request values) requires the response-template extension:
{
"response": {
"transformers": ["response-template"],
"body": "{\"echo\": \"{{request.body}}\"}"
}
}
Faults (corrupted responses, dropped connections):
.willReturn(aResponse().withFault(Fault.CONNECTION_RESET_BY_PEER))
Use faults sparingly — they verify retry/error paths that unit tests can't easily.
For sequences (login first → then return token-protected resource):
stubFor(post("/auth/login")
.inScenario("happy login")
.whenScenarioStateIs(Scenario.STARTED)
.willReturn(jsonResponse("{\"token\":\"t_synthetic\"}", 200))
.willSetStateTo("logged_in"));
stubFor(get("/me")
.inScenario("happy login")
.whenScenarioStateIs("logged_in")
.withHeader("Authorization", equalTo("Bearer t_synthetic"))
.willReturn(jsonResponse("{\"id\":\"user-42\"}", 200)));
Reset scenarios between tests via WireMock.resetScenarios() (embedded) or the /__admin/scenarios/reset admin endpoint.
verify(postRequestedFor(urlEqualTo("/charge"))
.withRequestBody(matchingJsonPath("$.amount", equalTo("1999"))));
// Count assertions
verify(exactly(1), postRequestedFor(urlEqualTo("/charge")));
verify(moreThan(0), getRequestedFor(urlPathMatching("/users/.*")));
Use verification to assert that the code under test actually called the dependency in the expected way — that's the "interaction" part of integration testing.
WireMock can proxy requests to a real upstream and record the interactions:
curl -X POST http://localhost:8080/__admin/recordings/start \
-d '{"targetBaseUrl": "https://real-upstream.example.com"}'
# ... drive the system under test against localhost:8080
curl -X POST http://localhost:8080/__admin/recordings/stop
# Resulting mappings end up in mappings/ on disk
Useful for bootstrapping stubs against an unstable upstream — but always review the recordings. They capture every header (including secrets) and every dynamic field. Recorded mappings tend to be too strict; loosen them deliberately.
WireMock exposes admin endpoints under /__admin/:
| Endpoint | Use |
|---|---|
GET /__admin/mappings | List all stubs. |
POST /__admin/mappings/reset | Reload from disk (standalone). |
POST /__admin/requests/reset | Clear request history. |
GET /__admin/requests | Get observed requests. |
POST /__admin/scenarios/reset | Reset scenarios. |
Use these in non-JVM tests that need to interact with a standalone instance.
:latest Docker image — pin a version. WireMock changes API surface across versions.@BeforeEach.equalToJson strict mode for partial matches — by default equalToJson ignores extra fields if you pass the right flags; understand strict vs lenient.withFixedDelay(5000) is great for testing timeouts; deadly when sprinkled liberally across a suite.When helping with WireMock, ask:
responses (Python) or nock (Node) is simpler than running WireMock standalone, but standalone WireMock is still valid for shared environments.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub aks-builds/quality-skills --plugin quality-skillsOther plugins' skills for the same job
56 skills in this plugin
/accessibility-testingWhen the user wants to design, implement, or operate accessibility (a11y) testing — automated scans, manual audits, screen-reader testing, WCAG conformance, Section 508 / EAA compliance. Use when the user mentions "accessibility," "a11y," "WCAG," "Section 508," "EAA," "ADA compliance," "axe," "axe-core," "pa11y," "Lighthouse," "aXe DevTools," "screen reader," "NVDA," "JAWS," "VoiceOver," "TalkBack," "WAVE," or "AT testing." For visual diff see visual-regression. For overall test strategy see test-strategy./ai-augmented-testingWhen the user wants to evaluate, adopt, or operate AI-augmented testing tools and approaches — autonomous test generation, self-healing locators, AI-assisted authoring, vision-based testing, agentic test runners. Use when the user mentions "AI testing," "AI-augmented testing," "Testim," "Mabl," "Functionize," "Reflect," "TestRigor," "Tricentis Copilot," "Cypress AI," "Playwright codegen with AI," "AI test generation," "self-healing tests," or "vision-based test automation." For LLM-product evals see llm-eval-testing. For overall strategy see test-strategy./appiumWhen the user wants to design, implement, debug, or scale Appium tests for iOS and Android mobile automation. Use when the user mentions "Appium," "Appium 2," "UiAutomator2," "XCUITest driver," "appium:capabilities," "AppiumServer," "accessibility id," "TouchAction," "W3C Actions," "Appium inspector," "real device cloud," or "App Center / BrowserStack / Sauce mobile." For Android-native frameworks see espresso. For iOS-native see xcuitest. For React Native specifically see detox. For YAML-driven mobile flows see maestro. For desktop web automation see selenium / playwright / webdriverio.