explaingit

wiremock/wiremock

7,241JavaAudience · developerComplexity · 3/5Setup · easy

TLDR

An open source tool for creating fake HTTP APIs during development and testing, so your app can run against predictable simulated services instead of depending on real external systems like payment processors or databases.

Mindmap

mindmap
  root((WireMock))
    What it does
      Fake HTTP APIs
      Test isolation
      Fault injection
    Tech Stack
      Java
      JSON config
      REST API
    Use Cases
      Integration testing
      Offline development
      Failure simulation
    Features
      Request matching
      Response templates
      Record and replay
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Run automated tests without needing live payment processors, weather APIs, or third-party databases to be available.

USE CASE 2

Simulate API failures, timeouts, and slow responses to verify that your application handles errors gracefully.

USE CASE 3

Record real API traffic once, then replay those captured responses in offline tests without hitting the live service again.

USE CASE 4

Model multi-step API workflows where the response changes based on how many times an endpoint has already been called.

Tech stack

JavaJSONREST

Getting it running

Difficulty · easy Time to first run · 30min
No specific license was mentioned in the explanation, the project is described as open source.

In plain English

WireMock is an open source tool for creating simulated versions of HTTP APIs. During software development and testing, your application often needs to call external services: payment processors, weather APIs, third-party databases, or other systems your team does not control. WireMock lets you define fake versions of those services that return predictable responses, so your tests and development environment can run without depending on external systems being available, reliable, or correctly configured. It started in 2011 as a Java library and now works across multiple programming languages. You can run it embedded inside unit tests (so each test controls its own simulated API), as a standalone server process, or inside a container. Configuration is done in Java code, through JSON files, or by calling WireMock's own REST API at runtime. The matching system lets you define rules that say: when an incoming request matches this URL pattern, these headers, and this request body, respond with this. Rules can match against exact values, regular expressions, or more complex patterns. Response bodies can be dynamically generated using a template system, so a single rule can produce different outputs based on what came in with the request. WireMock also supports recording and playback: you can point it at a real API, have it capture the actual traffic, and then replay those captured responses in tests without hitting the real service again. Fault injection lets you simulate network errors, timeouts, and slow responses to test how your application handles failures. Stateful behavior simulation lets you model scenarios where the API's response changes based on previous calls, like a workflow that progresses through stages. WireMock downloads over six million times per month and has full documentation at wiremock.org.

Copy-paste prompts

Prompt 1
Using WireMock in Java, show me how to stub a POST request to /payment that returns a 200 OK response with a specific JSON body.
Prompt 2
How do I configure WireMock to simulate a 30-second timeout on a third-party API so I can test my app's timeout handling?
Prompt 3
Set up WireMock in recording mode to capture traffic from api.example.com so I can replay it in tests without internet access.
Prompt 4
How do I use WireMock to return a different response the second time an endpoint is called, to simulate a retry scenario?
Open on GitHub → Explain another repo

← wiremock on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.