@Test
public void receives_START_event_through_web_socket_when_connecting_to_events_endpoint() throws Exception {

  URI wsEvents = new URI("ws://" + uri.getHost() + ":" + uri.getPort() + "/events");
  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);
}