Skip to content

Commit

Permalink
nonstatic matchers + removed useless checks
Browse files Browse the repository at this point in the history
  • Loading branch information
amihaiemil committed Jan 3, 2019
1 parent 06cba76 commit 9800edb
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/test/java/com/amihaiemil/docker/RtLogsITCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

import org.apache.commons.io.IOUtils;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.hamcrest.core.StringStartsWith;
import org.junit.Ignore;
import org.junit.Test;

Expand All @@ -36,7 +36,7 @@
/**
* Integration tests for {@link RtLogs}.
* @author Mihai Andronache (amihaiemil@gmail.com)
* @version $Id#
* @version $Id$
* @since 0.0.7
* @todo #256:30min Fix the IT case for follow(), it is currently failing.
* We might have to implement the stream decoding (in case TTY is disabled
Expand All @@ -56,13 +56,9 @@ public void fetchesLogs() throws Exception {
new File("/var/run/docker.sock")
).images().pull("hello-world", "latest").run();
final String logs = container.logs().fetch();
MatcherAssert.assertThat(
logs,
Matchers.not(Matchers.isEmptyOrNullString())
);
MatcherAssert.assertThat(
logs.trim(),
Matchers.startsWith("Hello from Docker!")
new StringStartsWith("Hello from Docker!")
);
}

Expand All @@ -77,13 +73,9 @@ public void followsLogs() throws Exception {
new File("/var/run/docker.sock")
).images().pull("hello-world", "latest").run();
final String logs = IOUtils.toString(container.logs().follow());
MatcherAssert.assertThat(
logs,
Matchers.not(Matchers.isEmptyOrNullString())
);
MatcherAssert.assertThat(
logs.trim(),
Matchers.startsWith("Hello from Docker!")
new StringStartsWith("Hello from Docker!")
);
}
}

0 comments on commit 9800edb

Please sign in to comment.