ComputeRealtimeServerFactory { public ComputeRealtimeServer createComputeRealtimeServer() { Server server = new Server(config.computeConfig.rtComputePort); ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS); context.setContextPath("/"); ServletHolder jerseyServlet = context.addServlet(ServletContainer.class, "/*"); jerseyServlet.setInitParameter(PackagesResourceConfig.PROPERTY_PACKAGES, StatusResource.class.getPackage().toString()); server.setHandler(context); ServerContainer wscontainer; try { wscontainer = WebSocketServerContainerInitializer.configureContext(context); wscontainer.addEndpoint(RealtimeResource.class); } catch (ServletException | DeploymentException e) { throw new RuntimeException("Can't instantiate websocket. Reason: " + e.getMessage()); } return new ComputeRealtimeServer(server); } ComputeRealtimeServerFactory(ChatAlyticsConfig config); ComputeRealtimeServer createComputeRealtimeServer();  }
@Test public void testCreateComputeRealtimeServer() { ComputeRealtimeServer server = underTest.createComputeRealtimeServer(); assertNotNull(server); server.startAsync().awaitRunning(); server.stopAsync().awaitTerminated(); }