diff --git a/pom.xml b/pom.xml index e7bdb5743f..20994d0c86 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 com.baeldung parent-modules @@ -11,20 +12,20 @@ UTF-8 refs/heads/master - + 4.12 - 1.3 + 1.3 1.10.19 1.7.21 1.1.7 - 2.19.1 - 3.6.0 + 2.19.1 + 3.6.0 - vertx-spring + spring-vertx aws akka-streams algorithms @@ -71,7 +72,7 @@ immutables jackson - + vavr javax-servlets javaxval @@ -123,8 +124,8 @@ selenium-junit-testng solr spark-java - spring-5 - spring-5-mvc + spring-5 + spring-5-mvc spring-akka spring-amqp spring-all @@ -176,7 +177,7 @@ spring-rest-angular spring-rest-docs spring-rest - spring-rest-simple + spring-rest-simple spring-security-cache-control spring-security-client/spring-security-jsp-authentication spring-security-client/spring-security-jsp-authorize @@ -243,12 +244,12 @@ ch.qos.logback logback-core ${logback.version} - + org.slf4j jcl-over-slf4j ${org.slf4j.version} - + @@ -268,8 +269,8 @@ hamcrest-library ${org.hamcrest.version} test - - + + org.hamcrest hamcrest-all ${org.hamcrest.version} @@ -281,7 +282,7 @@ ${mockito.version} test - + @@ -296,7 +297,7 @@ org.apache.maven.plugins maven-surefire-plugin - ${maven-surefire-plugin.version} + ${maven-surefire-plugin.version} 3 true @@ -313,12 +314,12 @@ org.apache.maven.plugins maven-compiler-plugin - ${maven-compiler-plugin.version} + ${maven-compiler-plugin.version} 1.8 1.8 - + + + + + UTF-8 + UTF-8 + 1.8 + 3.4.1 + + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + + + + + io.vertx + vertx-core + ${vertx.version} + + + io.vertx + vertx-web + ${vertx.version} + + + + com.h2database + h2 + runtime + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + diff --git a/vertx-spring/src/main/java/com/baeldung/vertxspring/VertxSpringApplication.java b/spring-vertx/src/main/java/com/baeldung/vertxspring/VertxSpringApplication.java similarity index 100% rename from vertx-spring/src/main/java/com/baeldung/vertxspring/VertxSpringApplication.java rename to spring-vertx/src/main/java/com/baeldung/vertxspring/VertxSpringApplication.java diff --git a/vertx-spring/src/main/java/com/baeldung/vertxspring/entity/Article.java b/spring-vertx/src/main/java/com/baeldung/vertxspring/entity/Article.java similarity index 100% rename from vertx-spring/src/main/java/com/baeldung/vertxspring/entity/Article.java rename to spring-vertx/src/main/java/com/baeldung/vertxspring/entity/Article.java diff --git a/vertx-spring/src/main/java/com/baeldung/vertxspring/repository/ArticleRepository.java b/spring-vertx/src/main/java/com/baeldung/vertxspring/repository/ArticleRepository.java similarity index 100% rename from vertx-spring/src/main/java/com/baeldung/vertxspring/repository/ArticleRepository.java rename to spring-vertx/src/main/java/com/baeldung/vertxspring/repository/ArticleRepository.java diff --git a/vertx-spring/src/main/java/com/baeldung/vertxspring/service/ArticleService.java b/spring-vertx/src/main/java/com/baeldung/vertxspring/service/ArticleService.java similarity index 100% rename from vertx-spring/src/main/java/com/baeldung/vertxspring/service/ArticleService.java rename to spring-vertx/src/main/java/com/baeldung/vertxspring/service/ArticleService.java diff --git a/vertx-spring/src/main/java/com/baeldung/vertxspring/util/DbBootstrap.java b/spring-vertx/src/main/java/com/baeldung/vertxspring/util/DbBootstrap.java similarity index 81% rename from vertx-spring/src/main/java/com/baeldung/vertxspring/util/DbBootstrap.java rename to spring-vertx/src/main/java/com/baeldung/vertxspring/util/DbBootstrap.java index 4aedb2d0ed..63d1df6485 100644 --- a/vertx-spring/src/main/java/com/baeldung/vertxspring/util/DbBootstrap.java +++ b/spring-vertx/src/main/java/com/baeldung/vertxspring/util/DbBootstrap.java @@ -21,8 +21,8 @@ public class DbBootstrap implements CommandLineRunner { public void run(String... arg0) throws Exception { IntStream.range(0, 10) - .forEach(count -> this.articleRepository.save(new Article(new Random().nextLong(), UUID.randomUUID() - .toString()))); + .forEach(count -> this.articleRepository.save(new Article(new Random().nextLong(), UUID.randomUUID() + .toString()))); } } diff --git a/vertx-spring/src/main/java/com/baeldung/vertxspring/verticles/ServerVerticle.java b/spring-vertx/src/main/java/com/baeldung/vertxspring/verticles/ServerVerticle.java similarity index 91% rename from vertx-spring/src/main/java/com/baeldung/vertxspring/verticles/ServerVerticle.java rename to spring-vertx/src/main/java/com/baeldung/vertxspring/verticles/ServerVerticle.java index bfa6679f7d..aa2196b53d 100644 --- a/vertx-spring/src/main/java/com/baeldung/vertxspring/verticles/ServerVerticle.java +++ b/spring-vertx/src/main/java/com/baeldung/vertxspring/verticles/ServerVerticle.java @@ -11,13 +11,13 @@ public class ServerVerticle extends AbstractVerticle { private void getAllArticlesHandler(RoutingContext routingContext) { vertx.eventBus() - . send(ServiceVerticle.GET_ALL_ARTICLES, "", result -> { + .send(ServiceVerticle.GET_ALL_ARTICLES, "", result -> { if (result.succeeded()) { routingContext.response() .putHeader("content-type", "application/json") .setStatusCode(200) .end(result.result() - .body()); + .body()); } else { routingContext.response() .setStatusCode(500) diff --git a/vertx-spring/src/main/java/com/baeldung/vertxspring/verticles/ServiceVerticle.java b/spring-vertx/src/main/java/com/baeldung/vertxspring/verticles/ServiceVerticle.java similarity index 84% rename from vertx-spring/src/main/java/com/baeldung/vertxspring/verticles/ServiceVerticle.java rename to spring-vertx/src/main/java/com/baeldung/vertxspring/verticles/ServiceVerticle.java index b75ce30822..7c46d4200a 100644 --- a/vertx-spring/src/main/java/com/baeldung/vertxspring/verticles/ServiceVerticle.java +++ b/spring-vertx/src/main/java/com/baeldung/vertxspring/verticles/ServiceVerticle.java @@ -16,33 +16,32 @@ import io.vertx.core.json.Json; public class ServiceVerticle extends AbstractVerticle { public static final String GET_ALL_ARTICLES = "get.artilces.all"; - + private final ObjectMapper mapper = Json.mapper; @Autowired private ArticleService articleService; - private final ObjectMapper mapper = Json.mapper; @Override public void start() throws Exception { super.start(); vertx.eventBus() - . consumer(GET_ALL_ARTICLES) - .handler(getAllArticleService(articleService)); + .consumer(GET_ALL_ARTICLES) + .handler(getAllArticleService(articleService)); } private Handler> getAllArticleService(ArticleService service) { - return msg -> vertx. executeBlocking(future -> { + return msg -> vertx.executeBlocking(future -> { try { future.complete(mapper.writeValueAsString(service.getAllArticle())); } catch (JsonProcessingException e) { System.out.println("Failed to serialize result"); future.fail(e); } - } , result -> { + }, result -> { if (result.succeeded()) { msg.reply(result.result()); } else { msg.reply(result.cause() - .toString()); + .toString()); } }); } diff --git a/vertx-spring/src/main/resources/application.properties b/spring-vertx/src/main/resources/application.properties similarity index 100% rename from vertx-spring/src/main/resources/application.properties rename to spring-vertx/src/main/resources/application.properties diff --git a/vertx-spring/src/main/resources/conf/conf.json b/spring-vertx/src/main/resources/conf/conf.json similarity index 100% rename from vertx-spring/src/main/resources/conf/conf.json rename to spring-vertx/src/main/resources/conf/conf.json diff --git a/vertx-spring/src/test/java/com/baeldung/vertxspring/VertxSpringApplicationTests.java b/spring-vertx/src/test/java/com/baeldung/vertxspring/VertxSpringApplicationTests.java similarity index 100% rename from vertx-spring/src/test/java/com/baeldung/vertxspring/VertxSpringApplicationTests.java rename to spring-vertx/src/test/java/com/baeldung/vertxspring/VertxSpringApplicationTests.java diff --git a/vertx-spring/pom.xml b/vertx-spring/pom.xml deleted file mode 100644 index f27aff952e..0000000000 --- a/vertx-spring/pom.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - 4.0.0 - - com.baeldung - vertx-spring - 0.0.1-SNAPSHOT - jar - - vertx-spring - A demo project with vertx spring integration - - - org.springframework.boot - spring-boot-starter-parent - 1.5.3.RELEASE - - - - - UTF-8 - UTF-8 - 1.8 - 3.4.1 - - - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - - - - - io.vertx - vertx-core - ${vertx.version} - - - io.vertx - vertx-web - ${vertx.version} - - - - com.h2database - h2 - runtime - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - -