Traffic Parrot for WireMock users

Part of Switching from another tool, the hub for every migration page.

« Back to documentation home

WireMock compatibility

Traffic Parrot embeds a fork of WireMock and is WireMock-compatible. If you already use WireMock, the artefacts you have built carry over directly:

  • Your WireMock JSON mappings load and serve unchanged.
  • The __files directory convention and the bodyFileName response attribute work exactly as they do in WireMock.
  • WireMock ZIP archives can be imported directly into Traffic Parrot.

The How to migrate WireMock to Traffic Parrot tutorial imports a sample WireMock project end to end, and its What behaves differently section lists what to check once your mappings are loaded.

Because the request matching, request-to-response mapping format, and response templating come from the embedded WireMock fork, your existing stub definitions keep their meaning. Traffic Parrot then runs them as a standalone server with a web user interface, recording, and additional protocols layered on top.

For the details of how Traffic Parrot loads, imports and serves WireMock mappings, see Import and export HTTP mappings (including importing a WireMock ZIP) and File-backed responses with bodyFileName and the __files directory. A short, downloadable getting-started package is also available on the WireMock getting started package page.

Why WireMock users move to Traffic Parrot

Because Traffic Parrot is WireMock-compatible, adopting it does not mean throwing away what you have built; it means keeping your HTTP stubs and adding capabilities WireMock does not set out to provide. If you are deciding whether to adopt or migrate, these are the differences that matter most:

  • One tool for every protocol, not just HTTP. WireMock focuses on HTTP; real systems also talk over messaging and mainframe queues. Traffic Parrot virtualises all of them in a single server, so you stop bolting separate tools together. This is the biggest win for most teams; see One standalone server for every protocol below.
  • A team-shareable running server. Instead of a library started inside each test process, Traffic Parrot runs as one standalone instance on a known port. The same running server backs far more than automated tests: manual and exploratory testing, demos, performance runs, long-lived shared environments (QA, SIT, integration) and CI pipeline agents can all use it at once, configured the same way for everyone. Licensing is by concurrent (floating) instances rather than per developer, so one approach scales across many users and environments.
  • A web user interface. Browse, add and edit mappings in a GUI, inspect the live request journal, and manage everything visually rather than only in code or JSON. Team members who do not write Java can read and change stubs.
  • Recording and playback. Record real traffic against a target system and replay it as mappings, so you can build a realistic virtual service from observed behaviour rather than hand-writing every stub; see the record and replay tutorial.
  • Scenarios and stateful behaviour. Group related mappings and model stateful flows with composite scenarios and virtual services.

Everything you already rely on for HTTP (request matching, the request-to-response mapping format and response templating) continues to work, because it comes from the embedded WireMock fork. The additions above sit on top of that familiar foundation.

One standalone server for every protocol

WireMock focuses on HTTP. That is exactly what you want when the system under test only speaks HTTP, but most real systems do not. A service might receive an HTTP request, publish a message to a queue, and read from a mainframe. To test it end to end with WireMock alone, teams typically bolt on a separate stubbing or mocking tool for each non-HTTP dependency, each with its own configuration style, its own lifecycle, and its own way of matching requests and templating responses.

Traffic Parrot removes that fragmentation. It virtualises HTTP and the other protocols your system depends on in one standalone server: one tool to install, one running instance to share across the team, and, crucially, one mental model. The same request-matching and response-templating concepts you already know from WireMock apply across every protocol, so moving from stubbing an HTTP endpoint to stubbing a queue or a gRPC method is a small step, not a new tool to learn.

