public void testQuorumWithHaGroups() throws Exception {
Vertx vertx1 = startVertx("group1", 2);
Vertx vertx2 = startVertx("group2", 2);
vertx1.deployVerticle("java:" + HAVerticle1.class.getName(), new DeploymentOptions().setHa(true), ar -> {
assertTrue(ar.succeeded());
assertTrue(vertx1.deployments().contains(ar.result()));
});
// Wait a little while
Thread.sleep(500);
//Should not be deployed yet
assertTrue(vertx1.deployments().isEmpty());
Vertx vertx3 = startVertx("group1", 2);
// Now should deploy
waitUntil(() -> vertx1.deployments().size() == 1);
vertx2.deployVerticle("java:" + HAVerticle1.class.getName(), new DeploymentOptions().setHa(true), ar -> {
assertTrue(ar.succeeded());
assertTrue(vertx2.deployments().contains(ar.result()));
});
// Wait a little while