Skip to content

WireMock

WireMock is an open-source HTTP mock server designed for simulating APIs, offering programmatic control over mock responses and record/playback functionality.

Freemium · API

stork
I am a flat drawing.
One flat drawing and one typed sentence.
This drawing was never animated.
A photo, a cartoon, a painting or a 3D character. From 10 cents a minute. Free to try.
Make a photo talkDevelopers: there is an API

What is WireMock?

WireMock is a HTTP mock server tool developed by the WireMock community that enables developers and QA teams to simulate APIs. It functions by setting up a configurable HTTP server that mimics the behavior of real APIs, allowing for testing and development without relying on actual backend services. Its core purpose is to create stable test environments, isolate applications from flaky third-party dependencies, and facilitate development against APIs that are still under construction. WireMock provides programmatic control over mock responses through code or configuration, supporting dynamic responses, fault simulation, and record/playback functionality for creating stub mappings. The tool is suitable for developers requiring deep customization and control in their API simulation workflows.

Key Features of WireMock

WireMock offers a comprehensive set of features for HTTP-based API mocking and service virtualization, enabling developers to create robust and flexible test environments. These capabilities support various testing methodologies and development workflows.

  • HTTP Mocking and Matching: Configurable HTTP server to mimic API behavior.
  • Dynamic Response Templating: Generate dynamic responses based on request parameters.
  • Record & Playback: Capture real API traffic to create stub mappings.
  • Fault Simulation: Simulate network delays, error codes, and other fault conditions.
  • Request Verification: Assert that specific requests were made to the mock server.
  • Extensibility: Custom matchers and transformers for advanced mocking scenarios.
  • Deployment Options: Run as a standalone server or embed within applications.
  • Testing Integrations: Seamless integration with testing frameworks like JUnit.
  • AI Agent Skills and Remote MCP: AI-first interfaces for generating simulations and a hosted Mocking Control Plane server (WireMock Cloud).

Who Should Use WireMock?

WireMock is primarily utilized by software developers, QA engineers, and development teams who require reliable and controlled environments for API-dependent applications. Its versatility supports various stages of the software development lifecycle.

  • API Testers: For creating mock APIs to test client applications, including edge cases and error scenarios.
  • Microservice Developers: To perform contract testing and ensure conformity between interacting microservices.
  • Integration Testers: For simulating external service responses to identify integration issues between system components.
  • Parallel Development Teams: To allow simultaneous work on dependent features without waiting for upstream services.
  • Performance Engineers: For simulating realistic API responses with varying response times to test system performance under different loads.

How to Use WireMock

WireMock can be used by running it as a standalone server or embedding it into a Java application. Configuration involves defining stub mappings either programmatically or via JSON files to specify expected requests and corresponding responses.

  1. Download the standalone JAR or add the WireMock dependency to your project (e.g., Maven, Gradle).
  2. Start the WireMock server, either from the command line or programmatically in your test setup.
  3. Define stub mappings using the fluent Java API or JSON files, specifying URL paths, HTTP methods, request headers, and response bodies/status codes.
  4. Configure your client application or tests to point to the WireMock server's address and port.
  5. Execute your tests or application, which will interact with the simulated API provided by WireMock.
  6. Verify requests made to WireMock to ensure your application behaves as expected.

WireMock Pricing & Plans

WireMock operates on a freemium model, offering a fully open-source core engine and a cloud-based platform with a free tier. The Core WireMock Engine is free and open source, providing all fundamental mocking capabilities for self-hosted deployments. WireMock Cloud offers a 'Free forever' tier, which includes AI-native environment simulation and other cloud-specific features.

  • Core WireMock Engine: Free and open source
  • WireMock Cloud: Free forever

Pros

  • Extensive control over HTTP mock responses via code or JSON configuration.
  • Supports advanced features like dynamic response templating and fault simulation.
  • Offers both standalone server and embedded library deployment options.
  • Record & Playback functionality simplifies stub mapping creation from real traffic.
  • Strong community support and active development, with over 6 million downloads per month.
  • Seamless integration with popular testing frameworks like JUnit.

Cons

  • Can have a steeper learning curve for beginners due to its programmatic nature.
  • Maintenance overhead can increase with a large number of complex stub mappings.
  • Admin APIs may be challenging to use without direct support for some users.
  • WireMock Cloud can be perceived as expensive for smaller teams with budget constraints.
  • Limitations in fully replicating highly dynamic, real-time API behaviors.
  • Primarily focused on HTTP/S, with less native support for other protocols compared to some alternatives.

WireMock vs Competitors

WireMock is a prominent tool in the API mocking and service virtualization landscape, known for its flexibility and deep control over HTTP services. It competes with several other open-source and commercial solutions, each with distinct strengths.

See every WireMock alternative, compared

WireMock

Freemium · API

Enjoying this? Get one like it in your inbox each morning.

one email a day · unsubscribe in two clicks · no third-party tracking