From feeb3ee9208ee1556713577ec25a1020723d1a11 Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Thu, 4 Jun 2020 18:29:36 +0200 Subject: [PATCH] Update test to directly check for SslHandshakeTimeoutException (#10339) Motivation: 9b7e091 added a special SSLHandshakeException sub-class to signal handshake timeouts but we missed to update a testcase to directly assert the type of the exception. Modifications: Assert directly that SslHandshakeTimeoutException is used Result: Test cleanup --- .../src/test/java/io/netty/handler/ssl/SslHandlerTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/handler/src/test/java/io/netty/handler/ssl/SslHandlerTest.java b/handler/src/test/java/io/netty/handler/ssl/SslHandlerTest.java index 3d9e9ffd53..d339741f6e 100644 --- a/handler/src/test/java/io/netty/handler/ssl/SslHandlerTest.java +++ b/handler/src/test/java/io/netty/handler/ssl/SslHandlerTest.java @@ -1069,13 +1069,11 @@ public class SslHandlerTest { if (client) { Throwable cause = clientSslHandler.handshakeFuture().await().cause(); - assertThat(cause, CoreMatchers.instanceOf(SSLException.class)); - assertThat(cause.getMessage(), containsString("timed out")); + assertThat(cause, CoreMatchers.instanceOf(SslHandshakeTimeoutException.class)); assertFalse(serverSslHandler.handshakeFuture().await().isSuccess()); } else { Throwable cause = serverSslHandler.handshakeFuture().await().cause(); - assertThat(cause, CoreMatchers.instanceOf(SSLException.class)); - assertThat(cause.getMessage(), containsString("timed out")); + assertThat(cause, CoreMatchers.instanceOf(SslHandshakeTimeoutException.class)); assertFalse(clientSslHandler.handshakeFuture().await().isSuccess()); } } finally {