WireMock simulates HTTP APIs for stable tests and development. It runs embedded in code, as a standalone Java process, or in a container.
Overview
WireMock is an open-source tool for mocking HTTP services. Teams use it to build predictable test and development environments when real APIs are missing, unstable, or slow, and to prototype behavior before backends exist.
Stubs can be defined in Java, JSON files, or over a REST admin API, and traffic can be recorded by proxying requests to real systems. Matching covers URLs, headers, bodies, and other request parts; responses can be templated with Handlebars for dynamic output. Additional capabilities include request verification, injected faults and delays, conditional per-request proxying, browser proxying for inspection, stateful scenarios, and extension hooks.
WireMock spans multiple language bindings and can run inside unit tests, as a long-lived standalone server, or packaged for containers. Documentation and a large community surround the core Java engine, with a separate commercial cloud product offering hosted collaboration and advanced features.
Self-hosting is documented through standalone JAR execution and official Docker images that expose an HTTP port for stub traffic and administration.
Key features
- HTTP stubbing with rich request matchers
- JSON, Java, and REST configuration
- Record and playback via HTTP proxy
- Handlebars dynamic response templates
- Fault injection and response delays
- Stateful behavior and verification
- Standalone JAR or Docker deployment
- Extension points for custom logic
Use cases
- Isolating tests from third-party APIs
- Developing against APIs not yet built
- Replaying captured HTTP interactions in CI
- Simulating errors and slow responses