### Question:
DefaultWhenVertx implements WhenVertx { @Override public <T> Promise<T> executeBlocking(Handler<Future<T>> blockingCodeHandler, boolean ordered) { return adapter.toPromise(handler -> vertx.executeBlocking(blockingCodeHandler, ordered, 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 testExecuteBlocking() throws Exception { whenVertx.executeBlocking(futureHandler).then(done.onFulfilled, done.onRejected); verify(vertx).<String>executeBlocking(any(), anyBoolean(), stringHandlerCaptor.capture()); assertFalse(done.fulfilled()); stringHandlerCaptor.getValue().handle(Future.succeededFuture()); done.assertFulfilled(); }
@Test public void testExecuteBlocking_Fail() throws Exception { whenVertx.executeBlocking(futureHandler).then(done.onFulfilled, done.onRejected); verify(vertx).<String>executeBlocking(any(), anyBoolean(), stringHandlerCaptor.capture()); assertFalse(done.fulfilled()); stringHandlerCaptor.getValue().handle(Future.failedFuture("")); done.assertRejected(); }