GuiceVertxDeploymentManager { public void deployVerticle(final Class verticleClazz) { Preconditions.checkNotNull(verticleClazz); deployVerticle(verticleClazz, new DeploymentOptions()); } GuiceVertxDeploymentManager(final Vertx vertx); void deployVerticle(final Class verticleClazz); void deployVerticle(final Class verticleClazz, final DeploymentOptions options); void deployVerticle( final Class verticleClazz, Handler<AsyncResult<String>> completionHandler); void deployVerticle( final Class verticleClazz, final DeploymentOptions options, Handler<AsyncResult<String>> completionHandler);  }
@Test public void testDeployVerticle() throws Exception { GuiceVertxDeploymentManager deploymentManager = new GuiceVertxDeploymentManager(this.vertx); deploymentManager.deployVerticle(VerticleWithVertxDependency.class); waitUntil(() -> VerticleWithVertxDependency.instanceCount.get() == 1); org.assertj.core.api.Assertions.assertThat( VerticleWithVertxDependency.instanceCount.get()).isGreaterThan(0); }
@Test public void testDeployVerticleWithOptions() throws Exception { GuiceVertxDeploymentManager deploymentManager = new GuiceVertxDeploymentManager(this.vertx); deploymentManager.deployVerticle( VerticleWithVertxDependency.class, new DeploymentOptions().setWorker(true)); waitUntil(() -> VerticleWithVertxDependency.instanceCount.get() == 1); org.assertj.core.api.Assertions.assertThat( VerticleWithVertxDependency.instanceCount.get()).isGreaterThan(0); }
@Test public void testDeployVerticleWithCompletionHandler() throws Exception { ObservableFuture<String> deplymentResult = RxHelper.observableFuture(); GuiceVertxDeploymentManager deploymentManager = new GuiceVertxDeploymentManager(this.vertx); deploymentManager.deployVerticle( VerticleWithVertxDependency.class, deplymentResult.toHandler()); String deploymentId = deplymentResult.toBlocking().single(); org.assertj.core.api.Assertions.assertThat(deploymentId).isNotEmpty(); }
@Test public void testDeployVerticleWithOptionsAndCompletionHandler() throws Exception { ObservableFuture<String> deplymentResult = RxHelper.observableFuture(); GuiceVertxDeploymentManager deploymentManager = new GuiceVertxDeploymentManager(this.vertx); deploymentManager.deployVerticle( VerticleWithVertxDependency.class, new DeploymentOptions(), deplymentResult.toHandler()); String deploymentId = deplymentResult.toBlocking().single(); org.assertj.core.api.Assertions.assertThat(deploymentId).isNotEmpty(); }