// Path: src/main/java/pl/domzal/junit/docker/rule/wait/StartConditionCheck.java
// public interface StartConditionCheck {
// 
//     /**
//      * 'Is condition fulfilled?' check.
//      */
//     boolean check();
// 
//     /**
//      * Condition description (will show in log messages).
//      */
//     String describe();
// 
//     /**
//      * After check cleanup. Use if you check need to do some cleaning after usage.
//      */
//     void after();
// 
// }


import static org.mockito.Mockito.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
import org.junit.After;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import junit.framework.AssertionFailedError;
import pl.domzal.junit.docker.rule.wait.StartConditionCheck;
package pl.domzal.junit.docker.rule;





@Category(test.category.Stable.class)
public class WaitForContainerTest {

    private static Logger log = LoggerFactory.getLogger(WaitForContainerTest.class);

    public static final int WAIT_LOG_TIMEOUT_SEC = 4;

    private final ExecutorService executor = Executors.newSingleThreadExecutor();

    private final AtomicBoolean doneWaiting = new AtomicBoolean(false);
    private final AtomicBoolean timeoutWaiting = new AtomicBoolean(false);
    private final AtomicReference<Throwable> exceptionWaiting = new AtomicReference<>();

    class WaitRunner implements Runnable {

// Path: src/main/java/pl/domzal/junit/docker/rule/wait/StartConditionCheck.java
// public interface StartConditionCheck {
// 
//     /**
//      * 'Is condition fulfilled?' check.
//      */
//     boolean check();
// 
//     /**
//      * Condition description (will show in log messages).
//      */
//     String describe();
// 
//     /**
//      * After check cleanup. Use if you check need to do some cleaning after usage.
//      */
//     void after();
// 
// }


// Path: src/test/java/pl/domzal/junit/docker/rule/WaitForContainerTest.java
import static org.mockito.Mockito.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
import org.junit.After;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import junit.framework.AssertionFailedError;
import pl.domzal.junit.docker.rule.wait.StartConditionCheck;

package pl.domzal.junit.docker.rule;





@Category(test.category.Stable.class)
public class WaitForContainerTest {

    private static Logger log = LoggerFactory.getLogger(WaitForContainerTest.class);

    public static final int WAIT_LOG_TIMEOUT_SEC = 4;

    private final ExecutorService executor = Executors.newSingleThreadExecutor();

    private final AtomicBoolean doneWaiting = new AtomicBoolean(false);
    private final AtomicBoolean timeoutWaiting = new AtomicBoolean(false);
    private final AtomicReference<Throwable> exceptionWaiting = new AtomicReference<>();

    class WaitRunner implements Runnable {

        private final StartConditionCheck condition;