suman
suman copied to clipboard
using java junit style async cb
@Test
public void testThatTheServerIsStarted(TestContext tc) {
Async async = tc.async();
vertx.createHttpClient().getNow(8080, "localhost", "/", response -> {
tc.assertEquals(response.statusCode(), 200);
response.bodyHandler(body -> {
tc.assertTrue(body.length() > 0);
async.complete();
});
});
}