File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
src/test/java/com/github/dockerjava Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 88import java .lang .reflect .Method ;
99import java .security .SecureRandom ;
1010
11+ import com .github .dockerjava .api .command .InspectContainerCmd ;
1112import org .slf4j .Logger ;
1213import org .slf4j .LoggerFactory ;
1314import org .testng .ITestResult ;
@@ -73,11 +74,12 @@ public void inspectContainerWithSize() throws DockerException {
7374 LOG .info ("Created container {}" , container .toString ());
7475 assertThat (container .getId (), not (isEmptyString ()));
7576
76- InspectContainerResponse containerInfo = dockerClient .inspectContainerCmd (container .getId ())
77- .withSize (true )
78- .exec ();
79- assertNotNull (containerInfo .getSizeRootFs ());
77+ InspectContainerCmd command = dockerClient .inspectContainerCmd (container .getId ()).withSize (true );
78+ assertTrue (command .getSize ());
79+ InspectContainerResponse containerInfo = command .exec ();
8080 assertEquals (containerInfo .getId (), container .getId ());
81+ assertNotNull (containerInfo .getSizeRootFs ());
82+ assertTrue (containerInfo .getSizeRootFs ().intValue () > 0 );
8183 }
8284
8385 @ Test (expectedExceptions = NotFoundException .class )
Original file line number Diff line number Diff line change 88import java .lang .reflect .Method ;
99import java .security .SecureRandom ;
1010
11+ import com .github .dockerjava .api .command .InspectContainerCmd ;
1112import org .slf4j .Logger ;
1213import org .slf4j .LoggerFactory ;
1314import org .testng .ITestResult ;
@@ -73,9 +74,13 @@ public void inspectContainerWithSize() throws DockerException {
7374 LOG .info ("Created container {}" , container .toString ());
7475 assertThat (container .getId (), not (isEmptyString ()));
7576
76- InspectContainerResponse containerInfo = dockerClient .inspectContainerCmd (container .getId ()).exec ();
77+ InspectContainerCmd command = dockerClient .inspectContainerCmd (container .getId ())
78+ .withSize (true );
79+ assertTrue (command .getSize ());
80+ InspectContainerResponse containerInfo = command .exec ();
7781 assertEquals (containerInfo .getId (), container .getId ());
7882 assertNotNull (containerInfo .getSizeRootFs ());
83+ assertTrue (containerInfo .getSizeRootFs ().intValue () > 0 );
7984 }
8085
8186 @ Test (expectedExceptions = NotFoundException .class )
You can’t perform that action at this time.
0 commit comments