EventBusChecker { public static Future<Void> check(Vertx vertx, ClusterManager clusterManager) { String thisNode; List<String> nodes; if (clusterManager == null) { thisNode = "localhost"; nodes = new LinkedList<>(); nodes.add(thisNode); } else { thisNode = clusterManager.getNodeId(); nodes = clusterManager.getNodes(); } return check(vertx, thisNode, thisNode, nodes); }  static Future<Void> check(Vertx vertx, ClusterManager clusterManager);  }
@Test public void testBadNode(TestContext context) { Async async = context.async(); List<String> list = new LinkedList<>(); list.add("a"); list.add("b"); EventBusChecker.check(vertx, "a", "a", list) .onComplete(context.asyncAssertFailure(cause -> async.complete())); async.await(); }
@Test public void testBadReply(TestContext context) { Async async = context.async(); List<String> list = new LinkedList<>(); list.add("a"); EventBusChecker.check(vertx, "a", "r", list) .onComplete(context.asyncAssertFailure(cause -> async.complete())); async.await(); }
@Test public void testGoodNode(TestContext context) { Async async = context.async(); List<String> list = new LinkedList<>(); list.add("a"); EventBusChecker.check(vertx, "a", "a", list) .onComplete(context.asyncAssertSuccess(res -> async.complete())); async.await(); }