Skip to content

Commit eaf1ae3

Browse files
authored
Assert the exit code non zero result (#2355)
1 parent 786a8ab commit eaf1ae3

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIntrospectVersion.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,11 @@
122122
import static oracle.weblogic.kubernetes.utils.WLSTUtils.executeWLSTScript;
123123
import static org.assertj.core.api.Assertions.assertThat;
124124
import static org.awaitility.Awaitility.with;
125-
import static org.junit.jupiter.api.Assertions.assertAll;
126125
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
127126
import static org.junit.jupiter.api.Assertions.assertEquals;
128127
import static org.junit.jupiter.api.Assertions.assertNotEquals;
129128
import static org.junit.jupiter.api.Assertions.assertNotNull;
130129
import static org.junit.jupiter.api.Assertions.assertTrue;
131-
import static org.junit.jupiter.api.Assertions.fail;
132130

133131
/**
134132
* Tests related to introspectVersion attribute.
@@ -572,14 +570,8 @@ public void testDomainIntrospectVersionRolling() {
572570

573571
ExecResult execResult = assertDoesNotThrow(() -> execCommand(introDomainNamespace, adminServerPodName, null, true,
574572
"/bin/sh", "-c", curlCmd));
575-
if (execResult.exitValue() == 0) {
576-
logger.info("\n HTTP response is \n " + execResult.toString());
577-
assertAll("Check that the HTTP response is 200",
578-
() -> assertTrue(execResult.toString().contains("HTTP/1.1 200 OK"))
579-
);
580-
} else {
581-
fail("Failed to change admin port number " + execResult.stderr());
582-
}
573+
assertTrue(execResult.exitValue() == 0 || execResult.stderr() == null || execResult.stderr().isEmpty(),
574+
"Failed to change admin port number");
583575

584576
patchDomainResourceWithNewIntrospectVersion(domainUid, introDomainNamespace);
585577

0 commit comments

Comments
 (0)