From 78c3a210a0274e911e0ead16f866a7fe973ca1b3 Mon Sep 17 00:00:00 2001 From: mikr Date: Mon, 27 Jan 2020 00:19:57 +0100 Subject: [PATCH 1/8] BAEL-20858 Move Spring Boot Properties module to Spring Boot modules --- pom.xml | 2 -- spring-boot-modules/pom.xml | 1 + .../spring-boot-camel}/README.md | 0 .../spring-boot-camel}/pom.xml | 1 + .../src/main/java/com/baeldung/camel/Application.java | 0 .../src/main/java/com/baeldung/camel/ExampleServices.java | 0 .../src/main/java/com/baeldung/camel/MyBean.java | 0 .../src/main/resources/application.properties | 0 .../spring-boot-camel}/src/main/resources/application.yml | 0 .../spring-boot-camel}/src/main/resources/logback.xml | 0 .../src/test/java/org/baeldung/SpringContextTest.java | 0 11 files changed, 2 insertions(+), 2 deletions(-) rename {spring-boot-camel => spring-boot-modules/spring-boot-camel}/README.md (100%) rename {spring-boot-camel => spring-boot-modules/spring-boot-camel}/pom.xml (97%) rename {spring-boot-camel => spring-boot-modules/spring-boot-camel}/src/main/java/com/baeldung/camel/Application.java (100%) rename {spring-boot-camel => spring-boot-modules/spring-boot-camel}/src/main/java/com/baeldung/camel/ExampleServices.java (100%) rename {spring-boot-camel => spring-boot-modules/spring-boot-camel}/src/main/java/com/baeldung/camel/MyBean.java (100%) rename {spring-boot-camel => spring-boot-modules/spring-boot-camel}/src/main/resources/application.properties (100%) rename {spring-boot-camel => spring-boot-modules/spring-boot-camel}/src/main/resources/application.yml (100%) rename {spring-boot-camel => spring-boot-modules/spring-boot-camel}/src/main/resources/logback.xml (100%) rename {spring-boot-camel => spring-boot-modules/spring-boot-camel}/src/test/java/org/baeldung/SpringContextTest.java (100%) diff --git a/pom.xml b/pom.xml index 1a111546fa..88b9e29284 100644 --- a/pom.xml +++ b/pom.xml @@ -645,7 +645,6 @@ spring-boot-artifacts spring-boot-autoconfiguration spring-boot-bootstrap - spring-boot-camel spring-boot-client spring-boot-config-jpa-error @@ -1183,7 +1182,6 @@ spring-boot-artifacts spring-boot-autoconfiguration spring-boot-bootstrap - spring-boot-camel spring-boot-client spring-boot-config-jpa-error diff --git a/spring-boot-modules/pom.xml b/spring-boot-modules/pom.xml index 0af6fe449f..86b071e5cc 100644 --- a/spring-boot-modules/pom.xml +++ b/spring-boot-modules/pom.xml @@ -14,6 +14,7 @@ + spring-boot-camel spring-boot-mvc-birt spring-boot-vue diff --git a/spring-boot-camel/README.md b/spring-boot-modules/spring-boot-camel/README.md similarity index 100% rename from spring-boot-camel/README.md rename to spring-boot-modules/spring-boot-camel/README.md diff --git a/spring-boot-camel/pom.xml b/spring-boot-modules/spring-boot-camel/pom.xml similarity index 97% rename from spring-boot-camel/pom.xml rename to spring-boot-modules/spring-boot-camel/pom.xml index 8bab0ed5c8..8365a3d831 100644 --- a/spring-boot-camel/pom.xml +++ b/spring-boot-modules/spring-boot-camel/pom.xml @@ -11,6 +11,7 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT + ../../parent-modules diff --git a/spring-boot-camel/src/main/java/com/baeldung/camel/Application.java b/spring-boot-modules/spring-boot-camel/src/main/java/com/baeldung/camel/Application.java similarity index 100% rename from spring-boot-camel/src/main/java/com/baeldung/camel/Application.java rename to spring-boot-modules/spring-boot-camel/src/main/java/com/baeldung/camel/Application.java diff --git a/spring-boot-camel/src/main/java/com/baeldung/camel/ExampleServices.java b/spring-boot-modules/spring-boot-camel/src/main/java/com/baeldung/camel/ExampleServices.java similarity index 100% rename from spring-boot-camel/src/main/java/com/baeldung/camel/ExampleServices.java rename to spring-boot-modules/spring-boot-camel/src/main/java/com/baeldung/camel/ExampleServices.java diff --git a/spring-boot-camel/src/main/java/com/baeldung/camel/MyBean.java b/spring-boot-modules/spring-boot-camel/src/main/java/com/baeldung/camel/MyBean.java similarity index 100% rename from spring-boot-camel/src/main/java/com/baeldung/camel/MyBean.java rename to spring-boot-modules/spring-boot-camel/src/main/java/com/baeldung/camel/MyBean.java diff --git a/spring-boot-camel/src/main/resources/application.properties b/spring-boot-modules/spring-boot-camel/src/main/resources/application.properties similarity index 100% rename from spring-boot-camel/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-camel/src/main/resources/application.properties diff --git a/spring-boot-camel/src/main/resources/application.yml b/spring-boot-modules/spring-boot-camel/src/main/resources/application.yml similarity index 100% rename from spring-boot-camel/src/main/resources/application.yml rename to spring-boot-modules/spring-boot-camel/src/main/resources/application.yml diff --git a/spring-boot-camel/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-camel/src/main/resources/logback.xml similarity index 100% rename from spring-boot-camel/src/main/resources/logback.xml rename to spring-boot-modules/spring-boot-camel/src/main/resources/logback.xml diff --git a/spring-boot-camel/src/test/java/org/baeldung/SpringContextTest.java b/spring-boot-modules/spring-boot-camel/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-boot-camel/src/test/java/org/baeldung/SpringContextTest.java rename to spring-boot-modules/spring-boot-camel/src/test/java/org/baeldung/SpringContextTest.java From 5f34d371e6509259d9f2d60a506d7bcaa1f4cb06 Mon Sep 17 00:00:00 2001 From: mikr Date: Mon, 27 Jan 2020 22:55:17 +0100 Subject: [PATCH 2/8] BAEL-20858 Make Spring Boot Modules parent of Spring Boot Camel --- spring-boot-modules/spring-boot-camel/pom.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spring-boot-modules/spring-boot-camel/pom.xml b/spring-boot-modules/spring-boot-camel/pom.xml index 8365a3d831..b71bdb3f79 100644 --- a/spring-boot-modules/spring-boot-camel/pom.xml +++ b/spring-boot-modules/spring-boot-camel/pom.xml @@ -9,9 +9,8 @@ com.baeldung - parent-modules + spring-boot-modules 1.0.0-SNAPSHOT - ../../parent-modules From de40539abe839ceb028c0c8e7b63b82b159f913c Mon Sep 17 00:00:00 2001 From: mikr Date: Tue, 28 Jan 2020 09:29:02 +0100 Subject: [PATCH 3/8] BAEL-20858 Move Spring Boot Camel module - fix pom --- spring-boot-modules/spring-boot-camel/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-modules/spring-boot-camel/pom.xml b/spring-boot-modules/spring-boot-camel/pom.xml index b71bdb3f79..7c1e28b3ee 100644 --- a/spring-boot-modules/spring-boot-camel/pom.xml +++ b/spring-boot-modules/spring-boot-camel/pom.xml @@ -8,7 +8,7 @@ spring-boot-camel - com.baeldung + com.baeldung.spring-boot-modules spring-boot-modules 1.0.0-SNAPSHOT From 822608eba2458711416097b4e029ded48ce58f24 Mon Sep 17 00:00:00 2001 From: mikr Date: Tue, 28 Jan 2020 22:08:47 +0100 Subject: [PATCH 4/8] BAEL-20879 Move Spring Boot Nashorn Module --- pom.xml | 2 -- spring-boot-modules/pom.xml | 1 + .../spring-boot-nashorn}/README.md | 0 .../spring-boot-nashorn}/pom.xml | 2 +- .../src/main/java/com/baeldung/nashorn/Application.java | 0 .../java/com/baeldung/nashorn/controller/MyRestController.java | 0 .../java/com/baeldung/nashorn/controller/MyWebController.java | 0 .../src/main/resources/application.properties | 0 .../spring-boot-nashorn}/src/main/resources/static/app.js | 0 .../src/main/resources/static/js/react-dom-server.js | 0 .../src/main/resources/static/js/react-dom.js | 0 .../spring-boot-nashorn}/src/main/resources/static/js/react.js | 0 .../spring-boot-nashorn}/src/main/webapp/WEB-INF/jsp/index.jsp | 0 13 files changed, 2 insertions(+), 3 deletions(-) rename {spring-boot-nashorn => spring-boot-modules/spring-boot-nashorn}/README.md (100%) rename {spring-boot-nashorn => spring-boot-modules/spring-boot-nashorn}/pom.xml (96%) rename {spring-boot-nashorn => spring-boot-modules/spring-boot-nashorn}/src/main/java/com/baeldung/nashorn/Application.java (100%) rename {spring-boot-nashorn => spring-boot-modules/spring-boot-nashorn}/src/main/java/com/baeldung/nashorn/controller/MyRestController.java (100%) rename {spring-boot-nashorn => spring-boot-modules/spring-boot-nashorn}/src/main/java/com/baeldung/nashorn/controller/MyWebController.java (100%) rename {spring-boot-nashorn => spring-boot-modules/spring-boot-nashorn}/src/main/resources/application.properties (100%) rename {spring-boot-nashorn => spring-boot-modules/spring-boot-nashorn}/src/main/resources/static/app.js (100%) rename {spring-boot-nashorn => spring-boot-modules/spring-boot-nashorn}/src/main/resources/static/js/react-dom-server.js (100%) rename {spring-boot-nashorn => spring-boot-modules/spring-boot-nashorn}/src/main/resources/static/js/react-dom.js (100%) rename {spring-boot-nashorn => spring-boot-modules/spring-boot-nashorn}/src/main/resources/static/js/react.js (100%) rename {spring-boot-nashorn => spring-boot-modules/spring-boot-nashorn}/src/main/webapp/WEB-INF/jsp/index.jsp (100%) diff --git a/pom.xml b/pom.xml index 95a3cb9e72..030646961b 100644 --- a/pom.xml +++ b/pom.xml @@ -661,7 +661,6 @@ spring-boot-libraries spring-boot-logging-log4j2 spring-boot-mvc-2 - spring-boot-nashorn spring-boot-parent spring-boot-performance spring-boot-property-exp @@ -1195,7 +1194,6 @@ spring-boot-logging-log4j2 spring-boot-mvc spring-boot-mvc-2 - spring-boot-nashorn spring-boot-parent spring-boot-performance spring-boot-property-exp diff --git a/spring-boot-modules/pom.xml b/spring-boot-modules/pom.xml index 490ecb31f9..61986ad957 100644 --- a/spring-boot-modules/pom.xml +++ b/spring-boot-modules/pom.xml @@ -18,6 +18,7 @@ spring-boot-data spring-boot-di spring-boot-mvc-birt + spring-boot-nashorn spring-boot-properties spring-boot-testing spring-boot-vue diff --git a/spring-boot-nashorn/README.md b/spring-boot-modules/spring-boot-nashorn/README.md similarity index 100% rename from spring-boot-nashorn/README.md rename to spring-boot-modules/spring-boot-nashorn/README.md diff --git a/spring-boot-nashorn/pom.xml b/spring-boot-modules/spring-boot-nashorn/pom.xml similarity index 96% rename from spring-boot-nashorn/pom.xml rename to spring-boot-modules/spring-boot-nashorn/pom.xml index af11f14fdc..c60997005d 100644 --- a/spring-boot-nashorn/pom.xml +++ b/spring-boot-modules/spring-boot-nashorn/pom.xml @@ -13,7 +13,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/spring-boot-nashorn/src/main/java/com/baeldung/nashorn/Application.java b/spring-boot-modules/spring-boot-nashorn/src/main/java/com/baeldung/nashorn/Application.java similarity index 100% rename from spring-boot-nashorn/src/main/java/com/baeldung/nashorn/Application.java rename to spring-boot-modules/spring-boot-nashorn/src/main/java/com/baeldung/nashorn/Application.java diff --git a/spring-boot-nashorn/src/main/java/com/baeldung/nashorn/controller/MyRestController.java b/spring-boot-modules/spring-boot-nashorn/src/main/java/com/baeldung/nashorn/controller/MyRestController.java similarity index 100% rename from spring-boot-nashorn/src/main/java/com/baeldung/nashorn/controller/MyRestController.java rename to spring-boot-modules/spring-boot-nashorn/src/main/java/com/baeldung/nashorn/controller/MyRestController.java diff --git a/spring-boot-nashorn/src/main/java/com/baeldung/nashorn/controller/MyWebController.java b/spring-boot-modules/spring-boot-nashorn/src/main/java/com/baeldung/nashorn/controller/MyWebController.java similarity index 100% rename from spring-boot-nashorn/src/main/java/com/baeldung/nashorn/controller/MyWebController.java rename to spring-boot-modules/spring-boot-nashorn/src/main/java/com/baeldung/nashorn/controller/MyWebController.java diff --git a/spring-boot-nashorn/src/main/resources/application.properties b/spring-boot-modules/spring-boot-nashorn/src/main/resources/application.properties similarity index 100% rename from spring-boot-nashorn/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-nashorn/src/main/resources/application.properties diff --git a/spring-boot-nashorn/src/main/resources/static/app.js b/spring-boot-modules/spring-boot-nashorn/src/main/resources/static/app.js similarity index 100% rename from spring-boot-nashorn/src/main/resources/static/app.js rename to spring-boot-modules/spring-boot-nashorn/src/main/resources/static/app.js diff --git a/spring-boot-nashorn/src/main/resources/static/js/react-dom-server.js b/spring-boot-modules/spring-boot-nashorn/src/main/resources/static/js/react-dom-server.js similarity index 100% rename from spring-boot-nashorn/src/main/resources/static/js/react-dom-server.js rename to spring-boot-modules/spring-boot-nashorn/src/main/resources/static/js/react-dom-server.js diff --git a/spring-boot-nashorn/src/main/resources/static/js/react-dom.js b/spring-boot-modules/spring-boot-nashorn/src/main/resources/static/js/react-dom.js similarity index 100% rename from spring-boot-nashorn/src/main/resources/static/js/react-dom.js rename to spring-boot-modules/spring-boot-nashorn/src/main/resources/static/js/react-dom.js diff --git a/spring-boot-nashorn/src/main/resources/static/js/react.js b/spring-boot-modules/spring-boot-nashorn/src/main/resources/static/js/react.js similarity index 100% rename from spring-boot-nashorn/src/main/resources/static/js/react.js rename to spring-boot-modules/spring-boot-nashorn/src/main/resources/static/js/react.js diff --git a/spring-boot-nashorn/src/main/webapp/WEB-INF/jsp/index.jsp b/spring-boot-modules/spring-boot-nashorn/src/main/webapp/WEB-INF/jsp/index.jsp similarity index 100% rename from spring-boot-nashorn/src/main/webapp/WEB-INF/jsp/index.jsp rename to spring-boot-modules/spring-boot-nashorn/src/main/webapp/WEB-INF/jsp/index.jsp From cce61b0d53864f3b1465cd4a1527627d43df10f2 Mon Sep 17 00:00:00 2001 From: Krzysztof Woyke Date: Fri, 31 Jan 2020 08:38:03 +0100 Subject: [PATCH 5/8] BAEL-20875: Move spring-boot-logging-log4j2 into spring-boot-modules --- pom.xml | 2 -- spring-boot-modules/pom.xml | 1 + .../spring-boot-logging-log4j2}/.gitignore | 0 .../spring-boot-logging-log4j2}/README.md | 0 .../spring-boot-logging-log4j2}/pom.xml | 2 +- .../main/java/com/baeldung/graylog/GraylogDemoApplication.java | 0 .../java/com/baeldung/springbootlogging/LoggingController.java | 0 .../com/baeldung/springbootlogging/LombokLoggingController.java | 0 .../springbootlogging/SpringBootLoggingApplication.java | 0 .../src/main/resources/application.properties | 0 .../spring-boot-logging-log4j2}/src/main/resources/log4j.xml | 0 .../src/main/resources/log4j2-spring.xml | 0 .../src/test/java/org/baeldung/SpringContextTest.java | 0 13 files changed, 2 insertions(+), 3 deletions(-) rename {spring-boot-logging-log4j2 => spring-boot-modules/spring-boot-logging-log4j2}/.gitignore (100%) rename {spring-boot-logging-log4j2 => spring-boot-modules/spring-boot-logging-log4j2}/README.md (100%) rename {spring-boot-logging-log4j2 => spring-boot-modules/spring-boot-logging-log4j2}/pom.xml (98%) rename {spring-boot-logging-log4j2 => spring-boot-modules/spring-boot-logging-log4j2}/src/main/java/com/baeldung/graylog/GraylogDemoApplication.java (100%) rename {spring-boot-logging-log4j2 => spring-boot-modules/spring-boot-logging-log4j2}/src/main/java/com/baeldung/springbootlogging/LoggingController.java (100%) rename {spring-boot-logging-log4j2 => spring-boot-modules/spring-boot-logging-log4j2}/src/main/java/com/baeldung/springbootlogging/LombokLoggingController.java (100%) rename {spring-boot-logging-log4j2 => spring-boot-modules/spring-boot-logging-log4j2}/src/main/java/com/baeldung/springbootlogging/SpringBootLoggingApplication.java (100%) rename {spring-boot-logging-log4j2 => spring-boot-modules/spring-boot-logging-log4j2}/src/main/resources/application.properties (100%) rename {spring-boot-logging-log4j2 => spring-boot-modules/spring-boot-logging-log4j2}/src/main/resources/log4j.xml (100%) rename {spring-boot-logging-log4j2 => spring-boot-modules/spring-boot-logging-log4j2}/src/main/resources/log4j2-spring.xml (100%) rename {spring-boot-logging-log4j2 => spring-boot-modules/spring-boot-logging-log4j2}/src/test/java/org/baeldung/SpringContextTest.java (100%) diff --git a/pom.xml b/pom.xml index a8efad57fa..3d650a1c3c 100644 --- a/pom.xml +++ b/pom.xml @@ -655,7 +655,6 @@ spring-boot-jasypt spring-boot-kotlin spring-boot-libraries - spring-boot-logging-log4j2 spring-boot-mvc-2 spring-boot-nashorn spring-boot-parent @@ -1182,7 +1181,6 @@ spring-boot-jasypt spring-boot-kotlin spring-boot-libraries - spring-boot-logging-log4j2 spring-boot-mvc spring-boot-mvc-2 spring-boot-nashorn diff --git a/spring-boot-modules/pom.xml b/spring-boot-modules/pom.xml index a3532dba2c..22ef579780 100644 --- a/spring-boot-modules/pom.xml +++ b/spring-boot-modules/pom.xml @@ -21,6 +21,7 @@ spring-boot-data spring-boot-keycloak + spring-boot-logging-log4j2 spring-boot-mvc-birt spring-boot-performance spring-boot-properties diff --git a/spring-boot-logging-log4j2/.gitignore b/spring-boot-modules/spring-boot-logging-log4j2/.gitignore similarity index 100% rename from spring-boot-logging-log4j2/.gitignore rename to spring-boot-modules/spring-boot-logging-log4j2/.gitignore diff --git a/spring-boot-logging-log4j2/README.md b/spring-boot-modules/spring-boot-logging-log4j2/README.md similarity index 100% rename from spring-boot-logging-log4j2/README.md rename to spring-boot-modules/spring-boot-logging-log4j2/README.md diff --git a/spring-boot-logging-log4j2/pom.xml b/spring-boot-modules/spring-boot-logging-log4j2/pom.xml similarity index 98% rename from spring-boot-logging-log4j2/pom.xml rename to spring-boot-modules/spring-boot-logging-log4j2/pom.xml index a7065bc925..6e709230dd 100644 --- a/spring-boot-logging-log4j2/pom.xml +++ b/spring-boot-modules/spring-boot-logging-log4j2/pom.xml @@ -12,7 +12,7 @@ org.springframework.boot spring-boot-starter-parent - 2.2.1.RELEASE + 2.2.2.RELEASE diff --git a/spring-boot-logging-log4j2/src/main/java/com/baeldung/graylog/GraylogDemoApplication.java b/spring-boot-modules/spring-boot-logging-log4j2/src/main/java/com/baeldung/graylog/GraylogDemoApplication.java similarity index 100% rename from spring-boot-logging-log4j2/src/main/java/com/baeldung/graylog/GraylogDemoApplication.java rename to spring-boot-modules/spring-boot-logging-log4j2/src/main/java/com/baeldung/graylog/GraylogDemoApplication.java diff --git a/spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/LoggingController.java b/spring-boot-modules/spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/LoggingController.java similarity index 100% rename from spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/LoggingController.java rename to spring-boot-modules/spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/LoggingController.java diff --git a/spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/LombokLoggingController.java b/spring-boot-modules/spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/LombokLoggingController.java similarity index 100% rename from spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/LombokLoggingController.java rename to spring-boot-modules/spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/LombokLoggingController.java diff --git a/spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/SpringBootLoggingApplication.java b/spring-boot-modules/spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/SpringBootLoggingApplication.java similarity index 100% rename from spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/SpringBootLoggingApplication.java rename to spring-boot-modules/spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/SpringBootLoggingApplication.java diff --git a/spring-boot-logging-log4j2/src/main/resources/application.properties b/spring-boot-modules/spring-boot-logging-log4j2/src/main/resources/application.properties similarity index 100% rename from spring-boot-logging-log4j2/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-logging-log4j2/src/main/resources/application.properties diff --git a/spring-boot-logging-log4j2/src/main/resources/log4j.xml b/spring-boot-modules/spring-boot-logging-log4j2/src/main/resources/log4j.xml similarity index 100% rename from spring-boot-logging-log4j2/src/main/resources/log4j.xml rename to spring-boot-modules/spring-boot-logging-log4j2/src/main/resources/log4j.xml diff --git a/spring-boot-logging-log4j2/src/main/resources/log4j2-spring.xml b/spring-boot-modules/spring-boot-logging-log4j2/src/main/resources/log4j2-spring.xml similarity index 100% rename from spring-boot-logging-log4j2/src/main/resources/log4j2-spring.xml rename to spring-boot-modules/spring-boot-logging-log4j2/src/main/resources/log4j2-spring.xml diff --git a/spring-boot-logging-log4j2/src/test/java/org/baeldung/SpringContextTest.java b/spring-boot-modules/spring-boot-logging-log4j2/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-boot-logging-log4j2/src/test/java/org/baeldung/SpringContextTest.java rename to spring-boot-modules/spring-boot-logging-log4j2/src/test/java/org/baeldung/SpringContextTest.java From d55081bd7aa23f31d6679cc19192e942401dd753 Mon Sep 17 00:00:00 2001 From: kwoyke Date: Fri, 31 Jan 2020 21:48:23 +0100 Subject: [PATCH 6/8] BAEL-3809: Ensure tables are dropped in proper order (#8640) --- pom.xml | 2 + spring-boot-modules/pom.xml | 1 - .../README.md | 0 .../pom.xml | 2 +- .../lazyinitialization/Application.java | 0 .../lazyinitialization/services/Writer.java | 0 .../src/main/resources/application.yml | 0 .../main/java/com/baeldung/models/Tweet.java | 6 +- ...SpringDataWithSecurityIntegrationTest.java | 68 +++++++++++-------- 9 files changed, 48 insertions(+), 31 deletions(-) rename {spring-boot-modules/spring-boot-performance => spring-boot-performance}/README.md (100%) rename {spring-boot-modules/spring-boot-performance => spring-boot-performance}/pom.xml (96%) rename {spring-boot-modules/spring-boot-performance => spring-boot-performance}/src/main/java/com/baeldung/lazyinitialization/Application.java (100%) rename {spring-boot-modules/spring-boot-performance => spring-boot-performance}/src/main/java/com/baeldung/lazyinitialization/services/Writer.java (100%) rename {spring-boot-modules/spring-boot-performance => spring-boot-performance}/src/main/resources/application.yml (100%) diff --git a/pom.xml b/pom.xml index a8efad57fa..eccf2d7ead 100644 --- a/pom.xml +++ b/pom.xml @@ -659,6 +659,7 @@ spring-boot-mvc-2 spring-boot-nashorn spring-boot-parent + spring-boot-performance spring-boot-property-exp spring-boot-rest @@ -1187,6 +1188,7 @@ spring-boot-mvc-2 spring-boot-nashorn spring-boot-parent + spring-boot-performance spring-boot-property-exp spring-boot-rest diff --git a/spring-boot-modules/pom.xml b/spring-boot-modules/pom.xml index a3532dba2c..f71bc5b0be 100644 --- a/spring-boot-modules/pom.xml +++ b/spring-boot-modules/pom.xml @@ -22,7 +22,6 @@ spring-boot-keycloak spring-boot-mvc-birt - spring-boot-performance spring-boot-properties spring-boot-springdoc spring-boot-testing diff --git a/spring-boot-modules/spring-boot-performance/README.md b/spring-boot-performance/README.md similarity index 100% rename from spring-boot-modules/spring-boot-performance/README.md rename to spring-boot-performance/README.md diff --git a/spring-boot-modules/spring-boot-performance/pom.xml b/spring-boot-performance/pom.xml similarity index 96% rename from spring-boot-modules/spring-boot-performance/pom.xml rename to spring-boot-performance/pom.xml index 882763f0bc..7bf3885618 100644 --- a/spring-boot-modules/spring-boot-performance/pom.xml +++ b/spring-boot-performance/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../../parent-boot-2 + ../parent-boot-2 diff --git a/spring-boot-modules/spring-boot-performance/src/main/java/com/baeldung/lazyinitialization/Application.java b/spring-boot-performance/src/main/java/com/baeldung/lazyinitialization/Application.java similarity index 100% rename from spring-boot-modules/spring-boot-performance/src/main/java/com/baeldung/lazyinitialization/Application.java rename to spring-boot-performance/src/main/java/com/baeldung/lazyinitialization/Application.java diff --git a/spring-boot-modules/spring-boot-performance/src/main/java/com/baeldung/lazyinitialization/services/Writer.java b/spring-boot-performance/src/main/java/com/baeldung/lazyinitialization/services/Writer.java similarity index 100% rename from spring-boot-modules/spring-boot-performance/src/main/java/com/baeldung/lazyinitialization/services/Writer.java rename to spring-boot-performance/src/main/java/com/baeldung/lazyinitialization/services/Writer.java diff --git a/spring-boot-modules/spring-boot-performance/src/main/resources/application.yml b/spring-boot-performance/src/main/resources/application.yml similarity index 100% rename from spring-boot-modules/spring-boot-performance/src/main/resources/application.yml rename to spring-boot-performance/src/main/resources/application.yml diff --git a/spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/models/Tweet.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/models/Tweet.java index b2e45009f6..54a96deaf3 100644 --- a/spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/models/Tweet.java +++ b/spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/models/Tweet.java @@ -3,14 +3,17 @@ package com.baeldung.models; import java.util.HashSet; import java.util.Set; +import javax.persistence.CollectionTable; import javax.persistence.ElementCollection; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; +import javax.persistence.Table; @Entity +@Table(name = "Tweet") public class Tweet { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE) @@ -18,7 +21,8 @@ public class Tweet { private String tweet; private String owner; @ElementCollection(targetClass = String.class, fetch = FetchType.EAGER) - private Set likes = new HashSet(); + @CollectionTable(name = "Tweet_Likes") + private Set likes = new HashSet<>(); public long getId() { return id; diff --git a/spring-security-modules/spring-security-mvc-boot/src/test/java/com/baeldung/relationships/SpringDataWithSecurityIntegrationTest.java b/spring-security-modules/spring-security-mvc-boot/src/test/java/com/baeldung/relationships/SpringDataWithSecurityIntegrationTest.java index 41f220df6f..b2def82c51 100644 --- a/spring-security-modules/spring-security-mvc-boot/src/test/java/com/baeldung/relationships/SpringDataWithSecurityIntegrationTest.java +++ b/spring-security-modules/spring-security-mvc-boot/src/test/java/com/baeldung/relationships/SpringDataWithSecurityIntegrationTest.java @@ -1,29 +1,5 @@ package com.baeldung.relationships; -import static org.springframework.util.Assert.isTrue; - -import java.util.Date; -import java.util.List; - -import javax.servlet.ServletContext; - -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.dao.InvalidDataAccessApiUsageException; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageRequest; -import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.context.web.WebAppConfiguration; -import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; - import com.baeldung.AppConfig; import com.baeldung.data.repositories.TweetRepository; import com.baeldung.data.repositories.UserRepository; @@ -31,6 +7,30 @@ import com.baeldung.models.AppUser; import com.baeldung.models.Tweet; import com.baeldung.security.AppUserPrincipal; import com.baeldung.util.DummyContentUtil; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.dao.InvalidDataAccessApiUsageException; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.context.web.WebAppConfiguration; +import org.springframework.test.jdbc.JdbcTestUtils; +import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; + +import javax.servlet.ServletContext; +import java.util.Date; +import java.util.List; + +import static org.springframework.util.Assert.isTrue; @RunWith(SpringRunner.class) @WebAppConfiguration @@ -54,10 +54,22 @@ public class SpringDataWithSecurityIntegrationTest { tweetRepository.saveAll(DummyContentUtil.generateDummyTweets(appUsers)); } - @AfterClass - public static void tearDown() { - tweetRepository.deleteAll(); - userRepository.deleteAll(); + /** + * This is to ensure the tables are dropped in proper order. + * After the Spring Boot 2.2.2 upgrade, DDL statements generated automatically try to drop Tweet table first. + * As a result we get org.h2.jdbc.JdbcSQLSyntaxErrorException because Tweet_Likes table depends on Tweet. + * + * @see + * StackOverflow#59364212 + * + * @see + * StackOverflow#59561551 + * + */ + @After + public void tearDown() { + JdbcTemplate jdbcTemplate = ctx.getBean(JdbcTemplate.class); + JdbcTestUtils.dropTables(jdbcTemplate, "Tweet_Likes", "Tweet"); } @Test From fd17eaac04fb0276524c33fda6192f8c180deaa8 Mon Sep 17 00:00:00 2001 From: Maiklins Date: Fri, 31 Jan 2020 21:50:25 +0100 Subject: [PATCH 7/8] BAEL-20687 Fix test in core-groovy-2 module (#8608) --- .../baeldung/category/CategoryUnitTest.groovy | 21 +++++++++---------- .../webservice/WebserviceUnitTest.groovy | 2 -- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/core-groovy-2/src/test/groovy/com/baeldung/category/CategoryUnitTest.groovy b/core-groovy-2/src/test/groovy/com/baeldung/category/CategoryUnitTest.groovy index 5ba7a2347c..a1f67b1e2e 100644 --- a/core-groovy-2/src/test/groovy/com/baeldung/category/CategoryUnitTest.groovy +++ b/core-groovy-2/src/test/groovy/com/baeldung/category/CategoryUnitTest.groovy @@ -28,17 +28,16 @@ class CategoryUnitTest extends GroovyTestCase { } } -// http://team.baeldung.com/browse/BAEL-20687 -// void test_whenUsingTimeCategory_thenOperationOnNumber() { -// SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy") -// use (TimeCategory) { -// assert sdf.format(5.days.from.now) == sdf.format(new Date() + 5.days) -// -// sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss") -// assert sdf.format(10.minutes.from.now) == sdf.format(new Date() + 10.minutes) -// assert sdf.format(2.hours.ago) == sdf.format(new Date() - 2.hours) -// } -// } + void test_whenUsingTimeCategory_thenOperationOnNumber() { + SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy") + use (TimeCategory) { + assert sdf.format(5.days.from.now) == sdf.format(new Date() + 5.days) + + sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss") + assert sdf.format(10.minutes.from.now) == sdf.format(new Date() + 10.minutes) + assert sdf.format(2.hours.ago) == sdf.format(new Date() - 2.hours) + } + } void test_whenUsingDOMCategory_thenOperationOnXML() { diff --git a/core-groovy-2/src/test/groovy/com/baeldung/webservice/WebserviceUnitTest.groovy b/core-groovy-2/src/test/groovy/com/baeldung/webservice/WebserviceUnitTest.groovy index 144d5720c8..b8417b8ac1 100644 --- a/core-groovy-2/src/test/groovy/com/baeldung/webservice/WebserviceUnitTest.groovy +++ b/core-groovy-2/src/test/groovy/com/baeldung/webservice/WebserviceUnitTest.groovy @@ -75,7 +75,6 @@ class WebserviceManualTest extends GroovyTestCase { assert stories.size() == 5 } - /* see BAEL-3753 void test_whenConsumingSoap_thenReceiveResponse() { def url = "http://www.dataaccess.com/webservicesserver/numberconversion.wso" def soapClient = new SOAPClient(url) @@ -90,7 +89,6 @@ class WebserviceManualTest extends GroovyTestCase { def words = response.NumberToWordsResponse assert words == "one thousand two hundred and thirty four " } - */ void test_whenConsumingRestGet_thenReceiveResponse() { def path = "/get" From cdac6f117a3e1094e8038f2cd4167dd4de8cac90 Mon Sep 17 00:00:00 2001 From: kwoyke Date: Fri, 31 Jan 2020 21:55:19 +0100 Subject: [PATCH 8/8] BAEL-3476: Add Java 9 example to Immutable ArrayList in Java (#8636) --- core-java-modules/core-java-9/README.md | 1 + core-java-modules/core-java-9/pom.xml | 6 +++ .../immutable/ImmutableArrayListUnitTest.java | 48 +++++++++++++++++++ .../README.md | 5 +- .../CoreJavaCollectionsUnitTest.java | 33 +------------ 5 files changed, 58 insertions(+), 35 deletions(-) create mode 100644 core-java-modules/core-java-9/src/test/java/com/baeldung/java9/list/immutable/ImmutableArrayListUnitTest.java diff --git a/core-java-modules/core-java-9/README.md b/core-java-modules/core-java-9/README.md index e2bea5f7e2..bfd426b9c1 100644 --- a/core-java-modules/core-java-9/README.md +++ b/core-java-modules/core-java-9/README.md @@ -9,6 +9,7 @@ This module contains articles about Java 9 core features - [Iterate Through a Range of Dates in Java](https://www.baeldung.com/java-iterate-date-range) - [Initialize a HashMap in Java](https://www.baeldung.com/java-initialize-hashmap) - [Immutable Set in Java](https://www.baeldung.com/java-immutable-set) +- [Immutable ArrayList in Java](https://www.baeldung.com/java-immutable-list) Note: also contains part of the code for the article [How to Filter a Collection in Java](https://www.baeldung.com/java-collection-filtering). diff --git a/core-java-modules/core-java-9/pom.xml b/core-java-modules/core-java-9/pom.xml index 23a465caa1..a90ad0a740 100644 --- a/core-java-modules/core-java-9/pom.xml +++ b/core-java-modules/core-java-9/pom.xml @@ -37,6 +37,11 @@ ${junit.platform.version} test + + org.apache.commons + commons-collections4 + ${commons-collections4.version} + @@ -69,6 +74,7 @@ 1.9 1.9 25.1-jre + 4.1 diff --git a/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/list/immutable/ImmutableArrayListUnitTest.java b/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/list/immutable/ImmutableArrayListUnitTest.java new file mode 100644 index 0000000000..f148b66dad --- /dev/null +++ b/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/list/immutable/ImmutableArrayListUnitTest.java @@ -0,0 +1,48 @@ +package com.baeldung.java9.list.immutable; + +import com.google.common.collect.ImmutableList; +import org.apache.commons.collections4.ListUtils; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +public class ImmutableArrayListUnitTest { + + @Test(expected = UnsupportedOperationException.class) + public final void givenUsingTheJdk_whenUnmodifiableListIsCreated_thenNotModifiable() { + final List list = new ArrayList<>(Arrays.asList("one", "two", "three")); + final List unmodifiableList = Collections.unmodifiableList(list); + unmodifiableList.add("four"); + } + + @Test(expected = UnsupportedOperationException.class) + public final void givenUsingTheJava9_whenUnmodifiableListIsCreated_thenNotModifiable() { + final List list = new ArrayList<>(Arrays.asList("one", "two", "three")); + final List unmodifiableList = List.of(list.toArray(new String[]{})); + unmodifiableList.add("four"); + } + + @Test(expected = UnsupportedOperationException.class) + public final void givenUsingGuava_whenUnmodifiableListIsCreated_thenNotModifiable() { + final List list = new ArrayList<>(Arrays.asList("one", "two", "three")); + final List unmodifiableList = ImmutableList.copyOf(list); + unmodifiableList.add("four"); + } + + @Test(expected = UnsupportedOperationException.class) + public final void givenUsingGuavaBuilder_whenUnmodifiableListIsCreated_thenNoLongerModifiable() { + final List list = new ArrayList<>(Arrays.asList("one", "two", "three")); + final ImmutableList unmodifiableList = ImmutableList.builder().addAll(list).build(); + unmodifiableList.add("four"); + } + + @Test(expected = UnsupportedOperationException.class) + public final void givenUsingCommonsCollections_whenUnmodifiableListIsCreated_thenNotModifiable() { + final List list = new ArrayList<>(Arrays.asList("one", "two", "three")); + final List unmodifiableList = ListUtils.unmodifiableList(list); + unmodifiableList.add("four"); + } +} diff --git a/core-java-modules/core-java-collections-array-list/README.md b/core-java-modules/core-java-collections-array-list/README.md index 302ea82130..3637f835cf 100644 --- a/core-java-modules/core-java-collections-array-list/README.md +++ b/core-java-modules/core-java-collections-array-list/README.md @@ -3,9 +3,8 @@ This module contains articles about the Java ArrayList collection ### Relevant Articles: -- [Immutable ArrayList in Java](http://www.baeldung.com/java-immutable-list) -- [Guide to the Java ArrayList](http://www.baeldung.com/java-arraylist) -- [Add Multiple Items to an Java ArrayList](http://www.baeldung.com/java-add-items-array-list) +- [Guide to the Java ArrayList](https://www.baeldung.com/java-arraylist) +- [Add Multiple Items to an Java ArrayList](https://www.baeldung.com/java-add-items-array-list) - [ClassCastException: Arrays$ArrayList cannot be cast to ArrayList](https://www.baeldung.com/java-classcastexception-arrays-arraylist) - [Multi Dimensional ArrayList in Java](https://www.baeldung.com/java-multi-dimensional-arraylist) - [Removing an Element From an ArrayList](https://www.baeldung.com/java-arraylist-remove-element) diff --git a/core-java-modules/core-java-collections-array-list/src/test/java/com/baeldung/collections/CoreJavaCollectionsUnitTest.java b/core-java-modules/core-java-collections-array-list/src/test/java/com/baeldung/collections/CoreJavaCollectionsUnitTest.java index 019a569a65..5fd0e605dd 100644 --- a/core-java-modules/core-java-collections-array-list/src/test/java/com/baeldung/collections/CoreJavaCollectionsUnitTest.java +++ b/core-java-modules/core-java-collections-array-list/src/test/java/com/baeldung/collections/CoreJavaCollectionsUnitTest.java @@ -15,42 +15,11 @@ public class CoreJavaCollectionsUnitTest { private static final Logger LOG = LoggerFactory.getLogger(CoreJavaCollectionsUnitTest.class); - - // tests - - @Test public final void givenUsingTheJdk_whenArrayListIsSynchronized_thenCorrect() { - final List list = new ArrayList(Arrays.asList("one", "two", "three")); + final List list = new ArrayList<>(Arrays.asList("one", "two", "three")); final List synchronizedList = Collections.synchronizedList(list); LOG.debug("Synchronized List is: " + synchronizedList); } - @Test(expected = UnsupportedOperationException.class) - public final void givenUsingTheJdk_whenUnmodifiableListIsCreatedFromOriginal_thenNoLongerModifiable() { - final List list = new ArrayList(Arrays.asList("one", "two", "three")); - final List unmodifiableList = Collections.unmodifiableList(list); - unmodifiableList.add("four"); - } - - @Test(expected = UnsupportedOperationException.class) - public final void givenUsingGuava_whenUnmodifiableListIsCreatedFromOriginal_thenNoLongerModifiable() { - final List list = new ArrayList(Arrays.asList("one", "two", "three")); - final List unmodifiableList = ImmutableList.copyOf(list); - unmodifiableList.add("four"); - } - - @Test(expected = UnsupportedOperationException.class) - public final void givenUsingGuavaBuilder_whenUnmodifiableListIsCreatedFromOriginal_thenNoLongerModifiable() { - final List list = new ArrayList(Arrays.asList("one", "two", "three")); - final ImmutableList unmodifiableList = ImmutableList.builder().addAll(list).build(); - unmodifiableList.add("four"); - } - - @Test(expected = UnsupportedOperationException.class) - public final void givenUsingCommonsCollections_whenUnmodifiableListIsCreatedFromOriginal_thenNoLongerModifiable() { - final List list = new ArrayList(Arrays.asList("one", "two", "three")); - final List unmodifiableList = ListUtils.unmodifiableList(list); - unmodifiableList.add("four"); - } - }