use of org.testcontainers.containers.output.WaitingConsumer in project testcontainers-java by testcontainers.
the class LogMessageWaitStrategy method waitUntilReady.
@Override
protected void waitUntilReady() {
WaitingConsumer waitingConsumer = new WaitingConsumer();
LogUtils.followOutput(DockerClientFactory.instance().client(), waitStrategyTarget.getContainerId(), waitingConsumer);
Predicate<OutputFrame> waitPredicate = outputFrame -> outputFrame.getUtf8String().matches(regEx);
try {
waitingConsumer.waitUntil(waitPredicate, startupTimeout.getSeconds(), TimeUnit.SECONDS, times);
} catch (TimeoutException e) {
throw new ContainerLaunchException("Timed out waiting for log output matching '" + regEx + "'");
}
}
Aggregations