Skip to content

Commit 1ff4614

Browse files
committed
trim whitespace before parsing (int) result code from docker image list
1 parent 444cf87 commit 1ff4614

File tree

1 file changed

+4
-2
lines changed
  • imagetool/src/test/java/com/oracle/weblogic/imagetool/integration

1 file changed

+4
-2
lines changed

imagetool/src/test/java/com/oracle/weblogic/imagetool/integration/BaseTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,10 @@ private static void pullDockerImage(String repoServer, String username, String p
264264
// verify the docker image is pulled
265265
ExecResult result = ExecCommand.exec("docker images | grep " + imagename + " | grep " +
266266
imagetag + "| wc -l");
267-
if(Integer.parseInt(result.stdout()) != 1) {
268-
throw new Exception("docker image " + imagename + ":" + imagetag + " is not pulled as expected");
267+
String resultString = result.stdout();
268+
if(Integer.parseInt(resultString.trim()) != 1) {
269+
throw new Exception("docker image " + imagename + ":" + imagetag + " is not pulled as expected."
270+
+ " Expected 1 image, found " + resultString);
269271
}
270272
}
271273

0 commit comments

Comments
 (0)