WireMock - flexible API mocking

Free and Open Source

The flexible tool for building mock APIs.

Create stable development environments, isolate yourself from flakey 3rd parties and simulate APIs that don't exist yet.

Get started View docs
{
  "request": {
    "method": "GET",
    "url": "/wiremock"
  },

  "response": {
    "status": 200,
    "body": "Easy!"
  }
}
z
mocklab create stub screenshot
mocklab logo

Hosted API mocking for teams and enterprises

  • Cloud hosted - nothing to install
  • Intuitive web UI
  • Team collaboration
  • Swagger, OpenAPI and Postman import
  • 100% WireMock API compatible
Learn more Get Started for Free
Maven
Gradle
Kotlin
SBT
Java
Docker
  • Maven
  • Gradle Groovy
  • Gradle Kotlin
  • Scala SBT
  • Standalone
  • Docker

Add the following to your project's pom.xml dependencies:

<dependency>
  <groupId>com.github.tomakehurst</groupId>
  <artifactId>wiremock-jre8</artifactId>
  <version>2.35.0</version>
  <scope>test</scope>
</dependency>

Then follow the next steps for JUnit 5+ or plain Java.

Add the following to your project's build.gradle:

testImplementation "com.github.tomakehurst:wiremock-jre8:2.35.0"

Then follow the next steps for JUnit 5+ or plain Java.

Add the following to your project's build.gradle.kts:

testImplementation("com.github.tomakehurst:wiremock-jre8:2.35.0")

Then follow the next steps for JUnit 5+ or plain Java.

Add the following to your project’s build.sbt:

libraryDependencies +=
  "com.github.tomakehurst" % "wiremock-jre8" % "2.35.0" % Test

Download the latest standalone JAR then run the following in a terminal:

java -jar wiremock-jre8-standalone-2.35.0.jar

Learn more in the running standalone guide.

Run the following in a terminal:

docker run -it --rm \
  -p 8080:8080 \
  --name wiremock \
  wiremock/wiremock:2.35.0

Learn more in the Docker guide.

Key Features

WireMock frees you from dependency on unstable APIs and allows you to develop with confidence. It's easy to launch a mock API server and simulate a host of real-world scenarios and APIs - including REST, SOAP, OAuth2 and more.

Wiremock Features

Advanced request

matching

wiremock dynamic response

Dynamic response

templating

wiremock unit tests

Run in your unit tests, on your

laptop or in your test environment.

wiremock fault and latency

Fault and latency

injection

wiremock record playback

Record / Playback

wiremock java, python, http

Java, Python, HTTP and

JSON file APIs

FAQ

What is WireMock?
WireMock is a-list free API mocking tool that can be run as a standalone server, or in a hosted version via the MockLab managed service.
What is API mocking?
API mocking i-listnvolves creating a simple simulation of an API, accepting the same types of request and returning identically structured responses as the real thing, enabling fast and reliable development and testing.
When do you need to mock APIs?
API mocking i-lists typically used during development and testing as it allows you to build your app without worrying about 3rd party APIs or sandboxes breaking. It can also be used to rapidly prototype APIs that don’t exist yet.
How do you create an API mock?
WireMock supp-listorts several approaches for creating mock APIs - in code, via its REST API, as JSON files and by recording HTTP traffic proxied to another destination.
What makes WireMock unique?
WireMock has -lista rich matching system, allowing any part of an incoming request to be matched against complex and precise criteria. Responses of any complexity can be dynamically generated via the Handlebars based templating system. Finally, WireMock is easy to integrate into any workflow due to its numerous extension points and comprehensive APIs.
Is WireMock open source?
Yes, WireMock-list is a completely open source API mocking tool (GitHub repo). If you’re looking for a hosted version of WireMock, check out MockLab.
Is WireMock a free service?
WireMock is completely free under the Apache 2.0 license.