WebSocketEndpoint extends AbstractEndpoint { @Override public SelectiveConsumer createConsumer() { if (wsConsumer == null) { wsConsumer = new WebSocketConsumer(getConsumerName(), getEndpointConfiguration()); } return wsConsumer; } WebSocketEndpoint(WebSocketEndpointConfiguration endpointConfiguration); @Override SelectiveConsumer createConsumer(); @Override Producer createProducer(); @Override WebSocketEndpointConfiguration getEndpointConfiguration(); void setWebSocketHandler(CitrusWebSocketHandler handler);  }
@Test public void testWebSocketEndpointTimeout() throws Exception { WebSocketServerEndpointConfiguration endpointConfiguration = new WebSocketServerEndpointConfiguration(); WebSocketEndpoint webSocketEndpoint = new WebSocketEndpoint(endpointConfiguration); String endpointUri = "/test"; CitrusWebSocketHandler handler = new CitrusWebSocketHandler(); endpointConfiguration.setHandler(handler); endpointConfiguration.setEndpointUri(endpointUri); endpointConfiguration.setTimeout(1000L); reset(session); when(session.getId()).thenReturn("test-socket-1"); handler.afterConnectionEstablished(session); try { webSocketEndpoint.createConsumer().receive(context, endpointConfiguration.getTimeout()); Assert.fail("Missing timeout exception on web socket endpoint"); } catch (ActionTimeoutException e) { Assert.assertTrue(e.getMessage().contains(endpointUri)); } }