RaftJettyServer implements RaftServer<RaftJettyServer> { public URI getPort() { return server.getURI(); } RaftJettyServer(int serverIndex, URI[] uris, File logDir); static void main(String[] args); RaftJettyServer start(int port); void stop(); URI getPort(); @Override void clean();  }
@Test public void receives_START_event_through_web_socket_when_connecting_to_events_endpoint() throws Exception { URI wsEvents = new URI("ws: final Queue<String> messages = new LinkedBlockingQueue<>(); final EventClientSocket socket = new EventClientSocket(messages); ClientUpgradeRequest request = new ClientUpgradeRequest(); wsClient.connect(socket, wsEvents, request); client.target(uri).path("/raft/init").request().post(Entity.json("")); new Prober(() -> socket.messages.stream().anyMatch(Predicates.contains(Pattern.compile(".*FOLLOWER.*"))::apply)).probe(10000); }