customClaims = token.getOtherClaims();
+
+ if (customClaims.containsKey("DOB")) {
+ dob = String.valueOf(customClaims.get("DOB"));
+ }
+ }
+
+ model.addAttribute("username", principal.getName());
+ model.addAttribute("dob", dob);
+ return "userInfo";
+ }
+
+}
diff --git a/spring-boot-modules/spring-boot-keycloak/src/main/java/com/baeldung/keycloak/SecurityConfig.java b/spring-boot-modules/spring-boot-keycloak/src/main/java/com/baeldung/keycloak/SecurityConfig.java
index 4ecb62b6d4..895ac8c562 100644
--- a/spring-boot-modules/spring-boot-keycloak/src/main/java/com/baeldung/keycloak/SecurityConfig.java
+++ b/spring-boot-modules/spring-boot-keycloak/src/main/java/com/baeldung/keycloak/SecurityConfig.java
@@ -44,7 +44,7 @@ class SecurityConfig extends KeycloakWebSecurityConfigurerAdapter {
protected void configure(HttpSecurity http) throws Exception {
super.configure(http);
http.authorizeRequests()
- .antMatchers("/customers*")
+ .antMatchers("/customers*", "/users*")
.hasRole("user")
.anyRequest()
.permitAll();
diff --git a/spring-boot-modules/spring-boot-keycloak/src/main/resources/templates/userInfo.html b/spring-boot-modules/spring-boot-keycloak/src/main/resources/templates/userInfo.html
new file mode 100644
index 0000000000..1446fe2124
--- /dev/null
+++ b/spring-boot-modules/spring-boot-keycloak/src/main/resources/templates/userInfo.html
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+ Hello, --name--.
+
+
+ Your Date of Birth as per our records is .
+
+
+
+
diff --git a/spring-boot-modules/spring-boot-libraries/README.md b/spring-boot-modules/spring-boot-libraries/README.md
index 8cd3db9c93..10c56ca576 100644
--- a/spring-boot-modules/spring-boot-libraries/README.md
+++ b/spring-boot-modules/spring-boot-libraries/README.md
@@ -12,3 +12,6 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
- [Generating Barcodes and QR Codes in Java](https://www.baeldung.com/java-generating-barcodes-qr-codes)
- [Rate Limiting a Spring API Using Bucket4j](https://www.baeldung.com/spring-bucket4j)
- [Spring Boot and Caffeine Cache](https://www.baeldung.com/spring-boot-caffeine-cache)
+- [Spring Boot and Togglz Aspect](https://www.baeldung.com/spring-togglz)
+- [Getting Started with GraphQL and Spring Boot](https://www.baeldung.com/spring-graphql)
+- [An Introduction to Kong](https://www.baeldung.com/kong)
diff --git a/spring-boot-modules/spring-boot-libraries/pom.xml b/spring-boot-modules/spring-boot-libraries/pom.xml
index 05ab59aab7..3913babaa8 100644
--- a/spring-boot-modules/spring-boot-libraries/pom.xml
+++ b/spring-boot-modules/spring-boot-libraries/pom.xml
@@ -37,6 +37,36 @@
spring-boot-starter-test
test
+
+
+
+ org.togglz
+ togglz-spring-boot-starter
+ ${togglz.version}
+
+
+
+ org.togglz
+ togglz-spring-security
+ ${togglz.version}
+
+
+
+
+ com.graphql-java
+ graphql-spring-boot-starter
+ ${graphql-spring-boot-starter.version}
+
+
+ com.graphql-java
+ graphql-java-tools
+ ${graphql-java-tools.version}
+
+
+ com.graphql-java
+ graphiql-spring-boot-starter
+ ${graphql-spring-boot-starter.version}
+
@@ -216,7 +246,6 @@
1.9.0
2.0.0
5.0.2
- 5.0.2
5.2.4
18.0
2.2.4
diff --git a/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/demo/DemoApplication.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/demo/DemoApplication.java
new file mode 100644
index 0000000000..eb091b4695
--- /dev/null
+++ b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/demo/DemoApplication.java
@@ -0,0 +1,18 @@
+package com.baeldung.demo;
+
+import com.baeldung.graphql.GraphqlConfiguration;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+import org.springframework.context.annotation.Import;
+
+@SpringBootApplication
+@Import(GraphqlConfiguration.class)
+public class DemoApplication {
+
+ public static void main(String[] args) {
+ System.setProperty("spring.config.name", "demo");
+ SpringApplication.run(DemoApplication.class, args);
+ }
+
+}
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/Author.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/graphql/Author.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/Author.java
rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/graphql/Author.java
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/AuthorDao.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/graphql/AuthorDao.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/AuthorDao.java
rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/graphql/AuthorDao.java
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/AuthorResolver.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/graphql/AuthorResolver.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/AuthorResolver.java
rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/graphql/AuthorResolver.java
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/GraphqlConfiguration.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/graphql/GraphqlConfiguration.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/GraphqlConfiguration.java
rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/graphql/GraphqlConfiguration.java
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/Mutation.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/graphql/Mutation.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/Mutation.java
rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/graphql/Mutation.java
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/Post.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/graphql/Post.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/Post.java
rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/graphql/Post.java
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/PostDao.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/graphql/PostDao.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/PostDao.java
rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/graphql/PostDao.java
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/PostResolver.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/graphql/PostResolver.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/PostResolver.java
rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/graphql/PostResolver.java
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/Query.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/graphql/Query.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/Query.java
rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/graphql/Query.java
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/kong/QueryController.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/kong/QueryController.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/kong/QueryController.java
rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/kong/QueryController.java
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/kong/StockApp.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/kong/StockApp.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/kong/StockApp.java
rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/kong/StockApp.java
diff --git a/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/toggle/Employee.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/toggle/Employee.java
new file mode 100644
index 0000000000..64a8b3ce5b
--- /dev/null
+++ b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/toggle/Employee.java
@@ -0,0 +1,37 @@
+package com.baeldung.toggle;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class Employee {
+
+ @Id
+ private long id;
+ private double salary;
+
+ public Employee() {
+ }
+
+ public Employee(long id, double salary) {
+ this.id = id;
+ this.salary = salary;
+ }
+
+ public long getId() {
+ return id;
+ }
+
+ public void setId(long id) {
+ this.id = id;
+ }
+
+ public double getSalary() {
+ return salary;
+ }
+
+ public void setSalary(double salary) {
+ this.salary = salary;
+ }
+
+}
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/EmployeeRepository.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/toggle/EmployeeRepository.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/EmployeeRepository.java
rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/toggle/EmployeeRepository.java
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/FeatureAssociation.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/toggle/FeatureAssociation.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/FeatureAssociation.java
rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/toggle/FeatureAssociation.java
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/FeaturesAspect.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/toggle/FeaturesAspect.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/FeaturesAspect.java
rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/toggle/FeaturesAspect.java
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/MyFeatures.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/toggle/MyFeatures.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/MyFeatures.java
rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/toggle/MyFeatures.java
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/SalaryController.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/toggle/SalaryController.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/SalaryController.java
rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/toggle/SalaryController.java
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/SalaryService.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/toggle/SalaryService.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/SalaryService.java
rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/toggle/SalaryService.java
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/ToggleApplication.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/toggle/ToggleApplication.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/ToggleApplication.java
rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/toggle/ToggleApplication.java
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/ToggleConfiguration.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/toggle/ToggleConfiguration.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/ToggleConfiguration.java
rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/toggle/ToggleConfiguration.java
diff --git a/spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/KongAdminAPILiveTest.java b/spring-boot-modules/spring-boot-libraries/src/test/java/com/baeldung/kong/KongAdminAPILiveTest.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/KongAdminAPILiveTest.java
rename to spring-boot-modules/spring-boot-libraries/src/test/java/com/baeldung/kong/KongAdminAPILiveTest.java
diff --git a/spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/KongLoadBalanceLiveTest.java b/spring-boot-modules/spring-boot-libraries/src/test/java/com/baeldung/kong/KongLoadBalanceLiveTest.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/KongLoadBalanceLiveTest.java
rename to spring-boot-modules/spring-boot-libraries/src/test/java/com/baeldung/kong/KongLoadBalanceLiveTest.java
diff --git a/spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/domain/APIObject.java b/spring-boot-modules/spring-boot-libraries/src/test/java/com/baeldung/kong/domain/APIObject.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/domain/APIObject.java
rename to spring-boot-modules/spring-boot-libraries/src/test/java/com/baeldung/kong/domain/APIObject.java
diff --git a/spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/domain/ConsumerObject.java b/spring-boot-modules/spring-boot-libraries/src/test/java/com/baeldung/kong/domain/ConsumerObject.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/domain/ConsumerObject.java
rename to spring-boot-modules/spring-boot-libraries/src/test/java/com/baeldung/kong/domain/ConsumerObject.java
diff --git a/spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/domain/KeyAuthObject.java b/spring-boot-modules/spring-boot-libraries/src/test/java/com/baeldung/kong/domain/KeyAuthObject.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/domain/KeyAuthObject.java
rename to spring-boot-modules/spring-boot-libraries/src/test/java/com/baeldung/kong/domain/KeyAuthObject.java
diff --git a/spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/domain/PluginObject.java b/spring-boot-modules/spring-boot-libraries/src/test/java/com/baeldung/kong/domain/PluginObject.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/domain/PluginObject.java
rename to spring-boot-modules/spring-boot-libraries/src/test/java/com/baeldung/kong/domain/PluginObject.java
diff --git a/spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/domain/TargetObject.java b/spring-boot-modules/spring-boot-libraries/src/test/java/com/baeldung/kong/domain/TargetObject.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/domain/TargetObject.java
rename to spring-boot-modules/spring-boot-libraries/src/test/java/com/baeldung/kong/domain/TargetObject.java
diff --git a/spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/domain/UpstreamObject.java b/spring-boot-modules/spring-boot-libraries/src/test/java/com/baeldung/kong/domain/UpstreamObject.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/domain/UpstreamObject.java
rename to spring-boot-modules/spring-boot-libraries/src/test/java/com/baeldung/kong/domain/UpstreamObject.java
diff --git a/spring-boot-modules/spring-boot/src/test/java/com/baeldung/toggle/ToggleIntegrationTest.java b/spring-boot-modules/spring-boot-libraries/src/test/java/com/baeldung/toggle/ToggleIntegrationTest.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/test/java/com/baeldung/toggle/ToggleIntegrationTest.java
rename to spring-boot-modules/spring-boot-libraries/src/test/java/com/baeldung/toggle/ToggleIntegrationTest.java
diff --git a/spring-boot-modules/spring-boot-mvc/README.md b/spring-boot-modules/spring-boot-mvc/README.md
index 41b98063a6..5e9ecded10 100644
--- a/spring-boot-modules/spring-boot-mvc/README.md
+++ b/spring-boot-modules/spring-boot-mvc/README.md
@@ -9,4 +9,6 @@ This module contains articles about Spring Web MVC in Spring Boot projects.
- [A Controller, Service and DAO Example with Spring Boot and JSF](https://www.baeldung.com/jsf-spring-boot-controller-service-dao)
- [Setting Up Swagger 2 with a Spring REST API](https://www.baeldung.com/swagger-2-documentation-for-spring-rest-api)
- [Using Spring ResponseEntity to Manipulate the HTTP Response](https://www.baeldung.com/spring-response-entity)
+- [The @ServletComponentScan Annotation in Spring Boot](https://www.baeldung.com/spring-servletcomponentscan)
+- [Guide to Internationalization in Spring Boot](https://www.baeldung.com/spring-boot-internationalization)
- More articles: [[next -->]](/spring-boot-modules/spring-boot-mvc-2)
diff --git a/spring-boot-modules/spring-boot-mvc/pom.xml b/spring-boot-modules/spring-boot-mvc/pom.xml
index 39046ee6d9..560ea1cffa 100644
--- a/spring-boot-modules/spring-boot-mvc/pom.xml
+++ b/spring-boot-modules/spring-boot-mvc/pom.xml
@@ -17,15 +17,6 @@
spring-boot-mvc
Module For Spring Boot MVC
-
-
-
- jcenter-release
- jcenter
- http://oss.jfrog.org/artifactory/oss-release-local/
-
-
-
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/SpringBootAnnotatedApp.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotation/servletcomponentscan/SpringBootAnnotatedApp.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/SpringBootAnnotatedApp.java
rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotation/servletcomponentscan/SpringBootAnnotatedApp.java
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/SpringBootPlainApp.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotation/servletcomponentscan/SpringBootPlainApp.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/SpringBootPlainApp.java
rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotation/servletcomponentscan/SpringBootPlainApp.java
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/components/AttrListener.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotation/servletcomponentscan/components/AttrListener.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/components/AttrListener.java
rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotation/servletcomponentscan/components/AttrListener.java
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/components/EchoServlet.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotation/servletcomponentscan/components/EchoServlet.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/components/EchoServlet.java
rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotation/servletcomponentscan/components/EchoServlet.java
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/components/HelloFilter.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotation/servletcomponentscan/components/HelloFilter.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/components/HelloFilter.java
rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotation/servletcomponentscan/components/HelloFilter.java
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/components/HelloServlet.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotation/servletcomponentscan/components/HelloServlet.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/components/HelloServlet.java
rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotation/servletcomponentscan/components/HelloServlet.java
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/internationalization/InternationalizationApp.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/internationalization/InternationalizationApp.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/internationalization/InternationalizationApp.java
rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/internationalization/InternationalizationApp.java
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/internationalization/config/MvcConfig.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/internationalization/config/MvcConfig.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/internationalization/config/MvcConfig.java
rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/internationalization/config/MvcConfig.java
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/internationalization/config/PageController.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/internationalization/config/PageController.java
similarity index 87%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/internationalization/config/PageController.java
rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/internationalization/config/PageController.java
index 96a534b853..efa55b8b33 100644
--- a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/internationalization/config/PageController.java
+++ b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/internationalization/config/PageController.java
@@ -8,7 +8,7 @@ public class PageController {
@GetMapping("/international")
public String getInternationalPage() {
- return "international";
+ return "thymeleaf/international";
}
}
diff --git a/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/configuration/SpringFoxConfig.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/configuration/SpringFoxConfig.java
index b404b0c2f8..5998ffeb2a 100644
--- a/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/configuration/SpringFoxConfig.java
+++ b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/configuration/SpringFoxConfig.java
@@ -22,7 +22,6 @@ import springfox.documentation.swagger.web.UiConfigurationBuilder;
import java.util.Collections;
@Configuration
-@Import({SpringDataRestConfiguration.class, BeanValidatorPluginsConfiguration.class})
public class SpringFoxConfig {
private ApiInfo apiInfo() {
diff --git a/spring-boot-modules/spring-boot-mvc/src/main/resources/messages.properties b/spring-boot-modules/spring-boot-mvc/src/main/resources/messages.properties
index 9794c89651..8f956fe5be 100644
--- a/spring-boot-modules/spring-boot-mvc/src/main/resources/messages.properties
+++ b/spring-boot-modules/spring-boot-mvc/src/main/resources/messages.properties
@@ -1 +1,5 @@
-email.notempty=Please provide valid email id.
\ No newline at end of file
+email.notempty=Please provide valid email id.
+greeting=Hello! Welcome to our website!
+lang.change=Change the language
+lang.eng=English
+lang.fr=French
\ No newline at end of file
diff --git a/spring-boot-modules/spring-boot-mvc/src/main/resources/messages_fr.properties b/spring-boot-modules/spring-boot-mvc/src/main/resources/messages_fr.properties
index 070f4e0bfc..7ced0d7b0d 100644
--- a/spring-boot-modules/spring-boot-mvc/src/main/resources/messages_fr.properties
+++ b/spring-boot-modules/spring-boot-mvc/src/main/resources/messages_fr.properties
@@ -1 +1,5 @@
-email.notempty=Veuillez fournir un identifiant de messagerie valide.
\ No newline at end of file
+email.notempty=Veuillez fournir un identifiant de messagerie valide.
+greeting=Bonjour! Bienvenue sur notre site!
+lang.change=Changez la langue
+lang.eng=Anglais
+lang.fr=Francais
diff --git a/spring-boot-modules/spring-boot/src/main/resources/static/internationalization.js b/spring-boot-modules/spring-boot-mvc/src/main/resources/static/internationalization.js
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/resources/static/internationalization.js
rename to spring-boot-modules/spring-boot-mvc/src/main/resources/static/internationalization.js
diff --git a/spring-boot-modules/spring-boot/src/main/resources/templates/international.html b/spring-boot-modules/spring-boot-mvc/src/main/resources/templates/thymeleaf/international.html
similarity index 100%
rename from spring-boot-modules/spring-boot/src/main/resources/templates/international.html
rename to spring-boot-modules/spring-boot-mvc/src/main/resources/templates/thymeleaf/international.html
diff --git a/spring-boot-modules/spring-boot-mvc/src/test/java/org/baeldung/SpringContextLiveTest.java b/spring-boot-modules/spring-boot-mvc/src/test/java/com/baeldung/SpringContextLiveTest.java
similarity index 100%
rename from spring-boot-modules/spring-boot-mvc/src/test/java/org/baeldung/SpringContextLiveTest.java
rename to spring-boot-modules/spring-boot-mvc/src/test/java/com/baeldung/SpringContextLiveTest.java
diff --git a/spring-boot-modules/spring-boot-mvc/src/test/java/org/baeldung/SpringContextTest.java b/spring-boot-modules/spring-boot-mvc/src/test/java/com/baeldung/SpringContextTest.java
similarity index 100%
rename from spring-boot-modules/spring-boot-mvc/src/test/java/org/baeldung/SpringContextTest.java
rename to spring-boot-modules/spring-boot-mvc/src/test/java/com/baeldung/SpringContextTest.java
diff --git a/spring-boot-modules/spring-boot/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithServletComponentIntegrationTest.java b/spring-boot-modules/spring-boot-mvc/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithServletComponentIntegrationTest.java
similarity index 94%
rename from spring-boot-modules/spring-boot/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithServletComponentIntegrationTest.java
rename to spring-boot-modules/spring-boot-mvc/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithServletComponentIntegrationTest.java
index 8c85934fac..92223892d9 100644
--- a/spring-boot-modules/spring-boot/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithServletComponentIntegrationTest.java
+++ b/spring-boot-modules/spring-boot-mvc/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithServletComponentIntegrationTest.java
@@ -1,23 +1,21 @@
package com.baeldung.annotation.servletcomponentscan;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.boot.test.web.client.TestRestTemplate;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit4.SpringRunner;
-
-import javax.servlet.FilterRegistration;
-import javax.servlet.ServletContext;
-
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
+import javax.servlet.FilterRegistration;
+import javax.servlet.ServletContext;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.test.web.client.TestRestTemplate;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.test.context.junit4.SpringRunner;
+
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = SpringBootAnnotatedApp.class)
public class SpringBootWithServletComponentIntegrationTest {
diff --git a/spring-boot-modules/spring-boot/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithoutServletComponentIntegrationTest.java b/spring-boot-modules/spring-boot-mvc/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithoutServletComponentIntegrationTest.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithoutServletComponentIntegrationTest.java
rename to spring-boot-modules/spring-boot-mvc/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithoutServletComponentIntegrationTest.java
diff --git a/spring-boot-modules/spring-boot-security/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-security/src/main/resources/logback.xml
index 7d900d8ea8..73dd672c1a 100644
--- a/spring-boot-modules/spring-boot-security/src/main/resources/logback.xml
+++ b/spring-boot-modules/spring-boot-security/src/main/resources/logback.xml
@@ -7,7 +7,7 @@
-
+
\ No newline at end of file
diff --git a/spring-boot-modules/spring-boot-security/src/test/resources/application.properties b/spring-boot-modules/spring-boot-security/src/test/resources/application.properties
new file mode 100644
index 0000000000..5494069009
--- /dev/null
+++ b/spring-boot-modules/spring-boot-security/src/test/resources/application.properties
@@ -0,0 +1,2 @@
+logging.level.root=ERROR
+logging.level.com.baeldung.integrationtesting=ERROR
diff --git a/spring-boot-modules/spring-boot-springdoc/src/test/resources/logback.xml b/spring-boot-modules/spring-boot-springdoc/src/test/resources/logback.xml
new file mode 100644
index 0000000000..ab4a5f3a20
--- /dev/null
+++ b/spring-boot-modules/spring-boot-springdoc/src/test/resources/logback.xml
@@ -0,0 +1,12 @@
+
+
+
+
+ [%d{ISO8601}]-[%thread] %-5level %logger - %msg%n
+
+
+
+
+
+
+
diff --git a/spring-boot-modules/spring-boot-swagger/pom.xml b/spring-boot-modules/spring-boot-swagger/pom.xml
new file mode 100644
index 0000000000..4e0180460d
--- /dev/null
+++ b/spring-boot-modules/spring-boot-swagger/pom.xml
@@ -0,0 +1,41 @@
+
+
+ 4.0.0
+
+
+ com.baeldung.spring-boot-modules
+ spring-boot-modules
+ 1.0.0-SNAPSHOT
+ ../
+
+
+ spring-boot-swagger
+ 0.1.0-SNAPSHOT
+ spring-boot-swagger
+ jar
+
+ Module For Spring Boot Swagger
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ io.springfox
+ springfox-boot-starter
+ 3.0.0
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+
+
diff --git a/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swagger2boot/SpringBootSwaggerApplication.java b/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swagger2boot/SpringBootSwaggerApplication.java
new file mode 100644
index 0000000000..911c29a4f6
--- /dev/null
+++ b/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swagger2boot/SpringBootSwaggerApplication.java
@@ -0,0 +1,13 @@
+package com.baeldung.swagger2boot;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class SpringBootSwaggerApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(SpringBootSwaggerApplication.class, args);
+ }
+
+}
\ No newline at end of file
diff --git a/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swagger2boot/configuration/SwaggerConfiguration.java b/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swagger2boot/configuration/SwaggerConfiguration.java
new file mode 100644
index 0000000000..4f85d90f5f
--- /dev/null
+++ b/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swagger2boot/configuration/SwaggerConfiguration.java
@@ -0,0 +1,63 @@
+package com.baeldung.swagger2boot.configuration;
+
+import java.util.Collections;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.service.Contact;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger.web.DocExpansion;
+import springfox.documentation.swagger.web.ModelRendering;
+import springfox.documentation.swagger.web.OperationsSorter;
+import springfox.documentation.swagger.web.TagsSorter;
+import springfox.documentation.swagger.web.UiConfiguration;
+import springfox.documentation.swagger.web.UiConfigurationBuilder;
+
+@Configuration
+public class SwaggerConfiguration {
+
+ private ApiInfo apiInfo() {
+ return new ApiInfo("My REST API", "Some custom description of API.", "API TOS", "Terms of service",
+ new Contact("Umang Budhwar", "www.baeldung.com", "umangbudhwar@gmail.com"),
+ "License of API", "API license URL", Collections.emptyList());
+ }
+
+ @Bean
+ public Docket api() {
+ return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo())
+ .select()
+ .apis(RequestHandlerSelectors.any())
+ .paths(PathSelectors.any())
+ .build();
+ }
+
+ /**
+ * SwaggerUI information
+ */
+
+ @Bean
+ UiConfiguration uiConfig() {
+ return UiConfigurationBuilder.builder()
+ .deepLinking(true)
+ .displayOperationId(false)
+ .defaultModelsExpandDepth(1)
+ .defaultModelExpandDepth(1)
+ .defaultModelRendering(ModelRendering.EXAMPLE)
+ .displayRequestDuration(false)
+ .docExpansion(DocExpansion.NONE)
+ .filter(false)
+ .maxDisplayedTags(null)
+ .operationsSorter(OperationsSorter.ALPHA)
+ .showExtensions(false)
+ .tagsSorter(TagsSorter.ALPHA)
+ .supportedSubmitMethods(UiConfiguration.Constants.DEFAULT_SUBMIT_METHODS)
+ .validatorUrl(null)
+ .build();
+ }
+
+}
diff --git a/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swagger2boot/controller/RegularRestController.java b/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swagger2boot/controller/RegularRestController.java
new file mode 100644
index 0000000000..5218092c21
--- /dev/null
+++ b/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swagger2boot/controller/RegularRestController.java
@@ -0,0 +1,35 @@
+package com.baeldung.swagger2boot.controller;
+
+import java.time.LocalDate;
+import java.time.LocalTime;
+
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import io.swagger.annotations.ApiOperation;
+import springfox.documentation.annotations.ApiIgnore;
+
+@ApiIgnore
+@RestController
+public class RegularRestController {
+
+ @ApiIgnore
+ @ApiOperation(value = "This method is used to get the author name.")
+ @GetMapping("/getAuthor")
+ public String getAuthor() {
+ return "Umang Budhwar";
+ }
+
+ @ApiOperation(value = "This method is used to get the current date.", hidden = true)
+ @GetMapping("/getDate")
+ public LocalDate getDate() {
+ return LocalDate.now();
+ }
+
+ @ApiOperation(value = "This method is used to get the current time.")
+ @GetMapping("/getTime")
+ public LocalTime getTime() {
+ return LocalTime.now();
+ }
+
+}
\ No newline at end of file
diff --git a/spring-boot-modules/spring-boot-swagger/src/main/resources/application.properties b/spring-boot-modules/spring-boot-swagger/src/main/resources/application.properties
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/spring-boot-modules/spring-boot-testing/README.md b/spring-boot-modules/spring-boot-testing/README.md
index 192f5cee99..1b7ad661c6 100644
--- a/spring-boot-modules/spring-boot-testing/README.md
+++ b/spring-boot-modules/spring-boot-testing/README.md
@@ -14,3 +14,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
- [Embedded Redis Server with Spring Boot Test](https://www.baeldung.com/spring-embedded-redis)
- [Testing Spring Boot @ConfigurationProperties](https://www.baeldung.com/spring-boot-testing-configurationproperties)
- [Prevent ApplicationRunner or CommandLineRunner Beans From Executing During Junit Testing](https://www.baeldung.com/spring-junit-prevent-runner-beans-testing-execution)
+- [Testing in Spring Boot](https://www.baeldung.com/spring-boot-testing)
diff --git a/spring-boot-modules/spring-boot-testing/pom.xml b/spring-boot-modules/spring-boot-testing/pom.xml
index a3b176af88..bd5ef901dd 100644
--- a/spring-boot-modules/spring-boot-testing/pom.xml
+++ b/spring-boot-modules/spring-boot-testing/pom.xml
@@ -34,6 +34,14 @@
org.springframework.boot
spring-boot-starter-security
+
+ org.springframework.boot
+ spring-boot-starter-data-jpa
+
+
+ com.h2database
+ h2
+
org.springframework.boot
spring-boot-starter-test
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/demo/boottest/Employee.java b/spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/testing/Employee.java
similarity index 95%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/demo/boottest/Employee.java
rename to spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/testing/Employee.java
index fa3c1dc809..2921ecc609 100644
--- a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/demo/boottest/Employee.java
+++ b/spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/testing/Employee.java
@@ -1,4 +1,4 @@
-package com.baeldung.demo.boottest;
+package com.baeldung.boot.testing;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/demo/boottest/EmployeeRepository.java b/spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/testing/EmployeeRepository.java
similarity index 91%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/demo/boottest/EmployeeRepository.java
rename to spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/testing/EmployeeRepository.java
index b6850d587e..bcef5231e0 100644
--- a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/demo/boottest/EmployeeRepository.java
+++ b/spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/testing/EmployeeRepository.java
@@ -1,4 +1,4 @@
-package com.baeldung.demo.boottest;
+package com.baeldung.boot.testing;
import java.util.List;
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/demo/boottest/EmployeeRestController.java b/spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/testing/EmployeeRestController.java
similarity index 96%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/demo/boottest/EmployeeRestController.java
rename to spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/testing/EmployeeRestController.java
index 7d2e06d4a0..b52d38e028 100644
--- a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/demo/boottest/EmployeeRestController.java
+++ b/spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/testing/EmployeeRestController.java
@@ -1,4 +1,4 @@
-package com.baeldung.demo.boottest;
+package com.baeldung.boot.testing;
import java.util.List;
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/demo/boottest/EmployeeService.java b/spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/testing/EmployeeService.java
similarity index 89%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/demo/boottest/EmployeeService.java
rename to spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/testing/EmployeeService.java
index ff1976cad1..6fc48a3c3d 100644
--- a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/demo/boottest/EmployeeService.java
+++ b/spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/testing/EmployeeService.java
@@ -1,4 +1,4 @@
-package com.baeldung.demo.boottest;
+package com.baeldung.boot.testing;
import java.util.List;
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/demo/boottest/EmployeeServiceImpl.java b/spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/testing/EmployeeServiceImpl.java
similarity index 96%
rename from spring-boot-modules/spring-boot/src/main/java/com/baeldung/demo/boottest/EmployeeServiceImpl.java
rename to spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/testing/EmployeeServiceImpl.java
index 156fc571f3..7d5ec4a05d 100644
--- a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/demo/boottest/EmployeeServiceImpl.java
+++ b/spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/testing/EmployeeServiceImpl.java
@@ -1,4 +1,4 @@
-package com.baeldung.demo.boottest;
+package com.baeldung.boot.testing;
import java.util.List;
diff --git a/spring-boot-modules/spring-boot-testing/src/main/resources/application.properties b/spring-boot-modules/spring-boot-testing/src/main/resources/application.properties
index 8dc7f6e3c3..daab3e8d2c 100644
--- a/spring-boot-modules/spring-boot-testing/src/main/resources/application.properties
+++ b/spring-boot-modules/spring-boot-testing/src/main/resources/application.properties
@@ -4,4 +4,6 @@ spring.redis.port= 6379
# security
spring.security.user.name=john
-spring.security.user.password=123
\ No newline at end of file
+spring.security.user.password=123
+
+spring.main.allow-bean-definition-overriding=true
\ No newline at end of file
diff --git a/spring-boot-modules/spring-boot-testing/src/main/resources/persistence-generic-entity.properties b/spring-boot-modules/spring-boot-testing/src/main/resources/persistence-generic-entity.properties
new file mode 100644
index 0000000000..b19304cb1f
--- /dev/null
+++ b/spring-boot-modules/spring-boot-testing/src/main/resources/persistence-generic-entity.properties
@@ -0,0 +1,8 @@
+jdbc.driverClassName=org.h2.Driver
+jdbc.url=jdbc:h2:mem:db;DB_CLOSE_DELAY=-1
+jdbc.user=sa
+jdbc.pass=sa
+
+hibernate.dialect=org.hibernate.dialect.H2Dialect
+hibernate.show_sql=true
+hibernate.hbm2ddl.auto=create-drop
diff --git a/spring-boot-modules/spring-boot/src/test/java/com/baeldung/demo/boottest/EmployeeControllerIntegrationTest.java b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/testing/EmployeeControllerIntegrationTest.java
similarity index 87%
rename from spring-boot-modules/spring-boot/src/test/java/com/baeldung/demo/boottest/EmployeeControllerIntegrationTest.java
rename to spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/testing/EmployeeControllerIntegrationTest.java
index 962abf0fa3..c51113a023 100644
--- a/spring-boot-modules/spring-boot/src/test/java/com/baeldung/demo/boottest/EmployeeControllerIntegrationTest.java
+++ b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/testing/EmployeeControllerIntegrationTest.java
@@ -1,19 +1,4 @@
-package com.baeldung.demo.boottest;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mockito;
-import org.mockito.internal.verification.VerificationModeFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
-import org.springframework.boot.test.mock.mockito.MockBean;
-import org.springframework.http.MediaType;
-import org.springframework.test.context.junit4.SpringRunner;
-import org.springframework.test.web.servlet.MockMvc;
-
-import java.util.Arrays;
-import java.util.List;
+package com.baeldung.boot.testing;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.hasSize;
@@ -25,8 +10,28 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
+import java.util.Arrays;
+import java.util.List;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mockito;
+import org.mockito.internal.verification.VerificationModeFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
+import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
+import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.http.MediaType;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.test.web.servlet.MockMvc;
+
+import com.baeldung.boot.testing.Employee;
+import com.baeldung.boot.testing.EmployeeRestController;
+import com.baeldung.boot.testing.EmployeeService;
+
@RunWith(SpringRunner.class)
-@WebMvcTest(EmployeeRestController.class)
+@WebMvcTest(value = EmployeeRestController.class, excludeAutoConfiguration = SecurityAutoConfiguration.class)
public class EmployeeControllerIntegrationTest {
@Autowired
diff --git a/spring-boot-modules/spring-boot/src/test/java/com/baeldung/demo/boottest/EmployeeRepositoryIntegrationTest.java b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/testing/EmployeeRepositoryIntegrationTest.java
similarity index 94%
rename from spring-boot-modules/spring-boot/src/test/java/com/baeldung/demo/boottest/EmployeeRepositoryIntegrationTest.java
rename to spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/testing/EmployeeRepositoryIntegrationTest.java
index 164887886b..b3a7316764 100644
--- a/spring-boot-modules/spring-boot/src/test/java/com/baeldung/demo/boottest/EmployeeRepositoryIntegrationTest.java
+++ b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/testing/EmployeeRepositoryIntegrationTest.java
@@ -1,7 +1,5 @@
-package com.baeldung.demo.boottest;
+package com.baeldung.boot.testing;
-import com.baeldung.demo.boottest.Employee;
-import com.baeldung.demo.boottest.EmployeeRepository;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
@@ -9,6 +7,9 @@ import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager;
import org.springframework.test.context.junit4.SpringRunner;
+import com.baeldung.boot.testing.Employee;
+import com.baeldung.boot.testing.EmployeeRepository;
+
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
diff --git a/spring-boot-modules/spring-boot/src/test/java/com/baeldung/demo/boottest/EmployeeRestControllerIntegrationTest.java b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/testing/EmployeeRestControllerIntegrationTest.java
similarity index 87%
rename from spring-boot-modules/spring-boot/src/test/java/com/baeldung/demo/boottest/EmployeeRestControllerIntegrationTest.java
rename to spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/testing/EmployeeRestControllerIntegrationTest.java
index 327e9f9d56..d13fcd79aa 100644
--- a/spring-boot-modules/spring-boot/src/test/java/com/baeldung/demo/boottest/EmployeeRestControllerIntegrationTest.java
+++ b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/testing/EmployeeRestControllerIntegrationTest.java
@@ -1,4 +1,4 @@
-package com.baeldung.demo.boottest;
+package com.baeldung.boot.testing;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.CoreMatchers.is;
@@ -14,11 +14,12 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
import java.io.IOException;
import java.util.List;
-import com.baeldung.demo.DemoApplication;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
@@ -27,9 +28,14 @@ import org.springframework.http.MediaType;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
+import com.baeldung.boot.Application;
+import com.baeldung.boot.testing.Employee;
+import com.baeldung.boot.testing.EmployeeRepository;
+
@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, classes = DemoApplication.class)
+@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, classes = Application.class)
@AutoConfigureMockMvc
+@EnableAutoConfiguration(exclude=SecurityAutoConfiguration.class)
// @TestPropertySource(locations = "classpath:application-integrationtest.properties")
@AutoConfigureTestDatabase
public class EmployeeRestControllerIntegrationTest {
diff --git a/spring-boot-modules/spring-boot/src/test/java/com/baeldung/demo/boottest/EmployeeServiceImplIntegrationTest.java b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/testing/EmployeeServiceImplIntegrationTest.java
similarity index 94%
rename from spring-boot-modules/spring-boot/src/test/java/com/baeldung/demo/boottest/EmployeeServiceImplIntegrationTest.java
rename to spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/testing/EmployeeServiceImplIntegrationTest.java
index 88f2830a2b..3176a7c75a 100644
--- a/spring-boot-modules/spring-boot/src/test/java/com/baeldung/demo/boottest/EmployeeServiceImplIntegrationTest.java
+++ b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/testing/EmployeeServiceImplIntegrationTest.java
@@ -1,4 +1,4 @@
-package com.baeldung.demo.boottest;
+package com.baeldung.boot.testing;
import static org.assertj.core.api.Assertions.assertThat;
@@ -6,10 +6,6 @@ import java.util.Arrays;
import java.util.List;
import java.util.Optional;
-import com.baeldung.demo.boottest.Employee;
-import com.baeldung.demo.boottest.EmployeeRepository;
-import com.baeldung.demo.boottest.EmployeeService;
-import com.baeldung.demo.boottest.EmployeeServiceImpl;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -21,6 +17,11 @@ import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.context.annotation.Bean;
import org.springframework.test.context.junit4.SpringRunner;
+import com.baeldung.boot.testing.Employee;
+import com.baeldung.boot.testing.EmployeeRepository;
+import com.baeldung.boot.testing.EmployeeService;
+import com.baeldung.boot.testing.EmployeeServiceImpl;
+
@RunWith(SpringRunner.class)
public class EmployeeServiceImplIntegrationTest {
diff --git a/spring-boot-modules/spring-boot/src/test/java/com/baeldung/demo/boottest/JsonUtil.java b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/testing/JsonUtil.java
similarity index 91%
rename from spring-boot-modules/spring-boot/src/test/java/com/baeldung/demo/boottest/JsonUtil.java
rename to spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/testing/JsonUtil.java
index 3fcd709f7c..49d018dde8 100644
--- a/spring-boot-modules/spring-boot/src/test/java/com/baeldung/demo/boottest/JsonUtil.java
+++ b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/testing/JsonUtil.java
@@ -1,4 +1,4 @@
-package com.baeldung.demo.boottest;
+package com.baeldung.boot.testing;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.ObjectMapper;
diff --git a/spring-boot-modules/spring-boot/src/test/resources/application-integrationtest.properties b/spring-boot-modules/spring-boot-testing/src/test/resources/application-integrationtest.properties
similarity index 100%
rename from spring-boot-modules/spring-boot/src/test/resources/application-integrationtest.properties
rename to spring-boot-modules/spring-boot-testing/src/test/resources/application-integrationtest.properties
diff --git a/spring-boot-modules/spring-boot-testing/src/test/resources/application.properties b/spring-boot-modules/spring-boot-testing/src/test/resources/application.properties
index 0c5b0e13e6..1810c7b1eb 100644
--- a/spring-boot-modules/spring-boot-testing/src/test/resources/application.properties
+++ b/spring-boot-modules/spring-boot-testing/src/test/resources/application.properties
@@ -3,4 +3,6 @@ spring.redis.host= localhost
spring.redis.port= 6370
# security
spring.security.user.name=john
-spring.security.user.password=123
\ No newline at end of file
+spring.security.user.password=123
+
+spring.main.allow-bean-definition-overriding=true
\ No newline at end of file
diff --git a/spring-boot-modules/spring-boot/README.MD b/spring-boot-modules/spring-boot/README.md
similarity index 62%
rename from spring-boot-modules/spring-boot/README.MD
rename to spring-boot-modules/spring-boot/README.md
index c95fe51842..5a45502fd8 100644
--- a/spring-boot-modules/spring-boot/README.MD
+++ b/spring-boot-modules/spring-boot/README.md
@@ -8,18 +8,10 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
### Relevant Articles:
- [A Guide to Spring in Eclipse STS](https://www.baeldung.com/eclipse-sts-spring)
-- [The @ServletComponentScan Annotation in Spring Boot](https://www.baeldung.com/spring-servletcomponentscan)
- [How to Register a Servlet in Java](https://www.baeldung.com/register-servlet)
- [Guide to Spring WebUtils and ServletRequestUtils](https://www.baeldung.com/spring-webutils-servletrequestutils)
-- [Guide to Internationalization in Spring Boot](https://www.baeldung.com/spring-boot-internationalization)
- [Dynamic DTO Validation Config Retrieved from the Database](https://www.baeldung.com/spring-dynamic-dto-validation)
-- [Custom Information in Spring Boot Info Endpoint](https://www.baeldung.com/spring-boot-info-actuator-custom)
-- [Testing in Spring Boot](https://www.baeldung.com/spring-boot-testing)
-- [How to Get All Spring-Managed Beans?](https://www.baeldung.com/spring-show-all-beans)
-- [Spring Boot and Togglz Aspect](https://www.baeldung.com/spring-togglz)
-- [Getting Started with GraphQL and Spring Boot](https://www.baeldung.com/spring-graphql)
- [Guide to Spring Type Conversions](https://www.baeldung.com/spring-type-conversions)
-- [An Introduction to Kong](https://www.baeldung.com/kong)
- [Spring Boot: Configuring a Main Class](https://www.baeldung.com/spring-boot-main-class)
- [A Quick Intro to the SpringBootServletInitializer](https://www.baeldung.com/spring-boot-servlet-initializer)
- [Spring Shutdown Callbacks](https://www.baeldung.com/spring-shutdown-callbacks)
diff --git a/spring-boot-modules/spring-boot/pom.xml b/spring-boot-modules/spring-boot/pom.xml
index e1299a6a16..5efcffdf03 100644
--- a/spring-boot-modules/spring-boot/pom.xml
+++ b/spring-boot-modules/spring-boot/pom.xml
@@ -44,22 +44,6 @@
spring-boot-starter-actuator
-
- com.graphql-java
- graphql-spring-boot-starter
- ${graphql-spring-boot-starter.version}
-
-
- com.graphql-java
- graphql-java-tools
- ${graphql-java-tools.version}
-
-
- com.graphql-java
- graphiql-spring-boot-starter
- ${graphiql-spring-boot-starter.version}
-
-
org.springframework.boot
spring-boot-starter-tomcat
@@ -104,18 +88,6 @@
provided
-
- org.togglz
- togglz-spring-boot-starter
- ${togglz.version}
-
-
-
- org.togglz
- togglz-spring-security
- ${togglz.version}
-
-
org.apache.activemq
artemis-server
@@ -204,11 +176,7 @@
com.baeldung.intro.App
8.5.11
- 2.4.1.Final
1.9.0
- 5.0.2
- 5.0.2
- 5.2.4
18.0
@
diff --git a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/demo/DemoApplication.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/demo/DemoApplication.java
index eb091b4695..d2bb217c2f 100644
--- a/spring-boot-modules/spring-boot/src/main/java/com/baeldung/demo/DemoApplication.java
+++ b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/demo/DemoApplication.java
@@ -1,13 +1,9 @@
package com.baeldung.demo;
-import com.baeldung.graphql.GraphqlConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.Import;
-
@SpringBootApplication
-@Import(GraphqlConfiguration.class)
public class DemoApplication {
public static void main(String[] args) {
diff --git a/spring-boot-modules/spring-boot/src/main/resources/application.properties b/spring-boot-modules/spring-boot/src/main/resources/application.properties
index 44649fc1c0..142e6c8e6f 100644
--- a/spring-boot-modules/spring-boot/src/main/resources/application.properties
+++ b/spring-boot-modules/spring-boot/src/main/resources/application.properties
@@ -21,12 +21,6 @@ spring.jmx.enabled=true
## for pretty printing of json when endpoints accessed over HTTP
http.mappers.jsonPrettyPrint=true
-## Configuring info endpoint
-info.app.name=Spring Sample Application
-info.app.description=This is my first spring boot application G1
-info.app.version=1.0.0
-info.java-vendor = ${java.specification.vendor}
-
logging.level.org.springframework=INFO
#Servlet Configuration
diff --git a/spring-boot-modules/spring-boot/src/main/resources/messages.properties b/spring-boot-modules/spring-boot/src/main/resources/messages.properties
deleted file mode 100644
index e4dbc44c3f..0000000000
--- a/spring-boot-modules/spring-boot/src/main/resources/messages.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-greeting=Hello! Welcome to our website!
-lang.change=Change the language
-lang.eng=English
-lang.fr=French
\ No newline at end of file
diff --git a/spring-boot-modules/spring-boot/src/main/resources/messages_fr.properties b/spring-boot-modules/spring-boot/src/main/resources/messages_fr.properties
deleted file mode 100644
index ac5853717d..0000000000
--- a/spring-boot-modules/spring-boot/src/main/resources/messages_fr.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-greeting=Bonjour! Bienvenue sur notre site!
-lang.change=Changez la langue
-lang.eng=Anglais
-lang.fr=Francais
\ No newline at end of file
diff --git a/spring-cloud/spring-cloud-ribbon-retry/pom.xml b/spring-cloud/spring-cloud-ribbon-retry/pom.xml
index 5318ea6913..27037d6710 100644
--- a/spring-cloud/spring-cloud-ribbon-retry/pom.xml
+++ b/spring-cloud/spring-cloud-ribbon-retry/pom.xml
@@ -33,8 +33,20 @@
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ ${maven-surefire-plugin.version}
+
+ 0
+
+
+
+
+
Hoxton.SR3
-
\ No newline at end of file
diff --git a/spring-cloud/spring-cloud-ribbon-retry/ribbon-client-service/src/test/java/com/baeldung/spring/cloud/ribbon/retry/RibbonRetryFailureIntegrationTest.java b/spring-cloud/spring-cloud-ribbon-retry/ribbon-client-service/src/test/java/com/baeldung/spring/cloud/ribbon/retry/RibbonRetryFailureIntegrationTest.java
index 0f0a1c4255..decb77e7b9 100644
--- a/spring-cloud/spring-cloud-ribbon-retry/ribbon-client-service/src/test/java/com/baeldung/spring/cloud/ribbon/retry/RibbonRetryFailureIntegrationTest.java
+++ b/spring-cloud/spring-cloud-ribbon-retry/ribbon-client-service/src/test/java/com/baeldung/spring/cloud/ribbon/retry/RibbonRetryFailureIntegrationTest.java
@@ -1,5 +1,6 @@
package com.baeldung.spring.cloud.ribbon.retry;
+import org.apache.catalina.webresources.TomcatURLStreamHandlerFactory;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
@@ -24,6 +25,7 @@ public class RibbonRetryFailureIntegrationTest {
@BeforeAll
public static void setup() {
+ TomcatURLStreamHandlerFactory.disable();
weatherServiceInstance1 = startApp(8021);
weatherServiceInstance2 = startApp(8022);
}
diff --git a/spring-cloud/spring-cloud-ribbon-retry/ribbon-client-service/src/test/java/com/baeldung/spring/cloud/ribbon/retry/RibbonRetrySuccessIntegrationTest.java b/spring-cloud/spring-cloud-ribbon-retry/ribbon-client-service/src/test/java/com/baeldung/spring/cloud/ribbon/retry/RibbonRetrySuccessIntegrationTest.java
index 6fdad0f2a9..dc50fe76e6 100644
--- a/spring-cloud/spring-cloud-ribbon-retry/ribbon-client-service/src/test/java/com/baeldung/spring/cloud/ribbon/retry/RibbonRetrySuccessIntegrationTest.java
+++ b/spring-cloud/spring-cloud-ribbon-retry/ribbon-client-service/src/test/java/com/baeldung/spring/cloud/ribbon/retry/RibbonRetrySuccessIntegrationTest.java
@@ -1,5 +1,6 @@
package com.baeldung.spring.cloud.ribbon.retry;
+import org.apache.catalina.webresources.TomcatURLStreamHandlerFactory;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
@@ -25,6 +26,7 @@ public class RibbonRetrySuccessIntegrationTest {
@BeforeAll
public static void setup() {
+ TomcatURLStreamHandlerFactory.disable();
weatherServiceInstance1 = startApp(8021);
weatherServiceInstance2 = startApp(8022);
}
diff --git a/spring-cloud/spring-cloud-zuul-fallback/api-gateway/src/test/resources/logback.xml b/spring-cloud/spring-cloud-zuul-fallback/api-gateway/src/test/resources/logback.xml
new file mode 100644
index 0000000000..ab4a5f3a20
--- /dev/null
+++ b/spring-cloud/spring-cloud-zuul-fallback/api-gateway/src/test/resources/logback.xml
@@ -0,0 +1,12 @@
+
+
+
+
+ [%d{ISO8601}]-[%thread] %-5level %logger - %msg%n
+
+
+
+
+
+
+
diff --git a/spring-cloud/spring-cloud-zuul/spring-zuul-rate-limiting/src/test/resources/application.properties b/spring-cloud/spring-cloud-zuul/spring-zuul-rate-limiting/src/test/resources/application.properties
new file mode 100644
index 0000000000..640fb2c6a4
--- /dev/null
+++ b/spring-cloud/spring-cloud-zuul/spring-zuul-rate-limiting/src/test/resources/application.properties
@@ -0,0 +1 @@
+logging.level.root=ERROR
\ No newline at end of file
diff --git a/spring-cloud/spring-cloud-zuul/spring-zuul-rate-limiting/src/test/resources/logback.xml b/spring-cloud/spring-cloud-zuul/spring-zuul-rate-limiting/src/test/resources/logback.xml
new file mode 100644
index 0000000000..ab4a5f3a20
--- /dev/null
+++ b/spring-cloud/spring-cloud-zuul/spring-zuul-rate-limiting/src/test/resources/logback.xml
@@ -0,0 +1,12 @@
+
+
+
+
+ [%d{ISO8601}]-[%thread] %-5level %logger - %msg%n
+
+
+
+
+
+
+
diff --git a/spring-drools/pom.xml b/spring-drools/pom.xml
index 5adef4b2a9..8b105158ec 100644
--- a/spring-drools/pom.xml
+++ b/spring-drools/pom.xml
@@ -8,8 +8,9 @@
com.baeldung
- parent-modules
- 1.0.0-SNAPSHOT
+ parent-spring-5
+ 0.0.1-SNAPSHOT
+ ../parent-spring-5
@@ -40,17 +41,40 @@
kie-spring
${drools-version}
+
+ org.springframework
+ spring-beans
+ ${spring.version}
+
+
+ org.springframework
+ spring-context
+ ${spring.version}
+
+
+ org.springframework
+ spring-aop
+ ${spring.version}
+
+
+ org.springframework
+ spring-expression
+ ${spring.version}
+
+
+ org.springframework
+ spring-tx
+ ${spring.version}
+
org.springframework
spring-test
- ${spring-framework.version}
+ ${spring.version}
test