checkDeploymentExists(1, "java:" + HAVerticle1.class.getName(), options);
}
@Test
public void testQuorum() throws Exception {
Vertx vertx1 = startVertx(2);
DeploymentOptions options = new DeploymentOptions().setHa(true);
JsonObject config = new JsonObject().put("foo", "bar");
options.setConfig(config);
vertx1.deployVerticle("java:" + HAVerticle1.class.getName(), options, ar -> {
assertTrue(ar.succeeded());
assertTrue(vertx1.deployments().contains(ar.result()));
testComplete();
});
// Shouldn't deploy until a quorum is obtained
Thread.sleep(500);
assertTrue(vertx1.deployments().isEmpty());
Vertx vertx2 = startVertx(2);
// Now should be deployed
await();
closeVertices(vertx1, vertx2);
}