### Question:
DefaultWhenVertx implements WhenVertx { @Override public Promise<Void> undeploy(String deploymentID) { return adapter.toPromise(handler -> vertx.undeploy(deploymentID, handler)); } @Inject  DefaultWhenVertx(Vertx vertx, PromiseAdapter adapter);  DefaultWhenVertx(Vertx vertx, When when); @Override Promise<String> deployVerticle(Verticle verticle); @Override Promise<String> deployVerticle(Verticle verticle, DeploymentOptions options); @Override Promise<String> deployVerticle(String name); @Override Promise<String> deployVerticle(String name, DeploymentOptions options); @Override Promise<Void> undeploy(String deploymentID); @Override Promise<T> executeBlocking(Handler<Future<T>> blockingCodeHandler, boolean ordered);  }### Answer:
@Test public void testUndeploy() throws Exception { String deploymentID = "id"; Done<Void> done = new Done<>(); when(voidResult.succeeded()).thenReturn(true); whenVertx.undeploy(deploymentID).then(done.onFulfilled, done.onRejected); verify(vertx).undeploy(eq(deploymentID), voidHandlerCaptor.capture()); voidHandlerCaptor.getValue().handle(voidResult); done.assertFulfilled(); }
@Test public void testUndeploy_Fail() throws Exception { String deploymentID = "id"; Done<Void> done = new Done<>(); whenVertx.undeploy(deploymentID).then(done.onFulfilled, done.onRejected); verify(vertx).undeploy(eq(deploymentID), voidHandlerCaptor.capture()); voidHandlerCaptor.getValue().handle(voidResult); done.assertRejected(); }