deployLatch.countDown();
}));
awaitLatch(deployLatch);
waitUntil(() -> deployCount.get() == numInstances);
assertEquals(1, vertx.deployments().size());
Deployment deployment = ((VertxInternal) vertx).getDeployment(vertx.deployments().iterator().next());
Set<Verticle> verticles = deployment.getVerticles();
assertEquals(numInstances, verticles.size());
CountDownLatch undeployLatch = new CountDownLatch(1);
assertEquals(numInstances, deployCount.get());
vertx.undeployVerticle(deployment.deploymentID(), onSuccess(v -> {
assertEquals(1, undeployHandlerCount.incrementAndGet());
undeployLatch.countDown();
}));
awaitLatch(undeployLatch);
waitUntil(() -> deployCount.get() == numInstances);