pl.domzal.junit.docker.rule.WaitForMessageBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of junit-docker-rule Show documentation
Show all versions of junit-docker-rule Show documentation
JUnit Rule starting docker container in junit test case.
package pl.domzal.junit.docker.rule;
import java.util.ArrayList;
public class WaitForMessageBuilder {
private final DockerRuleBuilder parentBuilder;
private final ArrayList messageSequence;
WaitForMessageBuilder(DockerRuleBuilder parentBuilder, String firstMessage) {
this.parentBuilder = parentBuilder;
this.messageSequence = new ArrayList<>();
this.messageSequence.add(firstMessage);
}
/** Next message in sequence to wait for */
public WaitForMessageBuilder nextMessage(String nextMessage) {
messageSequence.add(nextMessage);
return this;
}
/** End message sequence and continue with rule config. */
public DockerRuleBuilder waitDone() {
parentBuilder.waitFor(WaitFor.logMessageSequence(messageSequence));
return parentBuilder;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy