Hi everyone!
My spring boot app makes calls to an external service API that is not yet available, so I need to mock its responses for my integration tests. I am wandering what's the difference between using wiremock as a standalone and with testcontainers and when would I prefer to use each?
l
Lee Turner
01/09/2025, 2:07 PM
Hey, there probably isn't a huge amount of difference. Using wiremock standalone in your tests is perhaps a little quicker due to not having to spin up the container.
If you are already using test containers for other dependencies, it can be nice to use the same process for all your external dependencies.
To be honest, with the new spring boot integration we just released I would personally use that over test containers.
https://wiremock.org/docs/spring-boot/https://www.wiremock.io/post/wiremock-now-has-an-official-spring-boot-integration
r
Raya Simeonova
01/09/2025, 2:27 PM
Could the fact that containers run in isolation play as a factor in some cases?
l
Lee Turner
01/09/2025, 2:31 PM
I don't think this has ever been an issue in the projects I have seen
r
Raya Simeonova
01/09/2025, 2:33 PM
Ok, thank you!
l
Lee Turner
01/09/2025, 2:34 PM
If you are having any issues with using WireMock in your spring boot tests let us know 👍