Skip to content

Commit 2fb75e9

Browse files
committed
Tweaked CheckSSLConnectionTest
Oddly, the exact cause of the SSLException differs in some of the Jenkins environments. Verifying that an SSLException is received should suffice.
1 parent 4034e0e commit 2fb75e9

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

marklogic-client-api/src/test/java/com/marklogic/client/test/CheckSSLConnectionTest.java

+2-6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import org.junit.jupiter.api.extension.ExtendWith;
1010

1111
import javax.net.ssl.SSLContext;
12+
import javax.net.ssl.SSLException;
1213
import javax.net.ssl.SSLHandshakeException;
1314
import javax.net.ssl.TrustManager;
1415

@@ -64,12 +65,7 @@ void defaultSslContext() throws Exception {
6465
MarkLogicIOException ex = assertThrows(MarkLogicIOException.class, () -> client.checkConnection(),
6566
"The connection should fail because the JVM's default SSL Context does not have a CA certificate that " +
6667
"corresponds to the test-only certificate that the app server is using for this test");
67-
68-
assertTrue(ex.getCause() instanceof SSLHandshakeException, "Unexpected cause: " + ex.getCause());
69-
String message = ex.getCause().getMessage();
70-
assertTrue(message.contains("PKIX path building failed"), "The call should have failed because the JVM's " +
71-
"default SSL context does not have a CA certificate for the app server's certificate; " +
72-
"unexpected error: " + message);
68+
assertTrue(ex.getCause() instanceof SSLException, "Unexpected cause: " + ex.getCause());
7369
}
7470

7571
@Test

0 commit comments

Comments
 (0)