Agent skill

Wiremock

by aehrc in aehrc/pathling

Expert guidance for using WireMock in Java applications for HTTP API mocking and testing.

Apache-2.0Auto-check passedBackend & APIs

Install Wiremock

skills CLI
$ npx skills add aehrc/pathling --skill wiremock -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install aehrc/pathling wiremock --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/aehrc/pathling.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/wiremock .claude/skills/wiremock && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
wiremock
GitHub stars
137
Token cost
~5.7k tokens
SKILL.md length
738 words
Files
1
Skills in repo
25
Repo updated
First seen
Licence
Apache-2.0

At a glance

Expert guidance for using WireMock in Java applications for HTTP API mocking and testing.

  • Works in 2 steps: JSON files in the mappings directory… → Programmatic APIs using the Java SDK…
  • The user asks to mock HTTP APIs
  • SKILL.md covers Core concepts, Stubbing basics, JSON mapping files and Request matching, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Wiremock is an agent skill from aehrc/pathling. Expert guidance for using WireMock in Java applications for HTTP API mocking and testing. Use this skill when the user asks to mock HTTP APIs, create API stubs, test REST clients, simulate network faults, verify HTTP requests, or integrate WireMock with Spring Boot. Trigger keywords include "wiremock", "mock http", "stub api", "http mock", "api testing", "rest mock", "simulate fault", "verify request", "spring boot wiremock".

Its SKILL.md is about 5.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering REST APIs, Backend development and Third-party API integration. It works with Java and Spring Boot. The repository describes itself as: Tools that make it easier to use FHIR and clinical terminology within data analytics, built on Apache Spark. The licence is Apache-2.0.

When your agent uses it

  • The user asks to mock HTTP APIs
  • Create API stubs
  • Test REST clients
  • Simulate network faults

Example prompts

  • “wiremock”
  • “mock http”
  • “stub api”
  • “/wiremock”

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. JSON files in the mappings directory (for test resources)
  2. Programmatic APIs using the Java SDK (for dynamic test setup)

What it can do on your machine

Read from SKILL.md and the folder at commit 56a3b4a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are java, json, xml and gradle).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Wiremock loads about 5.7k tokens when it runs. Until then it costs about 110 tokens; SKILL.md has 738 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~110
When it runs · the whole SKILL.md, loaded when a task matches
~5.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from aehrc/pathling at commit 56a3b4a, republished under its Apache-2.0 licence (© aehrc). 738 words, ~5,709 tokens.

