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 diff compares each mock with the live API, and it works without an OpenAPI spec.
  • You want CI to tell drift apart from an outage. apifae diff exits 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.

Read from WireMock’s own documentation on . What each row is based on.
CapabilityAPIFaeWireMock (opens in a new tab)
What you install firstNothing. One native binary.A JVM
Mocks are files you can commitYAMLJSON mappings
Record a real API into mocksYesYes
Named states a scenario moves betweenYesYes
Compares your mock against the live APIYes, apifae diffNot in open-source WireMock
Works without an OpenAPI specYes. A spec adds a second checkYes. Cloud’s validation needs a spec
LicenceClosed source; binaries under MIT or Apache-2.0Apache 2.0
Asserts a request was receivedNoYes
Connection resets and random delaysFixed delays onlyYes
gRPCNoThrough an extension
GraphQLNoThrough 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.

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. Licence

  9. 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)
  10. 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)
  11. 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)
  12. GraphQL

    Through an extension

    The WireMock GraphQL Extension provides semantic verification of GraphQL requests
    https://wiremock.org/docs/graphql/ (opens in a new tab)
  13. 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.