Skip to content

Commit 7d7f17a

Browse files
committed
#344 Integration test for docker.info()
1 parent 9a81ed1 commit 7d7f17a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/test/java/com/amihaiemil/docker/UnixDockerITCase.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,24 @@ public void pingsDocker() throws Exception {
6262
MatcherAssert.assertThat(docker.ping(), Matchers.is(Boolean.TRUE));
6363
}
6464

65+
/**
66+
* UnixDocker can return Info about Docker.
67+
* @throws Exception If something goes wrong.
68+
*/
69+
@Test
70+
public void returnsInfo() throws Exception {
71+
final Docker docker = new UnixDocker(
72+
new File("/var/run/docker.sock")
73+
);
74+
final Info info = docker.info();
75+
MatcherAssert.assertThat(info, Matchers.notNullValue());
76+
MatcherAssert.assertThat(info.docker(), Matchers.is(docker));
77+
MatcherAssert.assertThat(
78+
info.getString("OSType"),
79+
Matchers.equalTo("linux")
80+
);
81+
}
82+
6583
/**
6684
* Docker can return its Events unfiltered.
6785
* @throws Exception If something goes wrong.

0 commit comments

Comments
 (0)