Download SKILL.mdSave it as .claude/skills/wiremock/SKILL.md (or your agent's skills folder).
name
wiremock
description
Expert guidance for using WireMock in Java applications for HTTP API mocking and testing. Use this skill when the user asks to mock HTTP APIs, create API stubs, test REST clients, simulate network faults, verify HTTP requests, or integrate WireMock with Spring Boot. Trigger keywords include "wiremock", "mock http", "stub api", "http mock", "api testing", "rest mock", "simulate fault", "verify request", "spring boot wiremock".

You are an expert in using WireMock for HTTP API mocking in Java applications. You follow best practices for creating reliable, maintainable test mocks.

Core concepts

WireMock enables you to stub HTTP responses for requests matching specific criteria. This allows testing of HTTP clients without depending on external services.

Preferred configuration methods

The preferred approaches for configuring stubs are:

  1. JSON files in the mappings directory (for test resources)
  2. Programmatic APIs using the Java SDK (for dynamic test setup)

These methods work well with ephemeral WireMock instances in test contexts, avoiding the need for persistent WireMock servers.

Stubbing basics

Basic stub structure

Every stub requires:

  • Request matcher: URL, method, headers, body patterns
  • Response definition: Status code, headers, body content
java
import static com.github.tomakehurst.wiremock.client.WireMock.*;

stubFor(get(urlEqualTo("/api/users"))
    .willReturn(aResponse()
        .withStatus(200)
        .withHeader("Content-Type", "application/json")
        .withBody("{\"users\": []}")));
Java DSL shortcuts

WireMock provides convenient methods for common patterns:

java
stubFor(get("/ping").willReturn(ok()));
stubFor(get("/users").willReturn(okJson("{\"users\": []}")));
stubFor(post("/redirect").willReturn(temporaryRedirect("/new/location")));
stubFor(get("/error").willReturn(serverError()));
stubFor(get("/not-found").willReturn(notFound()));
stubFor(get("/unauthorized").willReturn(unauthorized()));
Response body options

String literal:

java
.withBody("Hello, world!")

JSON object:

java
.withBody("{\"message\": \"Hello\"}")
// Or use the convenience method:
.willReturn(okJson("{\"message\": \"Hello\"}"))

File reference:

java
.withBodyFile("response.json")  // Relative to __files directory

Binary data:

java
.withBody(binaryData)  // Base64-encoded in JSON
Stub priority

When multiple stubs match a request, priority determines which responds. Lower numbers equal higher priority (1 is highest; default is 5).

java
stubFor(get(urlEqualTo("/api/users/123"))
    .atPriority(1)
    .willReturn(aResponse().withStatus(200).withBody("Specific user")));

stubFor(get(urlMatching("/api/users/.*"))
    .atPriority(5)
    .willReturn(aResponse().withStatus(200).withBody("Any user")));

JSON mapping files

JSON mapping files provide a declarative way to define stubs that can be version-controlled and reused across tests.

Directory structure

Place mapping files in the test resources directory:

src/test/resources/
├── mappings/
│   ├── get-users.json
│   ├── create-user.json
│   └── error-scenarios.json
└── __files/
    ├── users-response.json
    └── user-created-response.json
Basic mapping file structure
json
{
    "request": {
        "method": "GET",
        "urlPath": "/api/users"
    },
    "response": {
        "status": 200,
        "headers": {
            "Content-Type": "application/json"
        },
        "body": "{\"users\": []}"
    }
}
Using external body files

For larger responses, reference files from the __files directory:

json
{
    "request": {
        "method": "GET",
        "urlPath": "/api/users"
    },
    "response": {
        "status": 200,
        "headers": {
            "Content-Type": "application/json"
        },
        "bodyFileName": "users-response.json"
    }
}
Request matching in JSON

URL path with query parameters:

json
{
    "request": {
        "method": "GET",
        "urlPath": "/api/search",
        "queryParameters": {
            "q": {
                "equalTo": "test"
            },
            "page": {
                "matches": "[0-9]+"
            }
        }
    },
    "response": {
        "status": 200
    }
}

Header matching:

json
{
    "request": {
        "method": "POST",
        "urlPath": "/api/users",
        "headers": {
            "Content-Type": {
                "equalTo": "application/json"
            },
            "Authorization": {
                "matches": "Bearer .*"
            }
        }
    },
    "response": {
        "status": 201
    }
}

Request body matching:

json
{
    "request": {
        "method": "POST",
        "urlPath": "/api/users",
        "bodyPatterns": [
            {
                "matchesJsonPath": "$.name"
            },
            {
                "matchesJsonPath": "$.email",
                "equalTo": "user@example.com"
            }
        ]
    },
    "response": {
        "status": 201
    }
}
Priority in JSON mappings
json
{
    "priority": 1,
    "request": {
        "method": "GET",
        "urlPath": "/api/users/123"
    },
    "response": {
        "status": 200,
        "body": "Specific user"
    }
}
Loading mappings in tests

Spring Boot integration:

java
@EnableWireMock({
    @ConfigureWireMock(
        name = "api-service",
        filesUnderClasspath = "wiremock"
    )
})

This loads mappings from src/test/resources/wiremock/mappings/.

Programmatic loading:

java
WireMockServer wireMockServer = new WireMockServer(
    options()
        .usingFilesUnderClasspath("wiremock")
        .port(8080)
);
wireMockServer.start();
Combining JSON and programmatic stubs

JSON mappings provide baseline stubs, while programmatic stubs handle test-specific scenarios:

java
@Test
void testSpecificScenario() {
    // JSON mappings already loaded from src/test/resources/mappings/

    // Override or add test-specific stub
    stubFor(get("/api/users/999")
        .willReturn(notFound()));

    // Run test
    assertThrows(UserNotFoundException.class, () -> {
        apiClient.getUser(999);
    });
}

Request matching

URL matching strategies

Exact URL match (including query parameters):

java
stubFor(get(urlEqualTo("/api/users?page=1"))
    .willReturn(ok()));

URL regex:

java
stubFor(get(urlMatching("/api/users/[0-9]+"))
    .willReturn(ok()));

Path-only equality (preferred for query parameters):

java
stubFor(get(urlPathEqualTo("/api/users"))
    .willReturn(ok()));

Path-only regex:

java
stubFor(get(urlPathMatching("/api/users/.*"))
    .willReturn(ok()));

Path templates (RFC 6570 compliant):

java
stubFor(get(urlPathTemplate("/contacts/{contactId}/addresses/{addressId}"))
    .willReturn(ok()));
Query parameter matching
java
stubFor(get(urlPathEqualTo("/api/users"))
    .withQueryParam("page", equalTo("1"))
    .withQueryParam("size", matching("[0-9]+"))
    .willReturn(ok()));
Header matching
java
stubFor(get(urlEqualTo("/api/users"))
    .withHeader("Accept", equalTo("application/json"))
    .withHeader("Authorization", matching("Bearer .*"))
    .willReturn(ok()));
Header absence
java
stubFor(get(urlEqualTo("/api/users"))
    .withHeader("X-Custom-Header", absent())
    .willReturn(ok()));
Request body matching

Exact match:

java
stubFor(post(urlEqualTo("/api/users"))
    .withRequestBody(equalTo("{\"name\": \"John\"}"))
    .willReturn(created()));

Contains:

java
stubFor(post(urlEqualTo("/api/users"))
    .withRequestBody(containing("John"))
    .willReturn(created()));

Regex:

java
stubFor(post(urlEqualTo("/api/users"))
    .withRequestBody(matching(".*\"name\"\\s*:\\s*\"[A-Z][a-z]+\".*"))
    .willReturn(created()));

JSON equality:

java
stubFor(post(urlEqualTo("/api/users"))
    .withRequestBody(equalToJson("{\"name\": \"John\", \"age\": 30}", true, true))
    .willReturn(created()));

JSON path matching:

java
stubFor(post(urlEqualTo("/api/users"))
    .withRequestBody(matchingJsonPath("$.name"))
    .withRequestBody(matchingJsonPath("$.age", equalTo("30")))
    .willReturn(created()));

JSON schema validation:

java
stubFor(post(urlEqualTo("/api/users"))
    .withRequestBody(matchingJsonSchema(schemaJson))
    .willReturn(created()));

XML equality:

java
stubFor(post(urlEqualTo("/api/users"))
    .withRequestBody(equalToXml("<user><name>John</name></user>"))
    .willReturn(created()));

XPath matching:

java
stubFor(post(urlEqualTo("/api/users"))
    .withRequestBody(matchingXPath("//name[text()='John']"))
    .willReturn(created()));
Basic authentication
java
stubFor(get(urlEqualTo("/api/protected"))
    .withBasicAuth("username", "password")
    .willReturn(ok()));
java
stubFor(get(urlEqualTo("/api/users"))
    .withCookie("session", matching("[A-Z0-9]+"))
    .willReturn(ok()));
Logical operators

AND combination:

java
stubFor(post(urlEqualTo("/api/users"))
    .withRequestBody(matching("[a-z]+").and(containing("magic")))
    .willReturn(ok()));

OR combination:

java
stubFor(get(urlEqualTo("/api/users"))
    .withHeader("Accept", matching("application/json").or(matching("application/xml")))
    .willReturn(ok()));

NOT negation:

java
stubFor(get(urlEqualTo("/api/users"))
    .withHeader("X-Internal", not(matching("true")))
    .willReturn(ok()));

Simulating faults

Fixed delays

Add delays to individual stubs:

java
stubFor(get(urlEqualTo("/api/slow"))
    .willReturn(aResponse()
        .withStatus(200)
        .withFixedDelay(2000)));  // 2 second delay
Random delays

Lognormal distribution (realistic long-tail latencies):

java
stubFor(get(urlEqualTo("/api/variable"))
    .willReturn(aResponse()
        .withStatus(200)
        .withLogNormalRandomDelay(90, 0.1)));  // Median 90ms, sigma 0.1

Uniform distribution (stable latency with jitter):

java
stubFor(get(urlEqualTo("/api/jitter"))
    .willReturn(aResponse()
        .withStatus(200)
        .withUniformRandomDelay(15, 25)));  // Between 15-25ms
Chunked dribble delays

Simulate slow network connections by fragmenting responses:

java
stubFor(get(urlEqualTo("/api/slow-download"))
    .willReturn(aResponse()
        .withBody("Large response body...")
        .withChunkedDribbleDelay(5, 1000)));  // 5 chunks over 1000ms
Fault injection

Simulate corrupted or failed responses:

java
import static com.github.tomakehurst.wiremock.http.Fault.*;

stubFor(get(urlEqualTo("/api/fault"))
    .willReturn(aResponse().withFault(MALFORMED_RESPONSE_CHUNK)));

Available fault types:

  • EMPTY_RESPONSE: No response data
  • MALFORMED_RESPONSE_CHUNK: Valid status, then corrupted data
  • RANDOM_DATA_THEN_CLOSE: Garbage followed by connection closure
  • CONNECTION_RESET_BY_PEER: Immediate disconnection

Request verification

Basic verification

Verify a request was made:

java
import static com.github.tomakehurst.wiremock.client.WireMock.*;

verify(getRequestedFor(urlEqualTo("/api/users")));
verify(postRequestedFor(urlEqualTo("/api/users"))
    .withHeader("Content-Type", equalTo("application/json")));
Count verification

Verify exact request counts:

java
verify(exactly(3), postRequestedFor(urlEqualTo("/api/users")));
verify(lessThan(5), getRequestedFor(urlMatching("/api/.*")));
verify(moreThanOrExactly(1), deleteRequestedFor(urlEqualTo("/api/users/123")));

Available count operators:

  • exactly(n)
  • lessThan(n)
  • lessThanOrExactly(n)
  • moreThan(n)
  • moreThanOrExactly(n)
Retrieving all requests
java
List<ServeEvent> allEvents = getAllServeEvents();
List<LoggedRequest> allRequests = findAll(anyRequestedFor(anyUrl()));
Filtering requests
java
List<LoggedRequest> userRequests = findAll(
    putRequestedFor(urlMatching("/api/users/.*")));
Finding unmatched requests
java
List<LoggedRequest> unmatchedRequests = findUnmatchedRequests();
Near misses

Identify stub mappings that almost matched (useful for debugging):

java
List<NearMiss> nearMisses = findNearMissesForAllUnmatchedRequests();
Resetting request journal
java
resetAllRequests();  // Clear request log only
reset();  // Clear both stubs and request log

Spring Boot integration

Setup

Add the dependency:

Maven:

xml
<dependency>
    <groupId>org.wiremock.integrations</groupId>
    <artifactId>wiremock-spring-boot</artifactId>
    <version>3.10.0</version>
    <scope>test</scope>
</dependency>

Gradle:

gradle
testImplementation 'org.wiremock.integrations:wiremock-spring-boot:3.10.0'
Basic usage
java
import org.springframework.boot.test.context.SpringBootTest;
import org.wiremock.spring.EnableWireMock;
import org.wiremock.spring.ConfigureWireMock;
import org.springframework.beans.factory.annotation.Value;
import static com.github.tomakehurst.wiremock.client.WireMock.*;

@SpringBootTest
@EnableWireMock
class ApiClientTest {

    @Value("${wiremock.server.baseUrl}")
    private String wireMockUrl;

    @Test
    void testApiClient() {
        stubFor(get("/api/users")
            .willReturn(okJson("[{\"id\": 1, \"name\": \"John\"}]")));

        // Test your API client
        List<User> users = apiClient.getUsers();

        assertThat(users).hasSize(1);
        verify(getRequestedFor(urlEqualTo("/api/users")));
    }
}
Show full SKILL.md (297 more words)Show less
Injected properties

The integration automatically provides:

  • wiremock.server.baseUrl — Server base URL
  • wiremock.server.port — HTTP port number
Declarative configuration
java
@SpringBootTest
@EnableWireMock({
    @ConfigureWireMock(
        name = "user-service",
        port = 8888,
        baseUrlProperties = "user-service.url"
    )
})
class ApiClientTest {
    @Value("${user-service.url}")
    private String userServiceUrl;
}

Configuration options:

  • port — HTTP port (default: random)
  • httpsPort — HTTPS port (default: random)
  • name — Instance identifier (default: "wiremock")
  • baseUrlProperties — Custom property name for base URL
  • portProperties — Custom property name for port
  • filesUnderClasspath — Classpath resource root for mappings
  • filesUnderDirectory — Directory root for mappings
Injecting WireMock instances
java
import org.wiremock.spring.InjectWireMock;
import com.github.tomakehurst.wiremock.WireMockServer;

@SpringBootTest
@EnableWireMock
class ApiClientTest {

    @InjectWireMock
    private WireMockServer wireMock;

    @Test
    void testWithDirectAccess() {
        wireMock.stubFor(get("/api/users").willReturn(ok()));
        // Test code
    }
}
Multiple WireMock instances
java
@SpringBootTest
@EnableWireMock({
    @ConfigureWireMock(
        name = "user-service",
        baseUrlProperties = "user-service.url"
    ),
    @ConfigureWireMock(
        name = "order-service",
        baseUrlProperties = "order-service.url"
    )
})
class MultiServiceTest {

    @InjectWireMock("user-service")
    private WireMockServer userService;

    @InjectWireMock("order-service")
    private WireMockServer orderService;

    @Test
    void testMultipleServices() {
        userService.stubFor(get("/users/1").willReturn(okJson("{\"id\": 1}")));
        orderService.stubFor(get("/orders").willReturn(okJson("[]")));

        // Test code that calls both services
    }
}
Programmatic configuration

For advanced control, implement WireMockConfigurationCustomizer:

java
import org.wiremock.spring.WireMockConfigurationCustomizer;
import com.github.tomakehurst.wiremock.core.WireMockConfiguration;

@SpringBootTest
@EnableWireMock({
    @ConfigureWireMock(
        configurationCustomizers = CustomizerTest.Customizer.class
    )
})
class CustomizerTest {

    static class Customizer implements WireMockConfigurationCustomizer {
        @Override
        public void customize(
            WireMockConfiguration configuration,
            ConfigureWireMock options
        ) {
            configuration
                .notifier(new CustomNotifier())
                .extensions(new CustomTransformer());
        }
    }
}

Stub management

Listing stubs
java
List<StubMapping> allStubs = WireMock.listAllStubMappings().getMappings();
Editing stubs
java
StubMapping stub = stubFor(get("/api/users").willReturn(ok()));
stub.setResponse(aResponse().withStatus(404));
editStub(stub);
Removing stubs
java
// Remove by ID
removeStub(stubId);

// Remove by metadata
removeStubsByMetadata(matchingJsonPath("$.tag", equalTo("temporary")));

// Remove all
WireMock.resetMappings();
Finding unused stubs
java
List<StubMapping> unusedStubs = findUnmatchedStubs();

Best practices

Use path-only matching for query parameters

Prefer urlPathEqualTo() over urlEqualTo() when matching query parameters separately to achieve order-invariant matching:

java
// Good: Order-independent query parameter matching
stubFor(get(urlPathEqualTo("/api/search"))
    .withQueryParam("q", equalTo("test"))
    .withQueryParam("page", equalTo("1"))
    .willReturn(ok()));

// Avoid: Query parameter order matters
stubFor(get(urlEqualTo("/api/search?q=test&page=1"))
    .willReturn(ok()));
Use appropriate matchers

Choose the most specific matcher for your use case:

  • Use equalTo() for exact matches
  • Use matching() for regex patterns
  • Use containing() for substring checks
  • Use matchingJsonPath() for JSON field matching
  • Use matchingJsonSchema() for structural validation
Organise stubs by priority

Use priority to create layered stub configurations:

  • High priority (1-2): Specific test cases
  • Medium priority (3-5): General cases
  • Low priority (6+): Catch-all fallbacks
Reset between tests

Always reset WireMock state between tests:

java
@BeforeEach
void setUp() {
    WireMock.reset();  // Clears both stubs and request log
}

Or reset selectively:

java
@BeforeEach
void setUp() {
    WireMock.resetAllRequests();  // Keep stubs, clear request log
}
Use realistic delays

When simulating latency, use lognormal distribution for realistic long-tail behaviour:

java
stubFor(get("/api/users")
    .willReturn(aResponse()
        .withStatus(200)
        .withLogNormalRandomDelay(100, 0.1)));
Verify important interactions

Always verify that critical requests were made:

java
@Test
void shouldCreateUser() {
    // Stub the response
    stubFor(post("/api/users").willReturn(created()));

    // Execute test
    apiClient.createUser(new User("John"));

    // Verify the request
    verify(postRequestedFor(urlEqualTo("/api/users"))
        .withRequestBody(matchingJsonPath("$.name", equalTo("John"))));
}
Use meaningful stub names

When using multiple WireMock instances in Spring Boot, use descriptive names:

java
@EnableWireMock({
    @ConfigureWireMock(name = "user-service"),
    @ConfigureWireMock(name = "payment-gateway"),
    @ConfigureWireMock(name = "notification-service")
})
Prefer JSON mappings for reusable stubs

Use JSON mapping files for stubs that are reused across multiple tests:

src/test/resources/mappings/
├── common-success-responses.json
├── common-error-responses.json
└── service-specific/
    ├── user-service-stubs.json
    └── order-service-stubs.json

Reference external files for large response bodies:

json
{
    "request": {
        "method": "GET",
        "urlPath": "/api/users"
    },
    "response": {
        "status": 200,
        "headers": {
            "Content-Type": "application/json"
        },
        "bodyFileName": "users-response.json"
    }
}
Use programmatic stubs for test-specific scenarios

Reserve programmatic stub creation for test-specific cases that require dynamic behaviour:

java
@Test
void shouldHandleSpecificEdgeCase() {
    // JSON mappings provide baseline stubs

    // Add test-specific stub programmatically
    stubFor(get("/api/users/edge-case")
        .willReturn(aResponse()
            .withStatus(200)
            .withBody(generateDynamicResponse())));

    // Test code
}
Test error scenarios

Always test how your code handles failures:

java
@Test
void shouldHandleServerError() {
    stubFor(get("/api/users").willReturn(serverError()));

    assertThrows(ServiceException.class, () -> {
        apiClient.getUsers();
    });
}

@Test
void shouldHandleTimeout() {
    stubFor(get("/api/users")
        .willReturn(aResponse()
            .withStatus(200)
            .withFixedDelay(5000)));  // Longer than client timeout

    assertThrows(TimeoutException.class, () -> {
        apiClient.getUsers();
    });
}

Common patterns

Stateful behaviour

Simulate stateful interactions using scenarios:

java
stubFor(post("/api/orders")
    .inScenario("Order Flow")
    .whenScenarioStateIs(STARTED)
    .willReturn(created())
    .willSetStateTo("Order Created"));

stubFor(get("/api/orders/123")
    .inScenario("Order Flow")
    .whenScenarioStateIs("Order Created")
    .willReturn(okJson("{\"id\": 123, \"status\": \"PENDING\"}")));
Response templating

Use response templates for dynamic responses (requires extension):

java
stubFor(get(urlPathMatching("/api/users/([0-9]+)"))
    .willReturn(aResponse()
        .withBody("{\"id\": {{request.pathSegments.[2]}}, \"name\": \"User\"}")
        .withTransformers("response-template")));
Conditional responses based on request content
java
stubFor(post("/api/users")
    .withRequestBody(matchingJsonPath("$.role", equalTo("admin")))
    .willReturn(aResponse()
        .withStatus(201)
        .withBody("{\"role\": \"admin\"}")));

stubFor(post("/api/users")
    .withRequestBody(matchingJsonPath("$.role", equalTo("user")))
    .willReturn(aResponse()
        .withStatus(201)
        .withBody("{\"role\": \"user\"}")));
Simulating rate limiting
java
stubFor(get("/api/data")
    .inScenario("Rate Limit")
    .whenScenarioStateIs(STARTED)
    .willReturn(ok())
    .willSetStateTo("Request 1"));

stubFor(get("/api/data")
    .inScenario("Rate Limit")
    .whenScenarioStateIs("Request 1")
    .willReturn(ok())
    .willSetStateTo("Request 2"));

stubFor(get("/api/data")
    .inScenario("Rate Limit")
    .whenScenarioStateIs("Request 2")
    .willReturn(aResponse()
        .withStatus(429)
        .withHeader("Retry-After", "60")));

© aehrc, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/wiremock of aehrc/pathling.

Open the folder on GitHubat commit 56a3b4a

Compare with similar skills

Wiremock next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Wiremock compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Wiremock this skillaehrc/pathling137—~5.7kAutomated safety check: PassApache-2.0
Dr Jskilljdubois/dr-jskill342—~4.6kAutomated safety check: NotesApache-2.0
WxJava Integration Guidebinarywang/WxJava33k—~123Automated safety check: PassApache-2.0
Progensivaprasadreddy/sivalabs-agent-skills187—~2.7kAutomated safety check: NotesMIT
Spring Boot Crud Patternsgiuseppe-trisciuoglio/developer-kit355—~2.5kAutomated safety check: NotesMIT
Springboot Patternsaffaan-m/ECC274k5 repos~2.5kAutomated safety check: PassMIT

Similar skills

  • Dr Jskill

    jdubois/dr-jskill

    Creates Java + Spring Boot projects: Web applications, full-stack apps with Vue.js or Angular or React or vanilla JS, PostgreSQL, REST APIs, and Docker.

    342 GitHub stars~4.6k tokensUpdated 8 days ago
    Backend & APIsAuto-check: notes
  • WxJava Integration Guide

    binarywang/WxJava

    Plans a WxJava setup for Java, Spring Boot or Solon projects that call WeChat services, from module and BOM choice to config and a minimal working call.

    33k GitHub stars~123 tokensUpdated 11 days ago
    Backend & APIsAuto-check passed
  • Progen

    sivaprasadreddy/sivalabs-agent-skills

    A skill your agent uses when the user wants to create/generate/scaffold a new Spring Boot project (Maven or Gradle, REST API / Web App / Spring Boot + Angular full stack).

    187 GitHub stars~2.7k tokensUpdated 2 days ago
    Backend & APIsAuto-check: notes
  • Spring Boot Crud Patterns

    giuseppe-trisciuoglio/developer-kit

    Provides and generates complete CRUD workflows for Spring Boot 3 services.

    355 GitHub stars~2.5k tokensUpdated 27 days ago
    Backend & APIsAuto-check: notes
  • Spring Boot architecture patterns, REST API design, layered services, data access, caching, async processing, and logging.

    274k GitHub starsUsed in 5 repos~2.5k tokens
    Backend & APIsAuto-check passed
  • Spring Boot Engineer

    Jeffallan/claude-skills

    Builds Spring Boot 3.x services with REST controllers, Spring Data JPA, Spring Security 6, WebFlux and Spring Cloud, verified by tests and Actuator health checks.

    12k GitHub stars~1.9k tokensUpdated 4 days ago
    Backend & APIsAuto-check passed

More from aehrc/pathling

All 25 skills in this repo
  • Fhir API

    aehrc/pathling

    Expert guidance for implementing FHIR RESTful API servers and clients following the HL7 FHIR specification.

    137 GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check passed
  • Fhir Bulk Data

    aehrc/pathling

    Expert guidance for implementing FHIR Bulk Data Access (Flat FHIR) following the HL7 specification.

    137 GitHub starsUsed in 1 repo~1.8k tokens
    Auto-check passed
  • Databricks CLI

    aehrc/pathling

    Expert guidance for using the Databricks CLI to manage Databricks workspaces, clusters, jobs, pipelines, Unity Catalog, SQL warehouses, serving endpoints, secrets, bundles, and all other Databricks…

    137 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Fhir Search Spec

    aehrc/pathling

    FHIR RESTful search specification expert with access to the official HL7 search specification text and the formal SearchParameter registry.

    137 GitHub stars~649 tokensUpdated today
    Auto-check passed
  • Design and generate comprehensive FHIRPath test suites using input domain partitioning and Pathling's DSL test framework.

    137 GitHub stars~3.6k tokensUpdated today
    Auto-check passed
  • Hapi Fhir Server

    aehrc/pathling

    Expert guidance for implementing FHIR servers using HAPI FHIR Plain Server framework.

    137 GitHub stars~2.6k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Wiremock

What does Wiremock do?

Expert guidance for using WireMock in Java applications for HTTP API mocking and testing. Wiremock is an agent skill from aehrc/pathling. Expert guidance for using WireMock in Java applications for HTTP API mocking and testing.

When should I use Wiremock?

Wiremock fits situations like: the user asks to mock HTTP APIs; create API stubs; test REST clients; simulate network faults.

How do I install Wiremock in Claude Code?

Run `npx skills add aehrc/pathling --skill wiremock -a claude-code`. Or copy the skill folder (.claude/skills/wiremock in aehrc/pathling) into .claude/skills/wiremock in your project. Claude Code loads it when a task matches its description.

How do I install Wiremock in Codex?

Run `npx skills add aehrc/pathling --skill wiremock -a codex`. Or copy the skill folder (.claude/skills/wiremock in aehrc/pathling) into .agents/skills/wiremock in your project. Codex loads it when a task matches its description.

Can I use Wiremock in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add aehrc/pathling --skill wiremock -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/wiremock, .gemini/skills/wiremock, .github/skills/wiremock and .opencode/skills/wiremock in your project.

What does Wiremock need to run?

SKILL.md names no scripts, command-line tools or credentials: Wiremock is instructions for the agent only.

Does Wiremock access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Wiremock safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Wiremock use?

Wiremock is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Wiremock use?

About 5.7k tokens (SKILL.md is roughly 23k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Wiremock?

Skills that share tags, products or a category with Wiremock: Dr Jskill (jdubois/dr-jskill, 342 stars), WxJava Integration Guide (binarywang/WxJava, 33k stars), Progen (sivaprasadreddy/sivalabs-agent-skills, 187 stars) and Spring Boot Crud Patterns (giuseppe-trisciuoglio/developer-kit, 355 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Wiremock?

aehrc (a GitHub organization) maintains it in aehrc/pathling, which has 137 GitHub stars. The repository holds 25 skills in this directory. The repository was last updated on October 7, 2026.

Source: aehrc/pathling on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.