The protocols Traffic Parrot virtualises, in addition to HTTP, are:

  • gRPC: virtualise gRPC services using the same match-and-respond model, driven from your .proto definitions.
  • JMS messaging: virtualise message request/response and publish/subscribe flows across a broad set of brokers. JMS support includes ActiveMQ TCP, ActiveMQ AMQP 1.0, Azure AMQP 1.0, RabbitMQ AMQP 0.9.1 and IBM® WebSphere MQ 7.5+, so a team testing messaging does not need a separate tool per broker.
  • Native IBM® MQ: virtualise IBM MQ queues natively, which is particularly useful for teams testing against mainframe and enterprise messaging systems.
  • Thrift: virtualise Apache Thrift services for systems built on Thrift RPC.
  • File-based messages: virtualise file and message exchanges for integrations that drop and pick up files.
  • SOAP: record SOAP requests and generate dynamic XML responses, documented in the SOAP section of the HTTP page.

For a WireMock user, the practical effect is that you keep your HTTP stubs and gain messaging, mainframe-queue and file virtualisation without adding more tools to your test stack: one running server, one configuration approach, one place to inspect what the system under test actually sent.

From the WireMock embedded library to the Traffic Parrot standalone server

The biggest difference for a WireMock user is the model. The WireMock library is often run embedded inside a test process, started by a JUnit rule or extension, bound to a random port, and driven through a Java DSL. Traffic Parrot runs as a standalone server rather than an in-process library: you start it once, point your system under test at it, and drive it through its web user interface and admin API. From a JUnit test you start it in a container with the Testcontainers module, whose TrafficParrotClient stubs, verifies and resets over the admin API.

A standalone server is an advantage rather than a missing feature: one running instance can be shared across a whole team and across test runs, configured the same way every time, inspected live in the GUI, and reused outside of JUnit (manual testing, demos, performance runs, and non-JVM clients). The table below translates common WireMock embedded API habits to their Traffic Parrot equivalent.

WireMock (embedded library) Traffic Parrot (standalone server)
@WireMockTest / WireMockExtension / @Rule to start a server per test Start the Traffic Parrot server once and keep it running. You can start it from the GUI / downloaded distribution, from the trafficparrot-maven-plugin start/stop goals, from JUnit with the Testcontainers module, or as a container. The server is then shared by all of your tests rather than re-created for each one.
Random port assigned at startup, then read back in code (for example wireMockServer.port()) A fixed, configured port. The virtual service listens on trafficparrot.virtualservice.http.port (default 8081), so your system under test always targets a known address. See the configuration reference for this property and how to override it.
verify(...) DSL to assert that requests were received The request journal, viewable in the GUI, and available over the admin API: GET /api/http/requests lists received requests (it returns the same journal as WireMock's /__admin/requests), and POST /api/http/requests/count returns the match count for a criteria, which is the equivalent of a verify count assertion.
reset() between tests DELETE /api/http/requests clears the request journal, POST /api/http/__admin/scenarios/reset returns stateful mappings to their starting state, and DELETE /api/state clears key-value state, giving you a clean starting point between tests without restarting the server. Mappings are files on the server and stay as they are.

The admin endpoints above are served on the Traffic Parrot management port (localhost:8080 by default), the same port that hosts the GUI, not the stub-serving port your system under test calls. WireMock's own /__admin API stays on the virtual service port, 8081.

Where to go next

The concepts you rely on in WireMock map onto these Traffic Parrot pages:

  • Request matching: URL, method, query parameter, header, cookie and request body matchers (including JSONPath, XPath and JSON Schema). Start with Request Matching and the HTTP matchers reference.
  • Dynamic port and server configuration: the HTTP virtual service port and other settings live in the configuration reference (trafficparrot.virtualservice.http.port, default 8081).
  • Response templating: generate dynamic responses from request data, helpers and templates on the Dynamic Responses page.
  • JUnit / programmatic setup: start Traffic Parrot from a JUnit test with the Testcontainers module, or start and stop the standalone server from your build with the trafficparrot-maven-plugin, and import mappings as part of the same lifecycle.
  • SOAP: record SOAP requests and generate dynamic XML responses in the SOAP section of the HTTP page.

Still weighing up the wider field rather than migrating a specific WireMock setup? This page deliberately stays a compatibility and migration reference. For a comparison across tools (protocols, deployment, licensing and how each one fits an as-code workflow) read Best Service Virtualization Tools.