
WireMock - rayascott
http://wiremock.org/
======
chasingthewind
I used WireMock extensively in a recent project that had a dependency on flaky
REST API. Using the proxy/recording feature to quickly get some canned
responses from the dependency allowed us to perform integration testing even
though the dependency was frequently down...we basically mocked it away so we
could have a reliable CI environment. Later on we were able to stabilize the
dependency but we kept the mock service in several cases because it provided
significant flexibility.

------
DerpyBaby123
For anyone interested, mountebank[1] is an also-good OSS alternative in the
same space

[1][http://www.mbtest.org](http://www.mbtest.org)

~~~
no_one_ever
+1 for mb.

I tried using wiremock for mocking HTTP requests to our microservices'
downstream dependencies. Rather than using a standalone wiremock server, we
used the java lib. Periodically the connection would drop and our tests would
fail. Switched to a standalone mock and haven't experienced this issue since.

~~~
w4tson
We tried both Mountebank and Wiremock and opted for Wiremock as it had more
features we needed. We run thousands of tests every time a developer commits
and we see no problems using the Java API.

We did run into an issue a small when we parallelized our tests. After a
certain parallel factor we saw what looked like Wiremock not being able to
keep up. However this might be FUD and we were running these tests all on one
machine including a docker-composed test harness so there were a lot of moving
parts

Overall Wiremock is excellent. I really rate the functionality to attach state
to scenarios. You can model quite complex behaviour with this

------
yoaviram
There's also a paid hosted version by the creator of Wiremock at
[https://mocklab.io](https://mocklab.io)

It has a great UI, team collaboration and other awesome add ons on top of
vanilla Wiremock.

------
JonasJSchreiber
This is fantastic. I created something like this for internal development [0],
but this looks like an actual product! Great work.

[0][https://jonasjschreiber.wordpress.com/2018/06/18/creating-
an...](https://jonasjschreiber.wordpress.com/2018/06/18/creating-an-isolated-
development-environment-from-scratch-using-docker/)

------
ynniv
It's an obvious design choice, but when I see the logo I can only think of
[https://en.wikipedia.org/wiki/Waste_Management_(corporation)](https://en.wikipedia.org/wiki/Waste_Management_\(corporation\)).

~~~
squidbot
I was just about to come and post the same thing. It's hard to imagine it's
not intentional, even the contrasting colors are similar and on the same
sides. I'd think the authors may want to reconsider the logo as they have some
commercialization of the tool (pro support.)

~~~
nvarsj
WireMock was born in London, UK, so I doubt the author was aware of the
connection. Or maybe he was, and it's tongue in cheek humor :).

~~~
squidbot
My concern was more that the logo was outsourced to someone who copied the
Waste Management design.

~~~
tomakehurst
I can confirm it was neither intentional, nor copied!

------
bgdam
Apologies for the shameless promotion.

If anybody is looking for something similar, but with a user friendly GUI on
top, and running as a cross platform desktop app, please checkout
[https://mocktastic.com](https://mocktastic.com)

In addition to allowing you to mock multiple response codes for each endpoint
and proxying and recording proxied requests, it also has a complete log of all
requests and responses it handles that would be helpful for your debugging.

It also has team sync features so one person on your team can mock a complete
REST API server and others can seamlessly use it.

EDIT: Currently it only supports mocking HTTP REST APIs. Support is planned
for websocket messages and graphQL.

------
Serow225
The creator has a hosted version at
[https://mocklab.io/](https://mocklab.io/), and he's extremely responsive to
support and feature request implementation.

~~~
ris
> extremely responsive to support

And yet
[https://github.com/tomakehurst/wiremock/issues/97](https://github.com/tomakehurst/wiremock/issues/97)

~~~
Serow225
Interesting. All my experience is with the hosted version, and my comment
about support was related to that as well.

------
craigt00
There's also a .net implementation here - [https://github.com/WireMock-
Net/WireMock.Net](https://github.com/WireMock-Net/WireMock.Net)

------
tobiaswk
Very similar to [https://getsandbox.com/](https://getsandbox.com/).

------
matrix
Looking at this, I can't seem to find any examples of Wiremock being used to
test async callbacks, which is one of the more challenging things to get
right. Can anyone point to some documentation or code samples showing how to
do this in Wiremock?

~~~
tomakehurst
If by async callbacks you mean something akin to webhooks, then there's an
extension for that: [https://github.com/wiremock/wiremock-webhooks-
extension](https://github.com/wiremock/wiremock-webhooks-extension)

------
vinniejames
I've been using [https://www.mocky.io](https://www.mocky.io)

Source: [https://github.com/julien-lafont/Mocky](https://github.com/julien-
lafont/Mocky)

------
segmondy
I've been using json-server for quite a while,

[https://github.com/typicode/json-server](https://github.com/typicode/json-
server)

------
donnfelker
I highly recommend it. I use it at a client extensively and have grown to rely
on it heavily for its ability to provide a hermetic testing environment with
mobile apps (android).

------
a-wu
I wanted to use WireMock for a project, but iirc you can't mock streaming
connections. Does anyone know a similar product that supports this?

------
kyberias
What benefits does mocking a HTTP service provide when compared to mocking the
adapter code that makes the call?

App -> Adapter -> Service

App -> Adapter -> MockService

App -> MockAdapter

~~~
royjacobs
It can also test (de)serialization, parsing of HTTP headers, fallbacks, etc.
When you're testing business logic then using a mock adapter would be fine, of
course.

~~~
maccio92
+1

------
pvorb
I found Hoverfly to be a good alternative:
[https://hoverfly.io/](https://hoverfly.io/)

------
nurettin
Now if this had code generation capabilities for .net core, spring boot or
rails-api it would have piqued some interest.

~~~
oweiler
[https://cloud.spring.io/spring-cloud-
contract/](https://cloud.spring.io/spring-cloud-contract/) generates a
Wiremock mock server for you.

~~~
nurettin
Why, yes it does! Thanks.

------
buzain
Does anyone know of a similar open source tool for mocking ISO 8583 based
APIs?

------
amleszk
Can anyone comment on how useful this is for testing iOS and Android apps?

~~~
tomakehurst
Hi, WireMock creator here.

Lots of folks use WireMock for Android testing. Definitely worth checking out
Sam Edwards' blog and conference presentations on this, e.g.
[https://handstandsam.com/2016/01/30/running-wiremock-on-
andr...](https://handstandsam.com/2016/01/30/running-wiremock-on-android/)

~~~
ascorbic
I've no idea why, but all of your comments were dead. I've vouched for them,
so hopefully people will be able to see them now. Seems a bit silly to have
the author in the thread, but all of his comments hidden!

~~~
tomakehurst
Strange. I could see them OK. Thanks for vouching (assuming you can see this
one)!

~~~
ascorbic
You can always see your own comments. I have "show dead" enabled, but that
comment was fine anyway.

------
swsieber
Totally (mostly) off topic:

I'd love to see an index of who uses what. I see the who's using us section,
and some of those names look familiar from other sections. So it'd be fun to
flip things and show what any given company is using.

I dunno, maybe scrap prodcuts from product hunt?

~~~
Arkanosis
If I understand well what you mean, you might like
[https://stackshare.io/](https://stackshare.io/) :)

~~~
swsieber
Well, I feel extremely foolish, having seen that site before.

------
movence
so is it similar to Polly.js by Netflix but written in Java?

~~~
notdang
Except that Polly.js was released this year and WireMock a couple of years
ago.

~~~
tomakehurst
WireMock was originally released in 2011

------
technotarek
Postman?

~~~
technotarek
No affiliation, just a happy user.

[https://www.getpostman.com](https://www.getpostman.com)

