title: How to write Junit test case for start method of consumer Verticle in vert.x?
body: <p>I have implemented one Verticle as mentioned below. Verticle is working as expected. Now I am trying to write Junit test case for this Verticle which could test the start method, the handler method handleRequest(), and the method getSomeData() inside handler which returns Future. Either single test case to test all three method or individual test case to test individual method should be fine. 
  I know writing Junit test cases for synchronous code but have no idea how exactly to write Junit TCs for Verticle in vert.x which is asynchronous. Could anyone please guide me here? I also have router verticle from which I am sending message to this consumer verticle MyVerticle but I am thinking to write Jnuit test cases for this consumer verticle first. Please help.</p>
  
  <pre><code>@Component
  public class MyVerticle extends AbstractVerticle{
  
  @Override
  public void start() throws Exception {
      super.start();
      vertx.eventBus().&lt;String&gt;consumer("address.xyz").handler(handleRequest());
  }
  
  private Handler&lt;Message&lt;String&gt;&gt; handleRequest() {
      return msg -&gt; {
          getSomeData(msg.body().toString())
          .setHandler(ar -&gt; {
              if(ar.succeeded()){
                  msg.reply(ar.result());
              }else{
                  msg.reply(ar.cause().getMessage());
              }
           });
      };
  }
  
  private Future&lt;String&gt; getSomeData(String inputJson) {
      Promise&lt;String&gt; promise = Promise.promise();
      promise.complete("Returning Data");
      return promise.future();    
   }
  </code></pre>
  
  <p>}</p>