diff --git a/src/test/java/org/opensearch/security/transport/SecuritySSLRequestHandlerTests.java b/src/test/java/org/opensearch/security/transport/SecuritySSLRequestHandlerTests.java index 2c160dfe31..23a64e4be3 100644 --- a/src/test/java/org/opensearch/security/transport/SecuritySSLRequestHandlerTests.java +++ b/src/test/java/org/opensearch/security/transport/SecuritySSLRequestHandlerTests.java @@ -66,17 +66,12 @@ public void testUseJDKSerializationHeaderIsSetOnMessageReceived() throws Excepti TransportChannel transportChannel = mock(TransportChannel.class); Task task = mock(Task.class); doNothing().when(transportChannel).sendResponse(ArgumentMatchers.any(Exception.class)); - when(transportChannel.getVersion()).thenReturn(Version.V_2_10_0); + when(transportChannel.getVersion()).thenReturn(Version.V_2_11_0); when(transportChannel.getChannelType()).thenReturn("transport"); Assert.assertThrows(Exception.class, () -> securitySSLRequestHandler.messageReceived(transportRequest, transportChannel, task)); Assert.assertTrue(threadPool.getThreadContext().getTransient(ConfigConstants.USE_JDK_SERIALIZATION)); - threadPool.getThreadContext().stashContext(); - when(transportChannel.getVersion()).thenReturn(Version.V_2_11_0); - Assert.assertThrows(Exception.class, () -> securitySSLRequestHandler.messageReceived(transportRequest, transportChannel, task)); - Assert.assertFalse(threadPool.getThreadContext().getTransient(ConfigConstants.USE_JDK_SERIALIZATION)); - threadPool.getThreadContext().stashContext(); when(transportChannel.getVersion()).thenReturn(Version.V_3_0_0); Assert.assertThrows(Exception.class, () -> securitySSLRequestHandler.messageReceived(transportRequest, transportChannel, task));