APIFae or WireMock
Both tools serve HTTP mocks from files kept in your repository. WireMock is an open-source mock server that runs on the JVM. APIFae is a single native binary that also checks whether your mocks still match the API they stand in for.
This page compares APIFae with the open-source version of WireMock. Every claim about WireMock below links to the documentation page it came from.
Pick WireMock if
- You need an open-source tool. WireMock is licensed under Apache 2.0.
- Your tests run on the JVM and you want to start the mock server from inside them.
- You want tests to assert that a specific request was received.
- You want to simulate connection resets, or delays drawn from a random distribution.
- You need to mock gRPC services. WireMock does this through an extension.
- You want a tool with a long history. WireMock started in 2011.
Pick APIFae if
- You don't want to install a runtime first. APIFae is a single native binary.
- You need to know when your mocks stop matching the real API.
apifae diffcompares each mock with the live API, and it works without an OpenAPI spec. - You want CI to tell drift apart from an outage.
apifae diffexits 1 when a mock has drifted and 2 when it can't reach the API.
Both tools keep mocks in files you can commit, can record real traffic, and support named scenario states.
| Capability | APIFae | WireMock (opens in a new tab) |
|---|---|---|
| What you install first | Nothing. One native binary. | A JVM |
| Mocks are files you can commit | YAML | JSON mappings |
| Record a real API into mocks | Yes | Yes |
| Named states a scenario moves between | Yes | Yes |
| Compares your mock against the live API | Yes, apifae diff | Not in open-source WireMock |
| Works without an OpenAPI spec | Yes. A spec adds a second check | Yes. Cloud’s validation needs a spec |
| Licence | Closed source; binaries under MIT or Apache-2.0 | Apache 2.0 |
| Asserts a request was received | No | Yes |
| Connection resets and random delays | Fixed delays only | Yes |
| gRPC | No | Through an extension |
| GraphQL | No | Through an extension |
WireMock Cloud, WireMock’s hosted product, can check requests to a mock and the mock’s responses against your OpenAPI spec. That check is not part of open-source WireMock, which is what this page compares.
Where each claim comes from
Checked against WireMock’s documentation on . If a quote no longer matches the page it links to, the claim is out of date and we want to hear about it.
Pick WireMock if
You need an open-source tool. WireMock is licensed under Apache 2.0.
Apache License Version 2.0, January 2004
https://github.com/wiremock/wiremock/blob/master/LICENSE.txt (opens in a new tab)Your tests run on the JVM and you want to start the mock server from inside them.
The JUnit Jupiter extension simplifies running of one or more WireMock instances
https://wiremock.org/docs/junit-jupiter/ (opens in a new tab)You want tests to assert that a specific request was received.
verify that a request matching a specific pattern was received
https://wiremock.org/docs/verifying/ (opens in a new tab)You want to simulate connection resets, or delays drawn from a random distribution.
a delay can be sampled from a random distribution … CONNECTION_RESET_BY_PEER: Close the connection
https://wiremock.org/docs/simulating-faults/ (opens in a new tab)You need to mock gRPC services. WireMock does this through an extension.
supports mocking of gRPC services via the WireMock extension for gRPC
https://wiremock.org/docs/grpc/ (opens in a new tab)You want a tool with a long history. WireMock started in 2011.
Started in 2011 as a Java library by Tom Akehurst
https://github.com/wiremock/wiremock (opens in a new tab)What you install first
A JVM
you can run it simply by doing this … java -jar wiremock-standalone
https://wiremock.org/docs/standalone/java-jar/ (opens in a new tab)Mocks are files you can commit
JSON mappings
will be saved to the file system (or other back-end if you've implemented your own MappingsSource) and will survive calls to reset mappings
https://wiremock.org/docs/record-playback/ (opens in a new tab)Record a real API into mocks
Yes
WireMock can create stub mappings from requests it has received. Combined with its proxying feature this allows you to "record" stub mappings from interaction with existing APIs
https://wiremock.org/docs/record-playback/ (opens in a new tab)Named states a scenario moves between
Yes
Stub mappings can be configured to match on scenario state, such that stub A can be returned initially, then stub B once the next scenario state has been triggered
https://wiremock.org/docs/stateful-behaviour/ (opens in a new tab)Compares your mock against the live API
Not in open-source WireMock
API drift detection Not available
https://wiremock.org/docs/wiremock-cloud/ (opens in a new tab)Works without an OpenAPI spec
Yes. Cloud’s validation needs a spec
requests made to your mock API and responses returned by your mock API are compliant with your OpenAPI specification
https://docs.wiremock.io/openAPI/openapi-validation (opens in a new tab)Licence
Apache 2.0
Apache License Version 2.0, January 2004
https://github.com/wiremock/wiremock/blob/master/LICENSE.txt (opens in a new tab)Asserts a request was received
Yes
verify that a request matching a specific pattern was received
https://wiremock.org/docs/verifying/ (opens in a new tab)Connection resets and random delays
Yes
a delay can be sampled from a random distribution … CONNECTION_RESET_BY_PEER: Close the connection
https://wiremock.org/docs/simulating-faults/ (opens in a new tab)gRPC
Through an extension
supports mocking of gRPC services via the WireMock extension for gRPC
https://wiremock.org/docs/grpc/ (opens in a new tab)GraphQL
Through an extension
The WireMock GraphQL Extension provides semantic verification of GraphQL requests
https://wiremock.org/docs/graphql/ (opens in a new tab)WireMock Cloud
WireMock Cloud, WireMock’s hosted product, can check requests to a mock and the mock’s responses against your OpenAPI spec. That check is not part of open-source WireMock, which is what this page compares.
requests made to your mock API and responses returned by your mock API are compliant with your OpenAPI specification
https://docs.wiremock.io/openAPI/openapi-validation (opens in a new tab)
Our own column
The APIFae cells have no quotes because you can check them by running the binary. The full comparison puts APIFae next to WireMock, Prism and Mockoon, and the guide to keeping a mock honest walks through a real apifae diff run against a live API.