All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pl.domzal.junit.docker.rule.WaitForMessageBuilder Maven / Gradle / Ivy

There is a newer version: 0.6.0
Show newest version
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