Jsr356WebSockets implements WebSockets { @Override public void compileRoute(Route route) { log.debug("Adding websocket to {} with endpoint {} in server container {}", route.getUri(), route.getControllerClass(), serverContainer.getClass().getCanonicalName()); Class<?> endpointClass = route.getControllerClass(); if (!Endpoint.class.isAssignableFrom(endpointClass)) { throw new IllegalArgumentException("WebSocket controller class must be of type " + Endpoint.class.getCanonicalName()); } try { serverContainer.addEndpoint(new Jsr356ServerEndpointConfig(route)); } catch (DeploymentException e) { throw new RuntimeException(e); } } @Inject  Jsr356WebSockets(ServerContainer serverContainer); ServerContainer getServerContainer(); @Override boolean isEnabled(); @Override void compileRoute(Route route);  }
@Test public void compileRoute() throws DeploymentException { assertThat(webSockets.isEnabled(), is(true)); doReturn(Endpoint.class).when(route).getControllerClass(); webSockets.compileRoute(route); verify(serverContainer).addEndpoint((ServerEndpointConfig)any()); }