I am trying to understand what is the difference between two frameworks which are MockServerClient( or org.mockserver.integration.ClientAndServer) and WireMockServer?Can they be exchanged? I read the docs. but could not figure out what is the difference between these two? Thanks.
Asked
Active
Viewed 1.0k times
2 Answers
12
They both do more or less the same thing. WireMock is slightly more popular (in terms of stars on the GitHub repo).
Without being entirely certain, some differences seem to be:
- MockServer seems to have a Maven Plugin for configuration and starting the server
- MockServer offers a way to set up callbacks when a request matches an Expectations
- WireMock seems to have an easier way of manipulating external files to set up the Expectations
They, on the other side, both offer:
- A UI dashboard
- A record+replay feature
We are currently using both at work, but I've only interacted with MockServer.

payne
- 4,691
- 8
- 37
- 85
-
As I am currently trying to make a decision which one I'll use for a new project, I quickly chose WireMock. It has a way more comprehensive and clear documentation website and there are way more helpful YouTube videos available, which make it a good choice for me (although I also managed to test against MockServer in my Spring Boot application, but it feels like "I am lucky it works", not like "I know what I did and why it works"...). – Marcus K. Mar 22 '21 at 19:22
-
@MarcusK. yeah, I think I would generally choose WireMock too, but MockServer's Maven plugin was what we really needed. – payne Mar 23 '21 at 00:41
-
1One important difference is that wiremock can be configured while it's running, which is great if you are running concurrent tests. With MockWebServer one needs to know the order of requests upfront (for me this is a definite **no-no** as it ties the implementation to the test), or one needs to code a custom dispatcher. In my setup, I use a custom junit extension to start WireMock and it's available for all tests. If I would need to make a decision today, I would 100% use WireMock instead of MockWebServer. – Augusto May 03 '23 at 20:40
0
I first used Mockserver when I discovered, that there is a dedicated testcontainers module for it, while there is none for Wiremock https://www.testcontainers.org/modules/mockserver/ But on the other hand Wiremock seems to be easy to use with testcontainers without official testcontainers support anyway https://github.com/testcontainers/testcontainers-java/issues/3554 I haven't tried it though

Karol
- 1
- 1
-
Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 19 '22 at 10:30