Skip to content

Commit

Permalink
fix AbstractSSLContextTest for JDK >= 11.0.12
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
  • Loading branch information
thjaeckle committed Jul 21, 2021
1 parent f4f3096 commit ef21674
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.util.concurrent.CompletableFuture;

import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLException;
import javax.net.ssl.SSLHandshakeException;
import javax.net.ssl.SSLServerSocket;

Expand Down Expand Up @@ -205,7 +204,10 @@ public void distrustSelfSignedClient() throws Exception {
.getSocketFactory()
.createSocket(serverSocket.getInetAddress(), serverSocket.getLocalPort())) {

assertThatExceptionOfType(SSLException.class).isThrownBy(() -> underTest.getOutputStream().write(234));
// for JDK 11 < 11.0.12, an SSLException is expected:
// for JDK 11 >= 11.0.12, an SocketException is expected:
// both are IOExceptions:
assertThatExceptionOfType(IOException.class).isThrownBy(() -> underTest.getOutputStream().write(234));
}
}

Expand Down

0 comments on commit ef21674

Please sign in to comment.