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

pl.domzal.junit.docker.rule.wait.LogChecker Maven / Gradle / Ivy

There is a newer version: 0.6.0
Show newest version
package pl.domzal.junit.docker.rule.wait;

import pl.domzal.junit.docker.rule.DockerRule;

/**
 * {@link StartConditionCheck} met when container log lines contains specified message.
 */
public class LogChecker implements StartConditionCheck {

    private final DockerRule rule;
    private final String waitForMessage;

    public LogChecker(DockerRule rule, String waitForMessage) {
        this.rule = rule;
        this.waitForMessage = waitForMessage;
    }

    @Override
    public boolean check() {
        return rule.getLog().contains(waitForMessage);
    }

    @Override
    public String describe() {
        return String.format("log message '%s'", waitForMessage);
    }

    @Override
    public void after() { }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy