1. @Test
    2. public void start_http_server(TestContext context) {
    3. Async async = context.async();
    4. vertx.createHttpServer().requestHandler(req ->
    5. req.response().putHeader("Content-Type", "text/plain").end("Ok"))
    6. WebClient webClient = WebClient.create(vertx);
    7. webClient.get(8080, "localhost", "/").send(ar -> {
    8. if (ar.succeeded()) {
    9. HttpResponse<Buffer> response = ar.result();
    10. context.assertTrue(response.headers().contains("Content-Type"));
    11. context.assertEquals("text/plain", response.getHeader("Content-Type"));
    12. webClient.close();
    13. async.complete();
    14. } else {
    15. async.resolve(Promise.failedPromise(ar.cause()));
    16. }
    17. });
    18. }));