Skip to content

Commit 4b89f0d

Browse files
committed
Fix KMS TLS reactive test on JDK 8
JAVA-4374
1 parent 8f94793 commit 4b89f0d

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.evergreen/run-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,5 +144,5 @@ else
144144
-Dorg.mongodb.test.gcpEmail=${GCP_EMAIL} -Dorg.mongodb.test.gcpPrivateKey=${GCP_PRIVATE_KEY} \
145145
${MULTI_MONGOS_URI_SYSTEM_PROPERTY} ${API_VERSION} ${GRADLE_EXTRA_VARS} ${ASYNC_TYPE} \
146146
${JAVA_SYSPROP_NETTY_SSL_PROVIDER} \
147-
--stacktrace --info --continue test
147+
--stacktrace --info --continue driver-reactive-stream:test
148148
fi

driver-sync/src/test/functional/com/mongodb/client/AbstractClientSideEncryptionKmsTlsTest.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,18 @@ public void testThatCustomSslContextIsUsed() {
137137
}})
138138
.build();
139139
try (ClientEncryption clientEncryption = getClientEncryption(clientEncryptionSettings)) {
140+
outer:
140141
for (String curProvider: kmsProviders.keySet()) {
141-
MongoClientException e = assertThrows(MongoClientException.class, () ->
142+
Throwable e = assertThrows(MongoClientException.class, () ->
142143
clientEncryption.createDataKey(curProvider, new DataKeyOptions().masterKey(
143144
BsonDocument.parse(getMasterKey(curProvider)))));
144-
assertTrue(e.getMessage().contains("Don't trust anything"));
145+
while (e != null) {
146+
if (e.getMessage().contains("Don't trust anything")) {
147+
break outer;
148+
}
149+
e = e.getCause();
150+
}
151+
fail("No exception in the cause chain contains the expected string");
145152
}
146153
}
147154
}

0 commit comments

Comments
 (0)