Search in sources :

Example 1 with LogMessageWaitStrategy

use of org.testcontainers.containers.wait.LogMessageWaitStrategy in project testcontainers-java by testcontainers.

the class LocalStackContainer method before.

@Override
protected void before() throws Throwable {
    Preconditions.check("services list must not be empty", services != null && services.length > 0);
    final String servicesList = Arrays.stream(services).map(Service::getLocalStackName).collect(Collectors.joining(","));
    final Integer[] portsList = Arrays.stream(services).map(Service::getPort).collect(Collectors.toSet()).toArray(new Integer[] {});
    delegate = new GenericContainer("localstack/localstack:0.8.5").withExposedPorts(portsList).withFileSystemBind("//var/run/docker.sock", "/var/run/docker.sock", READ_WRITE).waitingFor(new LogMessageWaitStrategy().withRegEx(".*Ready\\.\n")).withEnv("SERVICES", servicesList);
    delegate.start();
}
Also used : LogMessageWaitStrategy(org.testcontainers.containers.wait.LogMessageWaitStrategy) GenericContainer(org.testcontainers.containers.GenericContainer)

Aggregations

GenericContainer (org.testcontainers.containers.GenericContainer)1 LogMessageWaitStrategy (org.testcontainers.containers.wait.LogMessageWaitStrategy)1