OcelotRequestConfigurator extends ServerEndpointConfig.Configurator { @Override public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) { sec.getUserProperties().put(Constants.HANDSHAKEREQUEST, request); super.modifyHandshake(sec, request, response); }  @Override void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response);  }
@Test public void testModifyHandshake() { System.out.println("testModifyHandshake"); ServerEndpointConfig sec = mock(ServerEndpointConfig.class); Map<String, Object> userProperties = new HashMap<>(); HandshakeRequest request = mock(HandshakeRequest.class); HandshakeResponse response = mock(HandshakeResponse.class); when(sec.getUserProperties()).thenReturn(userProperties); instance.modifyHandshake(sec, request, response); assertThat(userProperties.get(Constants.HANDSHAKEREQUEST)).isEqualTo(request); }