Hello. I just started working with wiremock. We ar...
# help
v
Hello. I just started working with wiremock. We are already using both JUnit5 and Testcontainers. I found https://wiremock.org/docs/junit-jupiter/ and https://testcontainers.com/modules/wiremock/ Is there some advantage of launching wiremock one way or the other?
l
There are some nice things that are configured for you when using Junit5. The static dsl will be configured for you and i think the the verify API is really nice. I can't remember how the verify works with the testcontainers module.
Something to be aware of if you are going with the test containers module is that the version on the page you linked to is quite old so it might be better to use the latest version of WireMock if you can. I will look at getting that tests containers page updated
v
Looks like wiremock-testcontainers-module last is 1.0-alpha-14. Is that the latest? https://search.maven.org/artifact/org.wiremock.integrations.testcontainers/wiremock-testcontainers-module
l
That looks like the latests version of the test containers module. I was mostly talking about the version of WireMock being used when starting the container. In the example it uses version
2.35.0
which is quite an old version of WireMock
Copy code
WireMockContainer wiremockServer = new WireMockContainer("2.35.0")
          .withMapping("hello", WireMockContainerJunit5Test.class, "hello-world.json");
wiremockServer.start();
v
Using
WireMockContainer("2.35.0")
does not even run! I had to use the standard
WireMockContainer(DockerImageName._parse_("wiremock/wiremock"))
.
l
Fair enough. We need to take a look at that page and update all the details
Thanks for letting us know
v
It would be interesting to also show (using code) the differences between using JUnit5 and Testcontainers. I am still playing around with this and trying to discover what will work better for us.
👍 1