File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/main/java/org/wiremock/integrations/testcontainers Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 3333import java .util .stream .Stream ;
3434
3535import org .testcontainers .containers .GenericContainer ;
36+ import org .testcontainers .containers .wait .strategy .Wait ;
37+ import org .testcontainers .containers .wait .strategy .WaitStrategy ;
3638import org .testcontainers .images .builder .Transferable ;
3739import org .testcontainers .shaded .com .google .common .io .Resources ;
3840import org .testcontainers .utility .MountableFile ;
@@ -51,6 +53,11 @@ public class WireMockContainer extends GenericContainer<WireMockContainer> {
5153
5254 private static final String EXTENSIONS_DIR = "/var/wiremock/extensions/" ;
5355
56+ private static final WaitStrategy DEFAULT_WAITER = Wait
57+ .forHttp ("/__admin/mappings" )
58+ .withMethod ("GET" )
59+ .forStatusCode (200 );
60+
5461 private static final int PORT = 8080 ;
5562
5663 private final StringBuilder wireMockArgs ;
@@ -193,6 +200,7 @@ public Integer getServerPort() {
193200 protected void configure () {
194201 super .configure ();
195202 withExposedPorts (PORT );
203+ waitingFor (DEFAULT_WAITER );
196204 for (Stub stub : mappingStubs .values ()) {
197205 withCopyToContainer (Transferable .of (stub .json ), MAPPINGS_DIR + stub .name + ".json" );
198206 }
You can’t perform that action at this time.
0 commit comments