testcontainers / testcontainers-java

Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
https://testcontainers.org
MIT License
8.03k stars 1.65k forks source link

Provide a mock server module adding support for WireMock #3554

Closed galegofer closed 2 years ago

galegofer commented 3 years ago

It will be very nice to be able to have more choices when adding mock server modules, but just having Mockserver, given WireMock is the most popular one, I think it will be a very good adding.

Haple commented 2 years ago

Up!

josejuanmontiel commented 2 years ago

Hi, not exactly...

but with this.. you can do something like this...

public static final DockerImageName WIREMOCK_IMAGE = DockerImageName.parse("wiremock/wiremock:2.32.0-alpine"); public static GenericContainer<?> mockServer = new GenericContainer<>(WIREMOCK_IMAGE).withExposedPorts(8080).waitingFor(Wait.forHttp("/__admin/mappings").withMethod("GET").forStatusCode(200));

kiview commented 2 years ago

Thanks for sharing @josejuanmontiel 👍

Since it's trivial to use WireMock with GenericContainer, I am closing this issue for now.

If someone has some thoughts and arguments why a dedicated module (as per docs) for WireMock is necessary, please comment on this issue and we can consider reopening it.

oleg-nenashev commented 1 year ago

@kiview @bsideup could you please reopen it? I want to tinker with it on WireMock's side https://github.com/wiremock/ecosystem/issues/1

kiview commented 1 year ago

Hey @oleg-nenashev, happy to collaborate with you on this. Given we now have https://testcontainers.com/modules/ (where we can also link to external repositories), WDYT about hosting it in its own repository (e.g. under the WireMock org)?

oleg-nenashev commented 1 year ago

Yes, I think it would be the best approach

oleg-nenashev commented 1 year ago

To whomever is interested, here is the alpha version of the module: https://github.com/wiremock/wiremock-testcontainers-java