What is WireMock?
WireMock is a popular open-source tool for API mock testing. It can run as a library or client wrapper in many languages, or as a standalone HTTP server.
Started in 2011 as a Java library by Tom Akehurst, WireMock is now available in a wide range of languages and technology stacks. It has over 5 million downloads per month, and is supported by a large and highly-engaged community.
WireMock supports several approaches for creating mock APIs - in code, via its REST API, as JSON files and by recording HTTP traffic proxied to another destination. It also provides a 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.
WireMock Benefits for Developers
Simulate the APIs of microservices and apps
Create stable test and dev environments
Isolate development from flakey 3rd parties
Mock APIs that don’t exist (or aren’t ready)
- HTTP response stubbing, matchable on URL, header and body content patterns
- Request verification
- Runs in unit tests, as a standalone process or as a WAR app
- Record/playback of stubs
- Configurable response delays and fault injection
- Per-request conditional proxying
- Browser proxying for request inspection and replacement
- Stateful behaviour simulation
The WireMock Ecosystem
WireMock has implementations and adapters for other languages and test frameworks. It supports adapters and implementations for Python, .NET, Golang, and Rust, among others.
For the JVM ecosystem, there are libraries for Spring Boot, Quarkus, Kotlin, Testcontainers and other. WireMock can also run on Android support, and soon to provide official gRPC and GraphQL adapters.
What is WireMock Cloud?
WireMock Cloud is a managed, hosted version of WireMock, developed by the same team who wrote the open-source project. It's built on the same technology that powers open source WireMock and is 100% compatible with the WireMock API, with additional features that make it quick and easy to mock any API you depend on. WireMock Cloud also introduces advanced capabilities such as chaos engineering, as well as better collaboration and user management.
To learn more, see the full features of WireMock Cloud or visit the documentation site.
The benefits of WireMock Cloud:
- Web UI makes it easier to manage scale your WireMock deployment
- Better ways to collaborate, including user management and authentication
- Removes the need to manage hosting infrastructure and SSL
- Get support when you need it from the people who built WireMock
- Access to exclusive new features