diff --git a/src/main/java/de/rpr/testcontainers/infinispan/InfinispanContainer.java b/src/main/java/de/rpr/testcontainers/infinispan/InfinispanContainer.java index 98593d5..c443dd5 100644 --- a/src/main/java/de/rpr/testcontainers/infinispan/InfinispanContainer.java +++ b/src/main/java/de/rpr/testcontainers/infinispan/InfinispanContainer.java @@ -6,17 +6,13 @@ import org.infinispan.client.hotrod.RemoteCacheManager; import org.infinispan.client.hotrod.configuration.ConfigurationBuilder; import org.infinispan.client.hotrod.exceptions.HotRodClientException; import org.junit.runner.Description; -import org.rnorth.ducttape.Preconditions; import org.testcontainers.containers.BindMode; import org.testcontainers.containers.GenericContainer; -import org.testcontainers.containers.wait.LogMessageWaitStrategy; +import org.testcontainers.containers.wait.Wait; -import java.time.Duration; import java.util.*; import java.util.stream.IntStream; -import static java.time.temporal.ChronoUnit.SECONDS; - /** * An implementation of the {@link org.testcontainers.containers.GenericContainer} class that can be * used to easily instantiate an Infinispan server for integration tests. @@ -77,9 +73,7 @@ public class InfinispanContainer extends GenericContainer { this.withCommand(STANDALONE_MODE_CMD); withExposedPorts(Arrays.stream(InfinispanEndpoints.values()).map(endpoint -> endpoint.protocolPort).toArray(Integer[]::new)); - this.waitStrategy = new LogMessageWaitStrategy() - .withRegEx(".*Infinispan Server.*started in.*\\s") - .withStartupTimeout(Duration.of(60, SECONDS)); + this.waitStrategy = Wait.forListeningPort(); } /**