diff --git a/vertx/src/main/java/com/baeldung/SimpleServerVerticle.java b/vertx/src/main/java/com/baeldung/SimpleServerVerticle.java index 6b56896860..96aa058ce7 100644 --- a/vertx/src/main/java/com/baeldung/SimpleServerVerticle.java +++ b/vertx/src/main/java/com/baeldung/SimpleServerVerticle.java @@ -8,10 +8,8 @@ public class SimpleServerVerticle extends AbstractVerticle { @Override public void start(Future future) { vertx.createHttpServer() - .requestHandler(request -> { - request.response() - .end("Welcome to Vert.x Intro"); - }) + .requestHandler( + r -> r.response().end("Welcome to Vert.x Intro")) .listen(config().getInteger("http.port", 8080), result -> { if (result.succeeded()) { future.complete(); diff --git a/vertx/src/test/java/com/baeldung/RestServiceVerticleTest.java b/vertx/src/test/java/com/baeldung/RestServiceVerticleIntegrationTest.java similarity index 96% rename from vertx/src/test/java/com/baeldung/RestServiceVerticleTest.java rename to vertx/src/test/java/com/baeldung/RestServiceVerticleIntegrationTest.java index b5be0734f4..f08d9ffde1 100644 --- a/vertx/src/test/java/com/baeldung/RestServiceVerticleTest.java +++ b/vertx/src/test/java/com/baeldung/RestServiceVerticleIntegrationTest.java @@ -13,7 +13,7 @@ import io.vertx.ext.unit.TestContext; import io.vertx.ext.unit.junit.VertxUnitRunner; @RunWith(VertxUnitRunner.class) -public class RestServiceVerticleTest { +public class RestServiceVerticleIntegrationTest { private Vertx vertx; diff --git a/vertx/src/test/java/com/baeldung/SimpleServerVerticleTest.java b/vertx/src/test/java/com/baeldung/SimpleServerVerticleIntegrationTest.java similarity index 58% rename from vertx/src/test/java/com/baeldung/SimpleServerVerticleTest.java rename to vertx/src/test/java/com/baeldung/SimpleServerVerticleIntegrationTest.java index 189d2f6604..194f403e25 100644 --- a/vertx/src/test/java/com/baeldung/SimpleServerVerticleTest.java +++ b/vertx/src/test/java/com/baeldung/SimpleServerVerticleIntegrationTest.java @@ -1,27 +1,23 @@ package com.baeldung; +import io.vertx.core.Vertx; +import io.vertx.ext.unit.Async; +import io.vertx.ext.unit.TestContext; +import io.vertx.ext.unit.junit.VertxUnitRunner; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import io.vertx.core.DeploymentOptions; -import io.vertx.core.Vertx; -import io.vertx.core.json.JsonObject; -import io.vertx.ext.unit.Async; -import io.vertx.ext.unit.TestContext; -import io.vertx.ext.unit.junit.VertxUnitRunner; - @RunWith(VertxUnitRunner.class) -public class SimpleServerVerticleTest { +public class SimpleServerVerticleIntegrationTest { private Vertx vertx; @Before public void setup(TestContext testContext) { vertx = Vertx.vertx(); - vertx.deployVerticle(SimpleServerVerticle.class.getName(), - testContext.asyncAssertSuccess()); + vertx.deployVerticle(SimpleServerVerticle.class.getName(), testContext.asyncAssertSuccess()); } @After @@ -33,14 +29,15 @@ public class SimpleServerVerticleTest { public void whenReceivedResponse_thenSuccess(TestContext testContext) { final Async async = testContext.async(); - vertx.createHttpClient() - .getNow(8080, "localhost", "/", response -> { - response.handler(responseBody -> { - testContext.assertTrue(responseBody.toString() - .contains("Welcome")); - async.complete(); - }); - }); + vertx + .createHttpClient() + .getNow(8080, "localhost", "/", + response -> response.handler(responseBody -> { + testContext.assertTrue(responseBody + .toString() + .contains("Welcome")); + async.complete(); + })); } }