stuntman / providers / wiremock import

WireMock import

Turn the WireMock mappings you already keep into plugins: paths, matchers, answers, delays, scenarios, templates and webhooks.

Stands in for

  • WireMock mappings (mappings/*.json and __files/)
  • WireMock response templates
  • WireMock scenarios
  • WireMock webhooks (postServeActions)
  • Folders of WSDL files

Everything WireMock import gives you

  1. 01

    Look before importing

    dry=true lists, per service, the mappings read, routes and answers it would make, faults, scenarios and gaps.

  2. 02

    Group into services

    One service per subfolder of mappings/ (default), per request host, or everything in one.

  3. 03

    Matchers become rules

    equalTo, contains, matches, absent, equalToJson, matchesJsonPath, matchesXPath, Basic auth and cookies, in priority order.

  4. 04

    Regex paths kept

    urlPattern and urlPathPattern become regex routes; named groups are path parameters.

  5. 05

    Templates keep working

    Handlebars answers with now, randomValue, jsonPath, xPath, regexExtract and math; now follows the environment's clock.

  6. 06

    Scenarios as a switch

    Mappings with a scenario state become rules on scenario; set_scenario moves a service by hand.

  7. 07

    Webhooks after answers

    A webhook serve action becomes a send that fires only after that mapping's answer, with its delay.

  8. 08

    Gaps reported

    Nothing is dropped quietly: matchers and fields it cannot convert are listed file by file.

The screens

Each number is a control or a reading on the real screen. Everything you can click there, your agent can do with a tool.

Import a WireMock folder

Import a WireMock folder: the WireMock import screen in Stuntman
1The folder

mappings/ and __files/ on the machine that runs Stuntman; a folder of WSDLs works too.

1 of 5
2How to group

One service per folder, per host, or everything in one.

2 of 5
3Look first

A dry run: what it would make, with nothing created yet.

3 of 5
4Per service

Routes, faults and scenarios each service gets.

4 of 5
5Gaps

Matchers with no equivalent, to write by hand before you trust the service.

5 of 5
  1. The folder

    mappings/ and __files/ on the machine that runs Stuntman; a folder of WSDLs works too.

  2. How to group

    One service per folder, per host, or everything in one.

  3. Look first

    A dry run: what it would make, with nothing created yet.

  4. Per service

    Routes, faults and scenarios each service gets.

  5. Gaps

    Matchers with no equivalent, to write by hand before you trust the service.

An imported mapping is a normal route

An imported mapping is a normal route: the WireMock import screen in Stuntman
1Request patterns

Each URL pattern becomes a route; imported routes fall through to the next one, as WireMock tries the next mapping.

1 of 4
2Matchers as rules

Each mapping is one rule in decide and one named answer, in the mappings' priority.

2 of 4
3Delays

fixedDelayMilliseconds and the median of delayDistribution become the answer's latency.

3 of 4
4Plain YAML

Edit what was imported in the editor or the file, like any plugin.

4 of 4
  1. Request patterns

    Each URL pattern becomes a route; imported routes fall through to the next one, as WireMock tries the next mapping.

  2. Matchers as rules

    Each mapping is one rule in decide and one named answer, in the mappings' priority.

  3. Delays

    fixedDelayMilliseconds and the median of delayDistribution become the answer's latency.

  4. Plain YAML

    Edit what was imported in the editor or the file, like any plugin.

Break it on purpose

The failures you need to test, exactly when you ask: from the screen or by a tool call, each one shown on the timeline with who caused it.

  • Imported faults

    EMPTY_RESPONSE answers empty; the other WireMock faults reset the connection

    kept from the mapping, or force_answer empty | reset
  • Any imported answer

    Any mapping's response on the next N calls, whatever the request

    force_answer
  • A scenario state

    Jump straight to auth-failure or network instead of replaying the steps

    set_scenario
  • Not matched

    404 Request was not matched, as WireMock answers

    a request no mapping matches
  • Server and network failures

    500, 503, timeout or an HTML page, beyond what the mappings had

    force_answer
  • Slow answers

    More latency than the mapping's fixed delay

    set_service latency

Why not the real sandbox

Your AI agent drives it

Claude Code, Codex or any MCP client connects to /mcp (or calls /api over plain HTTP), sets the stand-in up, breaks it on cue and reads what your app did.

you

Import our WireMock folder and test the tracking client in its auth-failure scenario.

import_mocks{"source": "/mocks/partners", "dry": true}
→ ok 7 mappings, 2 services: acme-tracking (scenarios auth-failure, network), globex-tolls
import_mocks{"source": "/mocks/partners"}
set_scenario{"service": "acme-tracking", "scenario": "auth-failure"}
wait_for_api_call{"service": "acme-tracking"}

MCP tools

  • import_mocksWireMock mappings or WSDLs become services; dry=true only shows
  • set_scenarioMoves a service to a scenario; Started is the normal one
  • get_pluginThe YAML the import wrote
  • list_answersAnswers made from the mappings' responses
  • try_routeRuns a route on a sample request
  • force_answerThe next calls get a named answer
  • list_api_callsCalls with the answer each got
  • list_unmatchedRequests no route took

The same over HTTP

  • POST/api/plugins/import
  • PUT/api/plugins/{service}/scenario
  • GET/api/plugins/{service}
  • GET/api/apis/calls