'vertx unit test never execute request

I want to create a vertx unit test. This test just create a consumer and execute a request.

EventBus eventBus = this.vertx.eventBus();
final TestSuite processTestSuite = TestSuite.create("Use Case Verticle Test Suite");
processTestSuite
    .before(context -> {
         Async async = context.async(2);
         this.vertx.eventBus().<String>consumer("WORLD", event -> {
              event.reply("Hallo Welt");
         }).completionHandler(dEvent -> {
              context.assertTrue(dEvent.succeeded());
              async.countDown(); // <-- code reached
              this.vertx.eventBus().<String>request("WORLD", new JsonObject(), event2 -> {
                   context.assertTrue(event2.succeeded()); // <-- this code never reached
                   context.assertEquals(event2.result().body(), "Hallo Welt");
                        async.countDown();
                    });
              });
        });

TestOptions options = new TestOptions();
options.addReporter(new ReportOptions().setTo("console"));

TestCompletion completion = processTestSuite.run(vertx, options);

completion.handler(event -> {
    if (event.succeeded()) {
        System.out.println("PROCESS TEST DONE!");
    } else {
        event.cause().printStackTrace();
    }
});
completion.awaitSuccess();

Why the the request never execute?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source