+
+
diff --git a/spring-boot-modules/spring-boot-basic-customization/src/main/resources/templates/error/404.html b/spring-boot-modules/spring-boot-basic-customization/src/main/resources/templates/error/404.html
new file mode 100644
index 0000000000..df83ce219b
--- /dev/null
+++ b/spring-boot-modules/spring-boot-basic-customization/src/main/resources/templates/error/404.html
@@ -0,0 +1,8 @@
+
+
+ RESOURCE NOT FOUND
+
+
+
404 RESOURCE NOT FOUND
+
+
\ No newline at end of file
diff --git a/spring-boot-modules/spring-boot-basic-customization/src/main/resources/templates/index.html b/spring-boot-modules/spring-boot-basic-customization/src/main/resources/templates/index.html
new file mode 100644
index 0000000000..95c68c8600
--- /dev/null
+++ b/spring-boot-modules/spring-boot-basic-customization/src/main/resources/templates/index.html
@@ -0,0 +1,6 @@
+
+
+
Welcome Home
+
Success! It is working as we expected.
+
+
diff --git a/spring-boot-modules/spring-boot/src/test/java/com/baeldung/failureanalyzer/FailureAnalyzerAppIntegrationTest.java b/spring-boot-modules/spring-boot-basic-customization/src/test/java/com/baeldung/failureanalyzer/FailureAnalyzerAppIntegrationTest.java
similarity index 99%
rename from spring-boot-modules/spring-boot/src/test/java/com/baeldung/failureanalyzer/FailureAnalyzerAppIntegrationTest.java
rename to spring-boot-modules/spring-boot-basic-customization/src/test/java/com/baeldung/failureanalyzer/FailureAnalyzerAppIntegrationTest.java
index b3555f55da..2d9fb56217 100644
--- a/spring-boot-modules/spring-boot/src/test/java/com/baeldung/failureanalyzer/FailureAnalyzerAppIntegrationTest.java
+++ b/spring-boot-modules/spring-boot-basic-customization/src/test/java/com/baeldung/failureanalyzer/FailureAnalyzerAppIntegrationTest.java
@@ -1,18 +1,16 @@
package com.baeldung.failureanalyzer;
-import static org.assertj.core.api.Assertions.assertThat;
-
-import java.util.Collection;
-import java.util.stream.Collectors;
-
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import com.baeldung.failureanalyzer.utils.ListAppender;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.boot.SpringApplication;
-import com.baeldung.failureanalyzer.utils.ListAppender;
+import java.util.Collection;
+import java.util.stream.Collectors;
-import ch.qos.logback.classic.spi.ILoggingEvent;
+import static org.assertj.core.api.Assertions.assertThat;
public class FailureAnalyzerAppIntegrationTest {
diff --git a/spring-boot-modules/spring-boot/src/test/java/com/baeldung/failureanalyzer/utils/ListAppender.java b/spring-boot-modules/spring-boot-basic-customization/src/test/java/com/baeldung/failureanalyzer/utils/ListAppender.java
similarity index 100%
rename from spring-boot-modules/spring-boot/src/test/java/com/baeldung/failureanalyzer/utils/ListAppender.java
rename to spring-boot-modules/spring-boot-basic-customization/src/test/java/com/baeldung/failureanalyzer/utils/ListAppender.java
index a298f49ff5..091cd687f1 100644
--- a/spring-boot-modules/spring-boot/src/test/java/com/baeldung/failureanalyzer/utils/ListAppender.java
+++ b/spring-boot-modules/spring-boot-basic-customization/src/test/java/com/baeldung/failureanalyzer/utils/ListAppender.java
@@ -1,11 +1,11 @@
package com.baeldung.failureanalyzer.utils;
-import java.util.ArrayList;
-import java.util.List;
-
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.AppenderBase;
+import java.util.ArrayList;
+import java.util.List;
+
public class ListAppender extends AppenderBase {
static private List events = new ArrayList<>();
diff --git a/spring-boot-modules/spring-boot/src/test/resources/logback-test.xml b/spring-boot-modules/spring-boot-basic-customization/src/test/resources/logback-test.xml
similarity index 51%
rename from spring-boot-modules/spring-boot/src/test/resources/logback-test.xml
rename to spring-boot-modules/spring-boot-basic-customization/src/test/resources/logback-test.xml
index 9e0f4e221f..6919a457cb 100644
--- a/spring-boot-modules/spring-boot/src/test/resources/logback-test.xml
+++ b/spring-boot-modules/spring-boot-basic-customization/src/test/resources/logback-test.xml
@@ -1,15 +1,15 @@
+ resource="org/springframework/boot/logging/logback/base.xml" />
+ class="com.baeldung.failureanalyzer.utils.ListAppender">
+ name="org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter">
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/spring-boot-modules/spring-boot-bootstrap/README.md b/spring-boot-modules/spring-boot-bootstrap/README.md
index 5fb8fd4a84..146cd04551 100644
--- a/spring-boot-modules/spring-boot-bootstrap/README.md
+++ b/spring-boot-modules/spring-boot-bootstrap/README.md
@@ -10,3 +10,4 @@ This module contains articles about bootstrapping Spring Boot applications.
- [Deploy a Spring Boot Application to OpenShift](https://www.baeldung.com/spring-boot-deploy-openshift)
- [Deploy a Spring Boot Application to AWS Beanstalk](https://www.baeldung.com/spring-boot-deploy-aws-beanstalk)
- [Guide to @SpringBootConfiguration in Spring Boot](https://www.baeldung.com/springbootconfiguration-annotation)
+- [Implement Health Checks in OpenShift](https://www.baeldung.com/openshift-health-checks)
diff --git a/spring-boot-modules/spring-boot-libraries/README.md b/spring-boot-modules/spring-boot-libraries/README.md
index f0bc3c9e89..c02fb69e5d 100644
--- a/spring-boot-modules/spring-boot-libraries/README.md
+++ b/spring-boot-modules/spring-boot-libraries/README.md
@@ -9,3 +9,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
- [Guide to ShedLock with Spring](https://www.baeldung.com/shedlock-spring)
- [A Guide to the Problem Spring Web Library](https://www.baeldung.com/problem-spring-web)
+- [Generating Barcodes and QR Codes in Java](https://www.baeldung.com/java-generating-barcodes-qr-codes)
diff --git a/spring-boot-modules/spring-boot-libraries/pom.xml b/spring-boot-modules/spring-boot-libraries/pom.xml
index ba1164dd59..e9d955edc0 100644
--- a/spring-boot-modules/spring-boot-libraries/pom.xml
+++ b/spring-boot-modules/spring-boot-libraries/pom.xml
@@ -53,8 +53,41 @@
${shedlock.version}
+
+
+ net.sourceforge.barbecue
+ barbecue
+ ${barbecue.version}
+
+
+ net.sf.barcode4j
+ barcode4j
+ ${barcode4j.version}
+
+
+ com.github.kenglxn.qrgen
+ javase
+ ${qrgen.version}
+
+
+ com.google.zxing
+ core
+ ${zxing.version}
+
+
+ com.google.zxing
+ javase
+ ${zxing.version}
+
+
+
+ jitpack.io
+ https://jitpack.io
+
+
+
spring-boot-libraries
@@ -153,6 +186,10 @@
2.3.20.23.02.1.0
+ 1.5-beta1
+ 2.1
+ 2.6.0
+ 3.3.0
diff --git a/libraries-3/src/main/java/com/baeldung/barcodes/BarcodesController.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/barcodes/BarcodesController.java
similarity index 100%
rename from libraries-3/src/main/java/com/baeldung/barcodes/BarcodesController.java
rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/barcodes/BarcodesController.java
diff --git a/libraries-3/src/main/java/com/baeldung/barcodes/SpringBootApp.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/barcodes/SpringBootApp.java
similarity index 100%
rename from libraries-3/src/main/java/com/baeldung/barcodes/SpringBootApp.java
rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/barcodes/SpringBootApp.java
diff --git a/libraries-3/src/main/java/com/baeldung/barcodes/generators/BarbecueBarcodeGenerator.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/barcodes/generators/BarbecueBarcodeGenerator.java
similarity index 100%
rename from libraries-3/src/main/java/com/baeldung/barcodes/generators/BarbecueBarcodeGenerator.java
rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/barcodes/generators/BarbecueBarcodeGenerator.java
diff --git a/libraries-3/src/main/java/com/baeldung/barcodes/generators/Barcode4jBarcodeGenerator.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/barcodes/generators/Barcode4jBarcodeGenerator.java
similarity index 100%
rename from libraries-3/src/main/java/com/baeldung/barcodes/generators/Barcode4jBarcodeGenerator.java
rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/barcodes/generators/Barcode4jBarcodeGenerator.java
diff --git a/libraries-3/src/main/java/com/baeldung/barcodes/generators/QRGenBarcodeGenerator.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/barcodes/generators/QRGenBarcodeGenerator.java
similarity index 100%
rename from libraries-3/src/main/java/com/baeldung/barcodes/generators/QRGenBarcodeGenerator.java
rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/barcodes/generators/QRGenBarcodeGenerator.java
diff --git a/libraries-3/src/main/java/com/baeldung/barcodes/generators/ZxingBarcodeGenerator.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/barcodes/generators/ZxingBarcodeGenerator.java
similarity index 100%
rename from libraries-3/src/main/java/com/baeldung/barcodes/generators/ZxingBarcodeGenerator.java
rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/barcodes/generators/ZxingBarcodeGenerator.java
diff --git a/spring-boot-modules/spring-boot-mvc-2/README.md b/spring-boot-modules/spring-boot-mvc-2/README.md
index d7341cca35..c42730f9cc 100644
--- a/spring-boot-modules/spring-boot-mvc-2/README.md
+++ b/spring-boot-modules/spring-boot-mvc-2/README.md
@@ -6,6 +6,7 @@ This module contains articles about Spring Web MVC in Spring Boot projects.
- [Functional Controllers in Spring MVC](https://www.baeldung.com/spring-mvc-functional-controllers)
- [Specify an Array of Strings as Body Parameters in Swagger](https://www.baeldung.com/swagger-body-array-of-strings)
+- [Swagger @ApiParam vs @ApiModelProperty](https://www.baeldung.com/swagger-apiparam-vs-apimodelproperty)
- [ETags for REST with Spring](https://www.baeldung.com/etags-for-rest-with-spring)
- [Testing REST with multiple MIME types](https://www.baeldung.com/testing-rest-api-with-multiple-media-types)
- [Testing Web APIs with Postman Collections](https://www.baeldung.com/postman-testing-collections)
diff --git a/spring-boot-modules/spring-boot-mvc/README.md b/spring-boot-modules/spring-boot-mvc/README.md
index 2e67c42ede..41b98063a6 100644
--- a/spring-boot-modules/spring-boot-mvc/README.md
+++ b/spring-boot-modules/spring-boot-mvc/README.md
@@ -4,7 +4,6 @@ This module contains articles about Spring Web MVC in Spring Boot projects.
### Relevant Articles:
-- [Guide to the Favicon in Spring Boot](https://www.baeldung.com/spring-boot-favicon)
- [Custom Validation MessageSource in Spring Boot](https://www.baeldung.com/spring-custom-validation-message-source)
- [Display RSS Feed with Spring MVC](https://www.baeldung.com/spring-mvc-rss-feed)
- [A Controller, Service and DAO Example with Spring Boot and JSF](https://www.baeldung.com/jsf-spring-boot-controller-service-dao)
diff --git a/spring-boot-modules/spring-boot-properties/README.md b/spring-boot-modules/spring-boot-properties/README.md
index daf7c55ab3..f861a01d10 100644
--- a/spring-boot-modules/spring-boot-properties/README.md
+++ b/spring-boot-modules/spring-boot-properties/README.md
@@ -12,3 +12,5 @@ This module contains articles about Properties in Spring Boot.
- [Spring YAML Configuration](https://www.baeldung.com/spring-yaml)
- [Using Spring @Value with Defaults](https://www.baeldung.com/spring-value-defaults)
- [How to Inject a Property Value Into a Class Not Managed by Spring?](https://www.baeldung.com/inject-properties-value-non-spring-class)
+- [Add Build Properties to a Spring Boot Application](https://www.baeldung.com/spring-boot-build-properties)
+- [IntelliJ – Cannot Resolve Spring Boot Configuration Properties Error](https://www.baeldung.com/intellij-resolve-spring-boot-configuration-properties)
diff --git a/spring-boot-modules/spring-boot-runtime/README.md b/spring-boot-modules/spring-boot-runtime/README.md
index a544faf830..62727ecc76 100644
--- a/spring-boot-modules/spring-boot-runtime/README.md
+++ b/spring-boot-modules/spring-boot-runtime/README.md
@@ -8,7 +8,6 @@ This module contains articles about administering a Spring Boot runtime
- [Logging HTTP Requests with Spring Boot Actuator HTTP Tracing](https://www.baeldung.com/spring-boot-actuator-http)
- [How to Disable Console Logging in Spring Boot](https://www.baeldung.com/spring-boot-disable-console-logging)
- [Spring Boot Embedded Tomcat Logs](https://www.baeldung.com/spring-boot-embedded-tomcat-logs)
- - [How to Change the Default Port in Spring Boot](https://www.baeldung.com/spring-boot-change-port)
- [Project Configuration with Spring](https://www.baeldung.com/project-configuration-with-spring)
- [CORS with Spring](https://www.baeldung.com/spring-cors)
- [Spring – Log Incoming Requests](https://www.baeldung.com/spring-http-logging)
\ No newline at end of file
diff --git a/spring-boot-modules/spring-boot-springdoc/pom.xml b/spring-boot-modules/spring-boot-springdoc/pom.xml
index fd8a9e71ae..c99a9c2b24 100644
--- a/spring-boot-modules/spring-boot-springdoc/pom.xml
+++ b/spring-boot-modules/spring-boot-springdoc/pom.xml
@@ -1,7 +1,8 @@
-
+4.0.0spring-boot-springdoc0.0.1-SNAPSHOT
@@ -16,11 +17,6 @@
../../parent-boot-2
-
- 1.8
- 1.2.32
-
-
org.springframework.boot
@@ -63,6 +59,11 @@
+
+ 1.8
+ 1.2.32
+
+
integration
diff --git a/spring-boot-modules/spring-boot-testing/README.md b/spring-boot-modules/spring-boot-testing/README.md
index 0b2533e6bc..882e2be766 100644
--- a/spring-boot-modules/spring-boot-testing/README.md
+++ b/spring-boot-modules/spring-boot-testing/README.md
@@ -12,3 +12,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
- [Exclude Auto-Configuration Classes in Spring Boot Tests](https://www.baeldung.com/spring-boot-exclude-auto-configuration-test)
- [Setting the Log Level in Spring Boot when Testing](https://www.baeldung.com/spring-boot-testing-log-level)
- [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)
diff --git a/spring-boot-modules/spring-boot/README.MD b/spring-boot-modules/spring-boot/README.MD
index 217d9e90b2..b15ab7dbe5 100644
--- a/spring-boot-modules/spring-boot/README.MD
+++ b/spring-boot-modules/spring-boot/README.MD
@@ -11,9 +11,7 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
- [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)
-- [Using Custom Banners in Spring Boot](https://www.baeldung.com/spring-boot-custom-banners)
- [Guide to Internationalization in Spring Boot](https://www.baeldung.com/spring-boot-internationalization)
-- [Create a Custom FailureAnalyzer with Spring Boot](https://www.baeldung.com/spring-boot-failure-analyzer)
- [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)
@@ -22,11 +20,8 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
- [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: Customize Whitelabel Error Page](https://www.baeldung.com/spring-boot-custom-error-page)
- [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)
-- [How to Define a Spring Boot Filter?](https://www.baeldung.com/spring-boot-add-filter)
-- [Spring Boot Exit Codes](https://www.baeldung.com/spring-boot-exit-codes)
- [Guide to the Favicon in Spring Boot](https://www.baeldung.com/spring-boot-favicon)
- [Spring Shutdown Callbacks](https://www.baeldung.com/spring-shutdown-callbacks)
- [Container Configuration in Spring Boot 2](https://www.baeldung.com/embeddedservletcontainercustomizer-configurableembeddedservletcontainer-spring-boot)
diff --git a/spring-boot-modules/spring-boot/src/main/resources/application-errorhandling.properties b/spring-boot-modules/spring-boot/src/main/resources/application-errorhandling.properties
index 6ffcfbaf52..270e86d443 100644
--- a/spring-boot-modules/spring-boot/src/main/resources/application-errorhandling.properties
+++ b/spring-boot-modules/spring-boot/src/main/resources/application-errorhandling.properties
@@ -1,10 +1,4 @@
#server
server.port=9000
server.servlet-path=/
-server.context-path=/
-#server.error.whitelabel.enabled=false
-
-#spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration
-
-#for Spring Boot 2.0+
-#spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration
\ No newline at end of file
+server.context-path=/
\ No newline at end of file
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 7de79da574..44649fc1c0 100644
--- a/spring-boot-modules/spring-boot/src/main/resources/application.properties
+++ b/spring-boot-modules/spring-boot/src/main/resources/application.properties
@@ -33,12 +33,4 @@ logging.level.org.springframework=INFO
servlet.name=dispatcherExample
servlet.mapping=/dispatcherExampleURL
-#spring.banner.charset=UTF-8
-#spring.banner.location=classpath:banner.txt
-#spring.banner.image.location=classpath:banner.gif
-#spring.banner.image.width= //TODO
-#spring.banner.image.height= //TODO
-#spring.banner.image.margin= //TODO
-#spring.banner.image.invert= //TODO
-
contactInfoType=email
\ No newline at end of file
diff --git a/spring-boot-modules/spring-boot/src/main/resources/templates/error-404.html b/spring-boot-modules/spring-boot/src/main/resources/templates/error-404.html
deleted file mode 100644
index cf68032596..0000000000
--- a/spring-boot-modules/spring-boot/src/main/resources/templates/error-404.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
Sorry, we couldn't find the page you were looking for.
-
-
\ No newline at end of file
diff --git a/spring-cloud/spring-cloud-gateway/README.md b/spring-cloud/spring-cloud-gateway/README.md
index d3323947e8..9c8e0d443a 100644
--- a/spring-cloud/spring-cloud-gateway/README.md
+++ b/spring-cloud/spring-cloud-gateway/README.md
@@ -5,3 +5,4 @@ This module contains articles about Spring Cloud Gateway
### Relevant Articles:
- [Exploring the new Spring Cloud Gateway](http://www.baeldung.com/spring-cloud-gateway)
- [Writing Custom Spring Cloud Gateway Filters](https://www.baeldung.com/spring-cloud-custom-gateway-filters)
+- [Spring Cloud Gateway Routing Predicate Factories](https://www.baeldung.com/spring-cloud-gateway-routing-predicate-factories)
diff --git a/spring-cloud/spring-cloud-zuul/README.md b/spring-cloud/spring-cloud-zuul/README.md
index b8e1773930..acd56a213c 100644
--- a/spring-cloud/spring-cloud-zuul/README.md
+++ b/spring-cloud/spring-cloud-zuul/README.md
@@ -5,3 +5,4 @@ This module contains articles about Spring with Netflix Zuul
### Relevant Articles:
- [Rate Limiting in Spring Cloud Netflix Zuul](https://www.baeldung.com/spring-cloud-zuul-rate-limit)
- [Spring REST with a Zuul Proxy](https://www.baeldung.com/spring-rest-with-zuul-proxy)
+- [Modifying the Response Body in a Zuul Filter](https://www.baeldung.com/zuul-filter-modifying-response-body)
diff --git a/spring-cloud/spring-cloud-zuul/spring-zuul-post-filter/pom.xml b/spring-cloud/spring-cloud-zuul/spring-zuul-post-filter/pom.xml
index c13aeb890e..8643309645 100644
--- a/spring-cloud/spring-cloud-zuul/spring-zuul-post-filter/pom.xml
+++ b/spring-cloud/spring-cloud-zuul/spring-zuul-post-filter/pom.xml
@@ -1,7 +1,8 @@
-
+spring-cloud-zuulcom.baeldung.spring.cloud
@@ -10,10 +11,6 @@
4.0.0spring-zuul-post-filter
-
- Hoxton.SR1
-
-
org.springframework.cloud
@@ -21,5 +18,8 @@
+
+ Hoxton.SR1
+
\ No newline at end of file
diff --git a/spring-core-3/README.md b/spring-core-3/README.md
index ae2d33c196..b2c4f694a8 100644
--- a/spring-core-3/README.md
+++ b/spring-core-3/README.md
@@ -8,4 +8,6 @@ This module contains articles about core Spring functionality
- [Guide to the Spring BeanFactory](https://www.baeldung.com/spring-beanfactory)
- [How to use the Spring FactoryBean?](https://www.baeldung.com/spring-factorybean)
- [Spring – Injecting Collections](https://www.baeldung.com/spring-injecting-collections)
+- [Design Patterns in the Spring Framework](https://www.baeldung.com/spring-framework-design-patterns)
+- [Injecting a Value in a Static Field in Spring](https://www.baeldung.com/spring-inject-static-field)
- More articles: [[<-- prev]](/spring-core-2)
diff --git a/spring-ejb/ejb-beans/README.md b/spring-ejb/ejb-beans/README.md
new file mode 100644
index 0000000000..f1af5a3a87
--- /dev/null
+++ b/spring-ejb/ejb-beans/README.md
@@ -0,0 +1,3 @@
+### Relevant Articles:
+
+- [Spring Bean vs. EJB – A Feature Comparison](https://www.baeldung.com/spring-bean-vs-ejb)
diff --git a/spring-ejb/ejb-beans/pom.xml b/spring-ejb/ejb-beans/pom.xml
index eecf8c1d23..c9edfc21f8 100644
--- a/spring-ejb/ejb-beans/pom.xml
+++ b/spring-ejb/ejb-beans/pom.xml
@@ -121,6 +121,8 @@
5.2.3.RELEASE5.10.25.13.1
+ 2.21.0
+ 1.8.5
diff --git a/spring-mvc-java-2/README.md b/spring-mvc-java-2/README.md
new file mode 100644
index 0000000000..b5d5df3cd4
--- /dev/null
+++ b/spring-mvc-java-2/README.md
@@ -0,0 +1,3 @@
+### Relevant Articles:
+
+- [Cache Headers in Spring MVC](https://www.baeldung.com/spring-mvc-cache-headers)
diff --git a/spring-mvc-xml/README.md b/spring-mvc-xml/README.md
index 0adf127aaa..685e7686b1 100644
--- a/spring-mvc-xml/README.md
+++ b/spring-mvc-xml/README.md
@@ -17,6 +17,7 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
- [A Java Web Application Without a web.xml](https://www.baeldung.com/java-web-app-without-web-xml)
- [Validating RequestParams and PathVariables in Spring](https://www.baeldung.com/spring-validate-requestparam-pathvariable)
- [Debugging the Spring MVC 404 “No mapping found for HTTP request” Error](https://www.baeldung.com/spring-mvc-404-error)
+- [Getting Started with CRaSH](https://www.baeldung.com/jvm-crash-shell)
## Spring MVC with XML Configuration Example Project
diff --git a/spring-reactive-kotlin/pom.xml b/spring-reactive-kotlin/pom.xml
index 3a693837df..cbb143f6ec 100644
--- a/spring-reactive-kotlin/pom.xml
+++ b/spring-reactive-kotlin/pom.xml
@@ -5,6 +5,7 @@
spring-reactive-kotlinspring-reactive-kotlinDemo project for Spring Boot
+
jar
@@ -23,6 +24,18 @@
org.springframework.bootspring-boot-starter-webflux
+
+ org.springframework.boot.experimental
+ spring-boot-starter-data-r2dbc
+
+
+ org.springframework.boot
+ spring-boot-starter-actuator
+
+
+ io.r2dbc
+ r2dbc-h2
+ com.fasterxml.jackson.modulejackson-module-kotlin
@@ -38,21 +51,95 @@
reactor-testtest
+
+
+ org.springframework.boot.experimental
+ spring-boot-test-autoconfigure-r2dbc
+ test
+
+
+ io.projectreactor
+ reactor-test
+ test
+
+
+
+
+
+ org.springframework.boot.experimental
+ spring-boot-bom-r2dbc
+ 0.1.0.M3
+ pom
+ import
+
+
+
+
+ src/main/kotlin
+ src/test/kotlinkotlin-maven-plugin
+
+
+ compile
+ compile
+
+ compile
+
+
+
+ test-compile
+ test-compile
+
+ test-compile
+
+
+ org.jetbrains.kotlin${kotlin.version}-Xjsr305=strict
+ 1.8
+
+ spring
+ jpa
+
+
+
+ org.jetbrains.kotlin
+ kotlin-maven-allopen
+ ${kotlin.version}
+
+
+ org.jetbrains.kotlin
+ kotlin-maven-noarg
+ ${kotlin.version}
+
+
+
+ 1.8
+ 1.3.70
+ 2.2.5.RELEASE
+
+
+
+
+ spring-milestones
+ Spring Milestones
+ https://repo.spring.io/milestone
+
+
+
+
diff --git a/spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/HealthTrackerApplication.kt b/spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/HealthTrackerApplication.kt
new file mode 100644
index 0000000000..c70057b5de
--- /dev/null
+++ b/spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/HealthTrackerApplication.kt
@@ -0,0 +1,11 @@
+package com.baeldung.bootmicroservice
+
+import org.springframework.boot.autoconfigure.SpringBootApplication
+import org.springframework.boot.runApplication
+
+@SpringBootApplication
+class HealthTrackerApplication
+
+fun main(args: Array) {
+ runApplication(*args)
+}
diff --git a/spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/config/DBConfiguration.kt b/spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/config/DBConfiguration.kt
new file mode 100644
index 0000000000..b14682cc5c
--- /dev/null
+++ b/spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/config/DBConfiguration.kt
@@ -0,0 +1,28 @@
+package com.baeldung.bootmicroservice.config;
+
+import org.springframework.context.annotation.Configuration
+import org.springframework.data.r2dbc.core.DatabaseClient
+
+@Configuration
+class DBConfiguration(db: DatabaseClient) {
+ init {
+ val initDb = db.execute {
+ """ CREATE TABLE IF NOT EXISTS profile (
+ id SERIAL PRIMARY KEY,
+ first_name VARCHAR(20) NOT NULL,
+ last_name VARCHAR(20) NOT NULL,
+ birth_date DATE NOT NULL
+ );
+ CREATE TABLE IF NOT EXISTS health_record(
+ id SERIAL PRIMARY KEY,
+ profile_id LONG NOT NULL,
+ temperature DECIMAL NOT NULL,
+ blood_pressure DECIMAL NOT NULL,
+ heart_rate DECIMAL,
+ date DATE NOT NULL
+ );
+ """
+ }
+ initDb.then().subscribe()
+ }
+}
diff --git a/spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/controller/HealthRecordController.kt b/spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/controller/HealthRecordController.kt
new file mode 100644
index 0000000000..620f187b7b
--- /dev/null
+++ b/spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/controller/HealthRecordController.kt
@@ -0,0 +1,44 @@
+package com.baeldung.bootmicroservice.controller
+
+import com.baeldung.bootmicroservice.model.AverageHealthStatus
+import com.baeldung.bootmicroservice.model.HealthRecord
+import com.baeldung.bootmicroservice.repository.HealthRecordRepository
+import org.springframework.web.bind.annotation.GetMapping
+import org.springframework.web.bind.annotation.PathVariable
+import org.springframework.web.bind.annotation.PostMapping
+import org.springframework.web.bind.annotation.RequestBody
+import org.springframework.web.bind.annotation.RestController
+import reactor.core.publisher.Mono
+
+@RestController
+class HealthRecordController(val repository: HealthRecordRepository) {
+
+ @PostMapping("/health/{profileId}/record")
+ fun storeHealthRecord(@PathVariable("profileId") profileId: Long, @RequestBody record: HealthRecord): Mono =
+ repository.save(HealthRecord(null
+ , profileId
+ , record.temperature
+ , record.bloodPressure
+ , record.heartRate
+ , record.date))
+
+ @GetMapping("/health/{profileId}/avg")
+ fun fetchHealthRecordAverage(@PathVariable("profileId") profileId: Long): Mono =
+ repository.findByProfileId(profileId)
+ .reduce(
+ AverageHealthStatus(0, 0.0, 0.0, 0.0)
+ , { s, r ->
+ AverageHealthStatus(s.cnt + 1
+ , s.temperature + r.temperature
+ , s.bloodPressure + r.bloodPressure
+ , s.heartRate + r.heartRate
+ )
+ }
+ ).map { s ->
+ AverageHealthStatus(s.cnt
+ , if (s.cnt != 0) s.temperature / s.cnt else 0.0
+ , if (s.cnt != 0) s.bloodPressure / s.cnt else 0.0
+ , if (s.cnt != 0) s.heartRate / s.cnt else 0.0)
+ }
+
+}
\ No newline at end of file
diff --git a/spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/controller/ProfileController.kt b/spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/controller/ProfileController.kt
new file mode 100644
index 0000000000..1dc3bcdc50
--- /dev/null
+++ b/spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/controller/ProfileController.kt
@@ -0,0 +1,15 @@
+package com.baeldung.bootmicroservice.controller
+
+import com.baeldung.bootmicroservice.model.Profile
+import com.baeldung.bootmicroservice.repository.ProfileRepository
+import org.springframework.web.bind.annotation.PostMapping
+import org.springframework.web.bind.annotation.RequestBody
+import org.springframework.web.bind.annotation.RestController
+import reactor.core.publisher.Mono
+
+@RestController
+class ProfileController(val repository: ProfileRepository) {
+
+ @PostMapping("/profile")
+ fun save(@RequestBody profile: Profile): Mono = repository.save(profile)
+}
\ No newline at end of file
diff --git a/spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/model/AverageHealthStatus.kt b/spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/model/AverageHealthStatus.kt
new file mode 100644
index 0000000000..3141146b9c
--- /dev/null
+++ b/spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/model/AverageHealthStatus.kt
@@ -0,0 +1,3 @@
+package com.baeldung.bootmicroservice.model;
+
+class AverageHealthStatus(var cnt: Int, var temperature: Double, var bloodPressure: Double, var heartRate: Double)
diff --git a/spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/model/HealthRecord.kt b/spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/model/HealthRecord.kt
new file mode 100644
index 0000000000..71c534027f
--- /dev/null
+++ b/spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/model/HealthRecord.kt
@@ -0,0 +1,8 @@
+package com.baeldung.bootmicroservice.model
+
+import org.springframework.data.annotation.Id
+import org.springframework.data.relational.core.mapping.Table
+import java.time.LocalDate
+
+@Table
+data class HealthRecord(@Id var id: Long?, var profileId: Long?, var temperature: Double, var bloodPressure: Double, var heartRate: Double, var date: LocalDate)
\ No newline at end of file
diff --git a/spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/model/Profile.kt b/spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/model/Profile.kt
new file mode 100644
index 0000000000..cbb7e675ea
--- /dev/null
+++ b/spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/model/Profile.kt
@@ -0,0 +1,8 @@
+package com.baeldung.bootmicroservice.model
+
+import org.springframework.data.annotation.Id
+import org.springframework.data.relational.core.mapping.Table
+import java.time.LocalDateTime
+
+@Table
+data class Profile(@Id var id:Long?, var firstName : String, var lastName : String, var birthDate: LocalDateTime)
\ No newline at end of file
diff --git a/spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/repository/HealthRecordRepository.kt b/spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/repository/HealthRecordRepository.kt
new file mode 100644
index 0000000000..8cc91f06e4
--- /dev/null
+++ b/spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/repository/HealthRecordRepository.kt
@@ -0,0 +1,13 @@
+package com.baeldung.bootmicroservice.repository
+
+import com.baeldung.bootmicroservice.model.HealthRecord
+import org.springframework.data.r2dbc.repository.Query
+import org.springframework.data.repository.reactive.ReactiveCrudRepository
+import org.springframework.stereotype.Repository
+import reactor.core.publisher.Flux
+
+@Repository
+interface HealthRecordRepository: ReactiveCrudRepository {
+ @Query("select p.* from health_record p where p.profile_id = :profileId ")
+ fun findByProfileId(profileId: Long): Flux
+}
\ No newline at end of file
diff --git a/spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/repository/ProfileRepository.kt b/spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/repository/ProfileRepository.kt
new file mode 100644
index 0000000000..eee8c5fcbe
--- /dev/null
+++ b/spring-reactive-kotlin/src/main/kotlin/com/baeldung/bootmicroservice/repository/ProfileRepository.kt
@@ -0,0 +1,8 @@
+package com.baeldung.bootmicroservice.repository
+
+import com.baeldung.bootmicroservice.model.Profile
+import org.springframework.data.repository.reactive.ReactiveCrudRepository
+import org.springframework.stereotype.Repository
+
+@Repository
+interface ProfileRepository: ReactiveCrudRepository
\ No newline at end of file
diff --git a/spring-reactive-kotlin/src/main/resources/application.yml b/spring-reactive-kotlin/src/main/resources/application.yml
new file mode 100644
index 0000000000..d75683f905
--- /dev/null
+++ b/spring-reactive-kotlin/src/main/resources/application.yml
@@ -0,0 +1 @@
+management.endpoints.web.exposure.include: health,metrics
\ No newline at end of file
diff --git a/spring-reactive-kotlin/src/test/kotlin/com/baeldung/bootmicroservice/controller/ProfileControllerTest.kt b/spring-reactive-kotlin/src/test/kotlin/com/baeldung/bootmicroservice/controller/ProfileControllerTest.kt
new file mode 100644
index 0000000000..51481af3d7
--- /dev/null
+++ b/spring-reactive-kotlin/src/test/kotlin/com/baeldung/bootmicroservice/controller/ProfileControllerTest.kt
@@ -0,0 +1,51 @@
+package com.baeldung.bootmicroservice.controller;
+
+import com.baeldung.bootmicroservice.model.Profile
+import com.fasterxml.jackson.databind.ObjectMapper
+import org.junit.jupiter.api.BeforeEach
+import org.junit.jupiter.api.Test
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.boot.test.context.SpringBootTest
+import org.springframework.http.MediaType
+import org.springframework.test.web.reactive.server.WebTestClient
+import java.time.LocalDateTime
+
+@SpringBootTest
+class ProfileControllerTest {
+ @Autowired
+ lateinit var controller: ProfileController
+
+ @Autowired
+ lateinit var mapper: ObjectMapper ;
+
+ lateinit var client: WebTestClient
+ lateinit var profile: String
+
+ @BeforeEach
+ fun setup() {
+ client = WebTestClient.bindToController(controller).build()
+ profile = mapper.writeValueAsString(Profile(null, "kotlin", "reactive", LocalDateTime.now()))
+ }
+
+ @Test
+ fun whenRequestProfile_thenStatusShouldBeOk() {
+ client.post()
+ .uri("/profile")
+ .contentType(MediaType.APPLICATION_JSON)
+ .bodyValue(profile)
+ .exchange()
+ .expectStatus().isOk
+ }
+
+ @Test
+ fun whenRequestProfile_thenIdShouldBeNotNull() {
+ client.post()
+ .uri("/profile")
+ .contentType(MediaType.APPLICATION_JSON)
+ .bodyValue(profile)
+ .exchange()
+ .expectBody()
+ .jsonPath("$.id")
+ .isNotEmpty
+ }
+}
diff --git a/spring-rest-http/README.md b/spring-rest-http/README.md
index 54b31e80c4..35793cb281 100644
--- a/spring-rest-http/README.md
+++ b/spring-rest-http/README.md
@@ -12,3 +12,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
- [Returning Custom Status Codes from Spring Controllers](https://www.baeldung.com/spring-mvc-controller-custom-http-status-code)
- [Spring RequestMapping](https://www.baeldung.com/spring-requestmapping)
- [Guide to DeferredResult in Spring](https://www.baeldung.com/spring-deferred-result)
+- [Using JSON Patch in Spring REST APIs](https://www.baeldung.com/spring-rest-json-patch)
diff --git a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/RestTemplateConfigurationApplication.java b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/RestTemplateConfigurationApplication.java
similarity index 92%
rename from spring-resttemplate/src/main/java/org/baeldung/resttemplate/RestTemplateConfigurationApplication.java
rename to spring-resttemplate/src/main/java/com/baeldung/resttemplate/RestTemplateConfigurationApplication.java
index 9a361e92c9..3e4d1ffa00 100644
--- a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/RestTemplateConfigurationApplication.java
+++ b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/RestTemplateConfigurationApplication.java
@@ -1,4 +1,4 @@
-package org.baeldung.resttemplate;
+package com.baeldung.resttemplate;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
diff --git a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/configuration/CustomClientHttpRequestInterceptor.java b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/CustomClientHttpRequestInterceptor.java
similarity index 95%
rename from spring-resttemplate/src/main/java/org/baeldung/resttemplate/configuration/CustomClientHttpRequestInterceptor.java
rename to spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/CustomClientHttpRequestInterceptor.java
index a39994ae67..bef8af3725 100644
--- a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/configuration/CustomClientHttpRequestInterceptor.java
+++ b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/CustomClientHttpRequestInterceptor.java
@@ -1,4 +1,4 @@
-package org.baeldung.resttemplate.configuration;
+package com.baeldung.resttemplate.configuration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/configuration/CustomRestTemplateCustomizer.java b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/CustomRestTemplateCustomizer.java
similarity index 89%
rename from spring-resttemplate/src/main/java/org/baeldung/resttemplate/configuration/CustomRestTemplateCustomizer.java
rename to spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/CustomRestTemplateCustomizer.java
index 5e8220d064..75ce02ea04 100644
--- a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/configuration/CustomRestTemplateCustomizer.java
+++ b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/CustomRestTemplateCustomizer.java
@@ -1,4 +1,4 @@
-package org.baeldung.resttemplate.configuration;
+package com.baeldung.resttemplate.configuration;
import org.springframework.boot.web.client.RestTemplateCustomizer;
import org.springframework.web.client.RestTemplate;
diff --git a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/configuration/FooController.java b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/FooController.java
similarity index 97%
rename from spring-resttemplate/src/main/java/org/baeldung/resttemplate/configuration/FooController.java
rename to spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/FooController.java
index a9d400b199..dbef16b592 100644
--- a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/configuration/FooController.java
+++ b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/FooController.java
@@ -1,4 +1,4 @@
-package org.baeldung.resttemplate.configuration;
+package com.baeldung.resttemplate.configuration;
import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
@@ -6,7 +6,7 @@ import java.net.URI;
import java.util.Collection;
import java.util.Map;
-import org.baeldung.resttemplate.web.dto.Foo;
+import com.baeldung.resttemplate.web.dto.Foo;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
diff --git a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/configuration/HelloController.java b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/HelloController.java
similarity index 95%
rename from spring-resttemplate/src/main/java/org/baeldung/resttemplate/configuration/HelloController.java
rename to spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/HelloController.java
index ee404db4f8..854ca1a1c1 100644
--- a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/configuration/HelloController.java
+++ b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/HelloController.java
@@ -1,4 +1,4 @@
-package org.baeldung.resttemplate.configuration;
+package com.baeldung.resttemplate.configuration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.client.RestTemplateBuilder;
diff --git a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/configuration/SpringConfig.java b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/SpringConfig.java
similarity index 82%
rename from spring-resttemplate/src/main/java/org/baeldung/resttemplate/configuration/SpringConfig.java
rename to spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/SpringConfig.java
index 966d5bcaa1..7866a4abcd 100644
--- a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/configuration/SpringConfig.java
+++ b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/configuration/SpringConfig.java
@@ -1,4 +1,4 @@
-package org.baeldung.resttemplate.configuration;
+package com.baeldung.resttemplate.configuration;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@@ -11,7 +11,7 @@ import org.springframework.web.client.RestTemplate;
@Configuration
@EnableAutoConfiguration
-@ComponentScan("org.baeldung.resttemplate.configuration")
+@ComponentScan("com.baeldung.resttemplate.configuration")
public class SpringConfig {
@Bean
@@ -26,8 +26,4 @@ public class SpringConfig {
return new RestTemplateBuilder(customRestTemplateCustomizer());
}
- @Bean
- public RestTemplate restTemplate() {
- return new RestTemplate();
- }
}
diff --git a/spring-resttemplate/src/main/java/com/baeldung/resttemplate/lists/service/EmployeeService.java b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/lists/service/EmployeeService.java
index 226134787f..8a1773483a 100644
--- a/spring-resttemplate/src/main/java/com/baeldung/resttemplate/lists/service/EmployeeService.java
+++ b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/lists/service/EmployeeService.java
@@ -7,7 +7,7 @@ import com.baeldung.resttemplate.lists.dto.Employee;
import java.util.ArrayList;
import java.util.List;
-@Service
+@Service("EmployeeListService")
public class EmployeeService
{
public List getAllEmployees()
diff --git a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/controller/PersonAPI.java b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/controller/PersonAPI.java
similarity index 88%
rename from spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/controller/PersonAPI.java
rename to spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/controller/PersonAPI.java
index b1b56ec2f3..b3131cc00c 100644
--- a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/controller/PersonAPI.java
+++ b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/controller/PersonAPI.java
@@ -1,9 +1,9 @@
-package org.baeldung.resttemplate.web.controller;
+package com.baeldung.resttemplate.web.controller;
import javax.servlet.http.HttpServletResponse;
-import org.baeldung.resttemplate.web.dto.Person;
-import org.baeldung.resttemplate.web.service.PersonService;
+import com.baeldung.resttemplate.web.service.PersonService;
+import com.baeldung.resttemplate.web.dto.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
diff --git a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/dto/Foo.java b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/dto/Foo.java
similarity index 93%
rename from spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/dto/Foo.java
rename to spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/dto/Foo.java
index ed0a42c429..ede91dab1a 100644
--- a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/dto/Foo.java
+++ b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/dto/Foo.java
@@ -1,4 +1,4 @@
-package org.baeldung.resttemplate.web.dto;
+package com.baeldung.resttemplate.web.dto;
import com.thoughtworks.xstream.annotations.XStreamAlias;
diff --git a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/dto/Person.java b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/dto/Person.java
similarity index 91%
rename from spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/dto/Person.java
rename to spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/dto/Person.java
index 4b7679638f..11e56fc6e2 100644
--- a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/dto/Person.java
+++ b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/dto/Person.java
@@ -1,4 +1,4 @@
-package org.baeldung.resttemplate.web.dto;
+package com.baeldung.resttemplate.web.dto;
public class Person {
private Integer id;
diff --git a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/exception/NotFoundException.java b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/exception/NotFoundException.java
similarity index 55%
rename from spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/exception/NotFoundException.java
rename to spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/exception/NotFoundException.java
index 3e606e9314..8eb217978c 100644
--- a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/exception/NotFoundException.java
+++ b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/exception/NotFoundException.java
@@ -1,4 +1,4 @@
-package org.baeldung.resttemplate.web.exception;
+package com.baeldung.resttemplate.web.exception;
public class NotFoundException extends RuntimeException {
}
diff --git a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/handler/RestTemplateResponseErrorHandler.java b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/handler/RestTemplateResponseErrorHandler.java
similarity index 92%
rename from spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/handler/RestTemplateResponseErrorHandler.java
rename to spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/handler/RestTemplateResponseErrorHandler.java
index 214de38746..02260438c7 100644
--- a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/handler/RestTemplateResponseErrorHandler.java
+++ b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/handler/RestTemplateResponseErrorHandler.java
@@ -1,8 +1,8 @@
-package org.baeldung.resttemplate.web.handler;
+package com.baeldung.resttemplate.web.handler;
import java.io.IOException;
-import org.baeldung.resttemplate.web.exception.NotFoundException;
+import com.baeldung.resttemplate.web.exception.NotFoundException;
import org.springframework.http.HttpStatus;
import org.springframework.http.client.ClientHttpResponse;
import org.springframework.stereotype.Component;
diff --git a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/model/Bar.java b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/model/Bar.java
similarity index 87%
rename from spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/model/Bar.java
rename to spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/model/Bar.java
index cf5279697f..7f8902e2fc 100644
--- a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/model/Bar.java
+++ b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/model/Bar.java
@@ -1,4 +1,4 @@
-package org.baeldung.resttemplate.web.model;
+package com.baeldung.resttemplate.web.model;
public class Bar {
private String id;
diff --git a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/model/Employee.java b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/model/Employee.java
similarity index 93%
rename from spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/model/Employee.java
rename to spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/model/Employee.java
index a9b84a77b4..bb1ad8cbfa 100644
--- a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/model/Employee.java
+++ b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/model/Employee.java
@@ -1,6 +1,5 @@
-package org.baeldung.resttemplate.web.model;
+package com.baeldung.resttemplate.web.model;
-import java.util.Date;
import java.util.Objects;
public class Employee {
diff --git a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/service/BarConsumerService.java b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/service/BarConsumerService.java
similarity index 80%
rename from spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/service/BarConsumerService.java
rename to spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/service/BarConsumerService.java
index 54a66ea591..485143b0a1 100644
--- a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/service/BarConsumerService.java
+++ b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/service/BarConsumerService.java
@@ -1,7 +1,7 @@
-package org.baeldung.resttemplate.web.service;
+package com.baeldung.resttemplate.web.service;
-import org.baeldung.resttemplate.web.handler.RestTemplateResponseErrorHandler;
-import org.baeldung.resttemplate.web.model.Bar;
+import com.baeldung.resttemplate.web.handler.RestTemplateResponseErrorHandler;
+import com.baeldung.resttemplate.web.model.Bar;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.stereotype.Service;
diff --git a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/service/EmployeeService.java b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/service/EmployeeService.java
similarity index 89%
rename from spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/service/EmployeeService.java
rename to spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/service/EmployeeService.java
index c6562fbc94..18dff3db1b 100644
--- a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/service/EmployeeService.java
+++ b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/service/EmployeeService.java
@@ -1,6 +1,6 @@
-package org.baeldung.resttemplate.web.service;
+package com.baeldung.resttemplate.web.service;
-import org.baeldung.resttemplate.web.model.Employee;
+import com.baeldung.resttemplate.web.model.Employee;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/service/PersonService.java b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/service/PersonService.java
similarity index 58%
rename from spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/service/PersonService.java
rename to spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/service/PersonService.java
index c5ad39e101..e91d2adc5c 100644
--- a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/service/PersonService.java
+++ b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/service/PersonService.java
@@ -1,6 +1,6 @@
-package org.baeldung.resttemplate.web.service;
+package com.baeldung.resttemplate.web.service;
-import org.baeldung.resttemplate.web.dto.Person;
+import com.baeldung.resttemplate.web.dto.Person;
public interface PersonService {
diff --git a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/service/PersonServiceImpl.java b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/service/PersonServiceImpl.java
similarity index 77%
rename from spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/service/PersonServiceImpl.java
rename to spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/service/PersonServiceImpl.java
index 658e0fade0..d7a1bfc2db 100644
--- a/spring-resttemplate/src/main/java/org/baeldung/resttemplate/web/service/PersonServiceImpl.java
+++ b/spring-resttemplate/src/main/java/com/baeldung/resttemplate/web/service/PersonServiceImpl.java
@@ -1,6 +1,6 @@
-package org.baeldung.resttemplate.web.service;
+package com.baeldung.resttemplate.web.service;
-import org.baeldung.resttemplate.web.dto.Person;
+import com.baeldung.resttemplate.web.dto.Person;
import org.springframework.stereotype.Component;
@Component
diff --git a/spring-resttemplate/src/main/java/com/baeldung/sampleapp/web/controller/MyFooController.java b/spring-resttemplate/src/main/java/com/baeldung/sampleapp/web/controller/MyFooController.java
index 11ea5b70c9..5c385edb07 100644
--- a/spring-resttemplate/src/main/java/com/baeldung/sampleapp/web/controller/MyFooController.java
+++ b/spring-resttemplate/src/main/java/com/baeldung/sampleapp/web/controller/MyFooController.java
@@ -20,7 +20,7 @@ import com.baeldung.sampleapp.web.dto.Foo;
import com.baeldung.sampleapp.web.exception.ResourceNotFoundException;
@Controller
-@RequestMapping(value = "/foos")
+@RequestMapping(value = "/foo")
public class MyFooController {
private final Map myfoos;
diff --git a/spring-resttemplate/src/main/java/com/baeldung/SpringContextTest.java b/spring-resttemplate/src/test/java/com/baeldung/SpringContextTest.java
similarity index 100%
rename from spring-resttemplate/src/main/java/com/baeldung/SpringContextTest.java
rename to spring-resttemplate/src/test/java/com/baeldung/SpringContextTest.java
diff --git a/spring-resttemplate/src/test/java/org/baeldung/SpringTestConfig.java b/spring-resttemplate/src/test/java/com/baeldung/SpringTestConfig.java
similarity index 71%
rename from spring-resttemplate/src/test/java/org/baeldung/SpringTestConfig.java
rename to spring-resttemplate/src/test/java/com/baeldung/SpringTestConfig.java
index 7c4bbb4e5e..c626d1021d 100644
--- a/spring-resttemplate/src/test/java/org/baeldung/SpringTestConfig.java
+++ b/spring-resttemplate/src/test/java/com/baeldung/SpringTestConfig.java
@@ -1,4 +1,4 @@
-package org.baeldung;
+package com.baeldung;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.Bean;
@@ -8,12 +8,7 @@ import org.springframework.web.client.RestTemplate;
@Configuration
@EnableAutoConfiguration
-@ComponentScan("org.baeldung")
+@ComponentScan("com.baeldung")
public class SpringTestConfig {
- @Bean
- public RestTemplate restTemplate() {
- return new RestTemplate();
- }
-
}
diff --git a/spring-resttemplate/src/test/java/org/baeldung/client/Consts.java b/spring-resttemplate/src/test/java/com/baeldung/client/Consts.java
similarity index 68%
rename from spring-resttemplate/src/test/java/org/baeldung/client/Consts.java
rename to spring-resttemplate/src/test/java/com/baeldung/client/Consts.java
index b40561d9c3..b392c4d199 100644
--- a/spring-resttemplate/src/test/java/org/baeldung/client/Consts.java
+++ b/spring-resttemplate/src/test/java/com/baeldung/client/Consts.java
@@ -1,4 +1,4 @@
-package org.baeldung.client;
+package com.baeldung.client;
public interface Consts {
int APPLICATION_PORT = 8082;
diff --git a/spring-resttemplate/src/test/java/org/baeldung/client/TestRestTemplateBasicLiveTest.java b/spring-resttemplate/src/test/java/com/baeldung/client/TestRestTemplateBasicLiveTest.java
similarity index 98%
rename from spring-resttemplate/src/test/java/org/baeldung/client/TestRestTemplateBasicLiveTest.java
rename to spring-resttemplate/src/test/java/com/baeldung/client/TestRestTemplateBasicLiveTest.java
index 967c4a6188..9f4b3c9b35 100644
--- a/spring-resttemplate/src/test/java/org/baeldung/client/TestRestTemplateBasicLiveTest.java
+++ b/spring-resttemplate/src/test/java/com/baeldung/client/TestRestTemplateBasicLiveTest.java
@@ -1,10 +1,10 @@
-package org.baeldung.client;
+package com.baeldung.client;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertTrue;
-import org.baeldung.resttemplate.web.dto.Foo;
+import com.baeldung.resttemplate.web.dto.Foo;
import org.junit.Before;
import org.junit.Test;
import org.springframework.boot.test.web.client.TestRestTemplate;
diff --git a/spring-resttemplate/src/test/java/org/baeldung/resttemplate/LargeFileDownloadIntegrationTest.java b/spring-resttemplate/src/test/java/com/baeldung/resttemplate/LargeFileDownloadIntegrationTest.java
similarity index 99%
rename from spring-resttemplate/src/test/java/org/baeldung/resttemplate/LargeFileDownloadIntegrationTest.java
rename to spring-resttemplate/src/test/java/com/baeldung/resttemplate/LargeFileDownloadIntegrationTest.java
index 21639818db..eb5d01d06f 100644
--- a/spring-resttemplate/src/test/java/org/baeldung/resttemplate/LargeFileDownloadIntegrationTest.java
+++ b/spring-resttemplate/src/test/java/com/baeldung/resttemplate/LargeFileDownloadIntegrationTest.java
@@ -1,4 +1,4 @@
-package org.baeldung.resttemplate;
+package com.baeldung.resttemplate;
import org.assertj.core.api.Assertions;
import org.junit.Assert;
diff --git a/spring-resttemplate/src/test/java/org/baeldung/resttemplate/RestTemplateBasicLiveTest.java b/spring-resttemplate/src/test/java/com/baeldung/resttemplate/RestTemplateBasicLiveTest.java
similarity index 98%
rename from spring-resttemplate/src/test/java/org/baeldung/resttemplate/RestTemplateBasicLiveTest.java
rename to spring-resttemplate/src/test/java/com/baeldung/resttemplate/RestTemplateBasicLiveTest.java
index 54e416d008..0dab124316 100644
--- a/spring-resttemplate/src/test/java/org/baeldung/resttemplate/RestTemplateBasicLiveTest.java
+++ b/spring-resttemplate/src/test/java/com/baeldung/resttemplate/RestTemplateBasicLiveTest.java
@@ -1,7 +1,7 @@
-package org.baeldung.resttemplate;
+package com.baeldung.resttemplate;
import static org.apache.commons.codec.binary.Base64.encodeBase64;
-import static org.baeldung.client.Consts.APPLICATION_PORT;
+import static com.baeldung.client.Consts.APPLICATION_PORT;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
@@ -14,8 +14,8 @@ import java.net.URI;
import java.util.Arrays;
import java.util.Set;
-import org.baeldung.resttemplate.web.dto.Foo;
-import org.baeldung.resttemplate.web.handler.RestTemplateResponseErrorHandler;
+import com.baeldung.resttemplate.web.handler.RestTemplateResponseErrorHandler;
+import com.baeldung.resttemplate.web.dto.Foo;
import org.junit.Before;
import org.junit.Test;
import org.springframework.http.HttpEntity;
diff --git a/spring-resttemplate/src/test/java/org/baeldung/resttemplate/postjson/PersonAPILiveTest.java b/spring-resttemplate/src/test/java/com/baeldung/resttemplate/postjson/PersonAPILiveTest.java
similarity index 95%
rename from spring-resttemplate/src/test/java/org/baeldung/resttemplate/postjson/PersonAPILiveTest.java
rename to spring-resttemplate/src/test/java/com/baeldung/resttemplate/postjson/PersonAPILiveTest.java
index 1347cb0c7a..f1861ede92 100644
--- a/spring-resttemplate/src/test/java/org/baeldung/resttemplate/postjson/PersonAPILiveTest.java
+++ b/spring-resttemplate/src/test/java/com/baeldung/resttemplate/postjson/PersonAPILiveTest.java
@@ -1,12 +1,12 @@
-package org.baeldung.resttemplate.postjson;
+package com.baeldung.resttemplate.postjson;
import static org.junit.Assert.assertNotNull;
import java.io.IOException;
import java.net.URI;
-import org.baeldung.resttemplate.RestTemplateConfigurationApplication;
-import org.baeldung.resttemplate.web.dto.Person;
+import com.baeldung.resttemplate.RestTemplateConfigurationApplication;
+import com.baeldung.resttemplate.web.dto.Person;
import org.json.JSONException;
import org.json.JSONObject;
import org.junit.BeforeClass;
diff --git a/spring-resttemplate/src/test/java/org/baeldung/web/handler/RestTemplateResponseErrorHandlerIntegrationTest.java b/spring-resttemplate/src/test/java/com/baeldung/web/handler/RestTemplateResponseErrorHandlerIntegrationTest.java
similarity index 90%
rename from spring-resttemplate/src/test/java/org/baeldung/web/handler/RestTemplateResponseErrorHandlerIntegrationTest.java
rename to spring-resttemplate/src/test/java/com/baeldung/web/handler/RestTemplateResponseErrorHandlerIntegrationTest.java
index 60069cea71..688b6e9d56 100644
--- a/spring-resttemplate/src/test/java/org/baeldung/web/handler/RestTemplateResponseErrorHandlerIntegrationTest.java
+++ b/spring-resttemplate/src/test/java/com/baeldung/web/handler/RestTemplateResponseErrorHandlerIntegrationTest.java
@@ -1,8 +1,8 @@
-package org.baeldung.web.handler;
+package com.baeldung.web.handler;
-import org.baeldung.resttemplate.web.exception.NotFoundException;
-import org.baeldung.resttemplate.web.handler.RestTemplateResponseErrorHandler;
-import org.baeldung.resttemplate.web.model.Bar;
+import com.baeldung.resttemplate.web.exception.NotFoundException;
+import com.baeldung.resttemplate.web.handler.RestTemplateResponseErrorHandler;
+import com.baeldung.resttemplate.web.model.Bar;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceMockRestServiceServerUnitTest.java b/spring-resttemplate/src/test/java/com/baeldung/web/service/EmployeeServiceMockRestServiceServerUnitTest.java
similarity index 88%
rename from spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceMockRestServiceServerUnitTest.java
rename to spring-resttemplate/src/test/java/com/baeldung/web/service/EmployeeServiceMockRestServiceServerUnitTest.java
index f93ba71666..ee01cb6a50 100644
--- a/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceMockRestServiceServerUnitTest.java
+++ b/spring-resttemplate/src/test/java/com/baeldung/web/service/EmployeeServiceMockRestServiceServerUnitTest.java
@@ -1,4 +1,4 @@
-package org.baeldung.web.service;
+package com.baeldung.web.service;
import static org.springframework.test.web.client.match.MockRestRequestMatchers.method;
import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo;
@@ -6,9 +6,9 @@ import static org.springframework.test.web.client.response.MockRestResponseCreat
import java.net.URI;
-import org.baeldung.SpringTestConfig;
-import org.baeldung.resttemplate.web.model.Employee;
-import org.baeldung.resttemplate.web.service.EmployeeService;
+import com.baeldung.SpringTestConfig;
+import com.baeldung.resttemplate.web.model.Employee;
+import com.baeldung.resttemplate.web.service.EmployeeService;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -16,6 +16,7 @@ import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
@@ -28,7 +29,7 @@ import org.springframework.web.client.RestTemplate;
import com.fasterxml.jackson.databind.ObjectMapper;
@RunWith(SpringRunner.class)
-@ContextConfiguration(classes = SpringTestConfig.class)
+@SpringBootTest(classes = SpringTestConfig.class)
public class EmployeeServiceMockRestServiceServerUnitTest {
private static final Logger logger = LoggerFactory.getLogger(EmployeeServiceMockRestServiceServerUnitTest.class);
diff --git a/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceUnitTest.java b/spring-resttemplate/src/test/java/com/baeldung/web/service/EmployeeServiceUnitTest.java
similarity index 84%
rename from spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceUnitTest.java
rename to spring-resttemplate/src/test/java/com/baeldung/web/service/EmployeeServiceUnitTest.java
index f4b391573a..6eb040414b 100644
--- a/spring-resttemplate/src/test/java/org/baeldung/web/service/EmployeeServiceUnitTest.java
+++ b/spring-resttemplate/src/test/java/com/baeldung/web/service/EmployeeServiceUnitTest.java
@@ -1,15 +1,13 @@
-package org.baeldung.web.service;
+package com.baeldung.web.service;
-import org.baeldung.resttemplate.web.model.Employee;
-import org.baeldung.resttemplate.web.service.EmployeeService;
+import com.baeldung.resttemplate.web.model.Employee;
+import com.baeldung.resttemplate.web.service.EmployeeService;
import org.junit.Assert;
-import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
import org.mockito.runners.MockitoJUnitRunner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/spring-resttemplate/src/test/java/org/baeldung/SpringContextTest.java b/spring-resttemplate/src/test/java/org/baeldung/SpringContextTest.java
deleted file mode 100644
index e52d249f0b..0000000000
--- a/spring-resttemplate/src/test/java/org/baeldung/SpringContextTest.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package org.baeldung;
-
-import org.baeldung.resttemplate.RestTemplateConfigurationApplication;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-
-@RunWith(SpringRunner.class)
-@SpringBootTest(classes = RestTemplateConfigurationApplication.class)
-public class SpringContextTest {
-
- @Test
- public void whenSpringContextIsBootstrapped_thenNoExceptions() {
- }
-}
diff --git a/spring-security-modules/spring-security-mvc-boot-1/pom.xml b/spring-security-modules/spring-security-mvc-boot-1/pom.xml
index 7dfee200d4..7ad18376ec 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/pom.xml
+++ b/spring-security-modules/spring-security-mvc-boot-1/pom.xml
@@ -222,10 +222,10 @@
- org.baeldung.custom.Application
+ com.baeldung.roles.custom.Application
-
+
1.1.21.6.1
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/AppConfig.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/AppConfig.java
similarity index 92%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/AppConfig.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/AppConfig.java
index 8719e39a20..ab2cc71fec 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/AppConfig.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/AppConfig.java
@@ -1,4 +1,4 @@
-package com.baeldung;
+package com.baeldung.relationships;
import java.util.Properties;
@@ -19,7 +19,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
@SpringBootApplication
@PropertySource({"classpath:persistence-h2.properties", "classpath:application-defaults.properties"})
-@EnableJpaRepositories(basePackages = { "com.baeldung.data.repositories" })
+@EnableJpaRepositories(basePackages = {"com.baeldung.relationships.repositories"})
@EnableWebMvc
@Import(SpringSecurityConfig.class)
public class AppConfig extends WebMvcConfigurerAdapter {
@@ -41,7 +41,7 @@ public class AppConfig extends WebMvcConfigurerAdapter {
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
final LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
em.setDataSource(dataSource());
- em.setPackagesToScan(new String[] { "com.baeldung.models" });
+ em.setPackagesToScan(new String[] { "com.baeldung.relationships.models" });
em.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
em.setJpaProperties(additionalProperties());
return em;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/SpringSecurityConfig.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/SpringSecurityConfig.java
similarity index 94%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/SpringSecurityConfig.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/SpringSecurityConfig.java
index ee13678a24..88814038a8 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/SpringSecurityConfig.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/SpringSecurityConfig.java
@@ -1,4 +1,4 @@
-package com.baeldung;
+package com.baeldung.relationships;
import javax.annotation.PostConstruct;
import javax.sql.DataSource;
@@ -18,8 +18,8 @@ import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.data.repository.query.SecurityEvaluationContextExtension;
import org.springframework.web.context.WebApplicationContext;
-import com.baeldung.security.AuthenticationSuccessHandlerImpl;
-import com.baeldung.security.CustomUserDetailsService;
+import com.baeldung.relationships.security.AuthenticationSuccessHandlerImpl;
+import com.baeldung.relationships.security.CustomUserDetailsService;
@Configuration
@EnableWebSecurity
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/models/AppUser.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/models/AppUser.java
similarity index 97%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/models/AppUser.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/models/AppUser.java
index e48233f90a..2efd24e879 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/models/AppUser.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/models/AppUser.java
@@ -1,4 +1,4 @@
-package com.baeldung.models;
+package com.baeldung.relationships.models;
import java.util.Date;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/models/Tweet.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/models/Tweet.java
similarity index 96%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/models/Tweet.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/models/Tweet.java
index 54a96deaf3..d8496f89be 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/models/Tweet.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/models/Tweet.java
@@ -1,4 +1,4 @@
-package com.baeldung.models;
+package com.baeldung.relationships.models;
import java.util.HashSet;
import java.util.Set;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/data/repositories/TweetRepository.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/repositories/TweetRepository.java
similarity index 84%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/data/repositories/TweetRepository.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/repositories/TweetRepository.java
index 7d6446ed0d..4e4b16a151 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/data/repositories/TweetRepository.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/repositories/TweetRepository.java
@@ -1,11 +1,11 @@
-package com.baeldung.data.repositories;
+package com.baeldung.relationships.repositories;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
-import com.baeldung.models.Tweet;
+import com.baeldung.relationships.models.Tweet;
public interface TweetRepository extends PagingAndSortingRepository {
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/data/repositories/UserRepository.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/repositories/UserRepository.java
similarity index 76%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/data/repositories/UserRepository.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/repositories/UserRepository.java
index 5240c683e0..883ea332f8 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/data/repositories/UserRepository.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/repositories/UserRepository.java
@@ -1,18 +1,15 @@
-package com.baeldung.data.repositories;
+package com.baeldung.relationships.repositories;
import java.util.Date;
import java.util.List;
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
-import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
-import com.baeldung.models.AppUser;
+import com.baeldung.relationships.models.AppUser;
public interface UserRepository extends CrudRepository {
AppUser findByUsername(String username);
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/security/AppUserPrincipal.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/security/AppUserPrincipal.java
similarity index 93%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/security/AppUserPrincipal.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/security/AppUserPrincipal.java
index 195f9f7bf6..1ae7d95e41 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/security/AppUserPrincipal.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/security/AppUserPrincipal.java
@@ -1,4 +1,4 @@
-package com.baeldung.security;
+package com.baeldung.relationships.security;
import java.util.Collection;
import java.util.Collections;
@@ -8,7 +8,7 @@ import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
-import com.baeldung.models.AppUser;
+import com.baeldung.relationships.models.AppUser;
public class AppUserPrincipal implements UserDetails {
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/security/AuthenticationSuccessHandlerImpl.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/security/AuthenticationSuccessHandlerImpl.java
similarity index 88%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/security/AuthenticationSuccessHandlerImpl.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/security/AuthenticationSuccessHandlerImpl.java
index 3fc2bc6559..1b85294467 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/security/AuthenticationSuccessHandlerImpl.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/security/AuthenticationSuccessHandlerImpl.java
@@ -1,4 +1,4 @@
-package com.baeldung.security;
+package com.baeldung.relationships.security;
import java.io.IOException;
import java.util.Date;
@@ -12,7 +12,7 @@ import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
import org.springframework.stereotype.Component;
-import com.baeldung.data.repositories.UserRepository;
+import com.baeldung.relationships.repositories.UserRepository;
@Component
public class AuthenticationSuccessHandlerImpl implements AuthenticationSuccessHandler {
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/security/CustomUserDetailsService.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/security/CustomUserDetailsService.java
similarity index 87%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/security/CustomUserDetailsService.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/security/CustomUserDetailsService.java
index 016f4f7fa9..10c266bb74 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/security/CustomUserDetailsService.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/security/CustomUserDetailsService.java
@@ -1,4 +1,4 @@
-package com.baeldung.security;
+package com.baeldung.relationships.security;
import javax.annotation.PostConstruct;
@@ -9,8 +9,8 @@ import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import org.springframework.web.context.WebApplicationContext;
-import com.baeldung.data.repositories.UserRepository;
-import com.baeldung.models.AppUser;
+import com.baeldung.relationships.repositories.UserRepository;
+import com.baeldung.relationships.models.AppUser;
@Service
public class CustomUserDetailsService implements UserDetailsService {
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/util/DummyContentUtil.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/util/DummyContentUtil.java
similarity index 95%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/util/DummyContentUtil.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/util/DummyContentUtil.java
index f1640264d2..b8e5192b48 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/util/DummyContentUtil.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/relationships/util/DummyContentUtil.java
@@ -1,4 +1,4 @@
-package com.baeldung.util;
+package com.baeldung.relationships.util;
import java.util.ArrayList;
import java.util.Collection;
@@ -10,8 +10,8 @@ import java.util.stream.IntStream;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
-import com.baeldung.models.AppUser;
-import com.baeldung.models.Tweet;
+import com.baeldung.relationships.models.AppUser;
+import com.baeldung.relationships.models.Tweet;
public class DummyContentUtil {
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/Application.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/Application.java
similarity index 88%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/Application.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/Application.java
index e051e5a853..e7ace1f962 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/Application.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/Application.java
@@ -1,4 +1,4 @@
-package org.baeldung.custom;
+package com.baeldung.roles.custom;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -7,7 +7,7 @@ import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.PropertySource;
@SpringBootApplication
-@ComponentScan("org.baeldung.custom")
+@ComponentScan("com.baeldung.roles.custom")
@PropertySource("classpath:application-defaults.properties")
public class Application extends SpringBootServletInitializer {
public static void main(String[] args) {
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/config/MethodSecurityConfig.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/config/MethodSecurityConfig.java
similarity index 83%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/config/MethodSecurityConfig.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/config/MethodSecurityConfig.java
index 6a005153dc..57ab8b120f 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/config/MethodSecurityConfig.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/config/MethodSecurityConfig.java
@@ -1,7 +1,7 @@
-package org.baeldung.custom.config;
+package com.baeldung.roles.custom.config;
-import org.baeldung.custom.security.CustomMethodSecurityExpressionHandler;
-import org.baeldung.custom.security.CustomPermissionEvaluator;
+import com.baeldung.roles.custom.security.CustomMethodSecurityExpressionHandler;
+import com.baeldung.roles.custom.security.CustomPermissionEvaluator;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/config/MvcConfig.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/config/MvcConfig.java
similarity index 97%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/config/MvcConfig.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/config/MvcConfig.java
index 58d11ea9ae..c99d1e38a5 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/config/MvcConfig.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/config/MvcConfig.java
@@ -1,4 +1,4 @@
-package org.baeldung.custom.config;
+package com.baeldung.roles.custom.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/config/SecurityConfig.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/config/SecurityConfig.java
similarity index 96%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/config/SecurityConfig.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/config/SecurityConfig.java
index 06357650dc..6bf04120ab 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/config/SecurityConfig.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/config/SecurityConfig.java
@@ -1,4 +1,4 @@
-package org.baeldung.custom.config;
+package com.baeldung.roles.custom.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/SetupData.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/SetupData.java
similarity index 83%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/SetupData.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/SetupData.java
index f0fcce3908..ab57e7436c 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/SetupData.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/SetupData.java
@@ -1,16 +1,16 @@
-package org.baeldung.custom.persistence;
+package com.baeldung.roles.custom.persistence;
import java.util.Arrays;
import java.util.HashSet;
import javax.annotation.PostConstruct;
-import org.baeldung.custom.persistence.dao.OrganizationRepository;
-import org.baeldung.custom.persistence.dao.PrivilegeRepository;
-import org.baeldung.custom.persistence.dao.UserRepository;
-import org.baeldung.custom.persistence.model.Organization;
-import org.baeldung.custom.persistence.model.Privilege;
-import org.baeldung.custom.persistence.model.User;
+import com.baeldung.roles.custom.persistence.dao.OrganizationRepository;
+import com.baeldung.roles.custom.persistence.dao.PrivilegeRepository;
+import com.baeldung.roles.custom.persistence.dao.UserRepository;
+import com.baeldung.roles.custom.persistence.model.Organization;
+import com.baeldung.roles.custom.persistence.model.Privilege;
+import com.baeldung.roles.custom.persistence.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/dao/OrganizationRepository.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/dao/OrganizationRepository.java
similarity index 63%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/dao/OrganizationRepository.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/dao/OrganizationRepository.java
index 1319a7b9f8..2f585f3527 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/dao/OrganizationRepository.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/dao/OrganizationRepository.java
@@ -1,6 +1,6 @@
-package org.baeldung.custom.persistence.dao;
+package com.baeldung.roles.custom.persistence.dao;
-import org.baeldung.custom.persistence.model.Organization;
+import com.baeldung.roles.custom.persistence.model.Organization;
import org.springframework.data.jpa.repository.JpaRepository;
public interface OrganizationRepository extends JpaRepository {
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/dao/PrivilegeRepository.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/dao/PrivilegeRepository.java
similarity index 62%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/dao/PrivilegeRepository.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/dao/PrivilegeRepository.java
index c232bb986c..c83e0f505e 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/dao/PrivilegeRepository.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/dao/PrivilegeRepository.java
@@ -1,6 +1,6 @@
-package org.baeldung.custom.persistence.dao;
+package com.baeldung.roles.custom.persistence.dao;
-import org.baeldung.custom.persistence.model.Privilege;
+import com.baeldung.roles.custom.persistence.model.Privilege;
import org.springframework.data.jpa.repository.JpaRepository;
public interface PrivilegeRepository extends JpaRepository {
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/dao/UserRepository.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/dao/UserRepository.java
similarity index 74%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/dao/UserRepository.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/dao/UserRepository.java
index 68dd1d756c..884a998219 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/dao/UserRepository.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/dao/UserRepository.java
@@ -1,6 +1,6 @@
-package org.baeldung.custom.persistence.dao;
+package com.baeldung.roles.custom.persistence.dao;
-import org.baeldung.custom.persistence.model.User;
+import com.baeldung.roles.custom.persistence.model.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.transaction.annotation.Transactional;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/model/Foo.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/model/Foo.java
similarity index 97%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/model/Foo.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/model/Foo.java
index f139382eea..3dbf48f7ce 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/model/Foo.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/model/Foo.java
@@ -1,4 +1,4 @@
-package org.baeldung.custom.persistence.model;
+package com.baeldung.roles.custom.persistence.model;
import javax.persistence.Column;
import javax.persistence.Entity;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/model/Organization.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/model/Organization.java
similarity index 97%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/model/Organization.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/model/Organization.java
index 1fdb88e320..0d0220b6b2 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/model/Organization.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/model/Organization.java
@@ -1,4 +1,4 @@
-package org.baeldung.custom.persistence.model;
+package com.baeldung.roles.custom.persistence.model;
import javax.persistence.Column;
import javax.persistence.Entity;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/model/Privilege.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/model/Privilege.java
similarity index 97%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/model/Privilege.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/model/Privilege.java
index ed3edd5085..60e0506641 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/model/Privilege.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/model/Privilege.java
@@ -1,4 +1,4 @@
-package org.baeldung.custom.persistence.model;
+package com.baeldung.roles.custom.persistence.model;
import javax.persistence.Column;
import javax.persistence.Entity;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/model/User.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/model/User.java
similarity index 98%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/model/User.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/model/User.java
index c14ef034b4..219f40a3df 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/persistence/model/User.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/persistence/model/User.java
@@ -1,4 +1,4 @@
-package org.baeldung.custom.persistence.model;
+package com.baeldung.roles.custom.persistence.model;
import java.util.Set;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/CustomMethodSecurityExpressionHandler.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/CustomMethodSecurityExpressionHandler.java
similarity index 96%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/CustomMethodSecurityExpressionHandler.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/CustomMethodSecurityExpressionHandler.java
index 646f5a387f..76e94a9dd4 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/CustomMethodSecurityExpressionHandler.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/CustomMethodSecurityExpressionHandler.java
@@ -1,4 +1,4 @@
-package org.baeldung.custom.security;
+package com.baeldung.roles.custom.security;
import org.aopalliance.intercept.MethodInvocation;
import org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/CustomMethodSecurityExpressionRoot.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/CustomMethodSecurityExpressionRoot.java
similarity index 92%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/CustomMethodSecurityExpressionRoot.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/CustomMethodSecurityExpressionRoot.java
index b2f2be8cf5..dd9f6a5786 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/CustomMethodSecurityExpressionRoot.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/CustomMethodSecurityExpressionRoot.java
@@ -1,6 +1,6 @@
-package org.baeldung.custom.security;
+package com.baeldung.roles.custom.security;
-import org.baeldung.custom.persistence.model.User;
+import com.baeldung.roles.custom.persistence.model.User;
import org.springframework.security.access.expression.SecurityExpressionRoot;
import org.springframework.security.access.expression.method.MethodSecurityExpressionOperations;
import org.springframework.security.core.Authentication;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/CustomPermissionEvaluator.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/CustomPermissionEvaluator.java
similarity index 97%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/CustomPermissionEvaluator.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/CustomPermissionEvaluator.java
index f436b4488b..d69e405b28 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/CustomPermissionEvaluator.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/CustomPermissionEvaluator.java
@@ -1,4 +1,4 @@
-package org.baeldung.custom.security;
+package com.baeldung.roles.custom.security;
import java.io.Serializable;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/MySecurityExpressionRoot.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/MySecurityExpressionRoot.java
similarity index 98%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/MySecurityExpressionRoot.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/MySecurityExpressionRoot.java
index 03d18cb755..8448ad9075 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/MySecurityExpressionRoot.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/MySecurityExpressionRoot.java
@@ -1,11 +1,11 @@
-package org.baeldung.custom.security;
+package com.baeldung.roles.custom.security;
import java.io.Serializable;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
-import org.baeldung.custom.persistence.model.User;
+import com.baeldung.roles.custom.persistence.model.User;
import org.springframework.security.access.PermissionEvaluator;
import org.springframework.security.access.expression.method.MethodSecurityExpressionOperations;
import org.springframework.security.access.hierarchicalroles.RoleHierarchy;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/MyUserDetailsService.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/MyUserDetailsService.java
similarity index 83%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/MyUserDetailsService.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/MyUserDetailsService.java
index b9b40fbcb9..c6514d6c05 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/MyUserDetailsService.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/MyUserDetailsService.java
@@ -1,7 +1,7 @@
-package org.baeldung.custom.security;
+package com.baeldung.roles.custom.security;
-import org.baeldung.custom.persistence.dao.UserRepository;
-import org.baeldung.custom.persistence.model.User;
+import com.baeldung.roles.custom.persistence.dao.UserRepository;
+import com.baeldung.roles.custom.persistence.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/MyUserPrincipal.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/MyUserPrincipal.java
similarity index 89%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/MyUserPrincipal.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/MyUserPrincipal.java
index 7d57227316..41741c64f4 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/security/MyUserPrincipal.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/security/MyUserPrincipal.java
@@ -1,11 +1,11 @@
-package org.baeldung.custom.security;
+package com.baeldung.roles.custom.security;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import org.baeldung.custom.persistence.model.Privilege;
-import org.baeldung.custom.persistence.model.User;
+import com.baeldung.roles.custom.persistence.model.Privilege;
+import com.baeldung.roles.custom.persistence.model.User;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/web/MainController.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/web/MainController.java
similarity index 87%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/web/MainController.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/web/MainController.java
index 74de45d1a8..beb12f7749 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/custom/web/MainController.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/custom/web/MainController.java
@@ -1,9 +1,9 @@
-package org.baeldung.custom.web;
+package com.baeldung.roles.custom.web;
-import org.baeldung.custom.persistence.dao.OrganizationRepository;
-import org.baeldung.custom.persistence.model.Foo;
-import org.baeldung.custom.persistence.model.Organization;
-import org.baeldung.custom.security.MyUserPrincipal;
+import com.baeldung.roles.custom.persistence.dao.OrganizationRepository;
+import com.baeldung.roles.custom.persistence.model.Foo;
+import com.baeldung.roles.custom.persistence.model.Organization;
+import com.baeldung.roles.custom.security.MyUserPrincipal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.security.access.prepost.PreAuthorize;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/IpApplication.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/IpApplication.java
similarity index 90%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/IpApplication.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/IpApplication.java
index d77414c54e..b9a86fee3e 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/IpApplication.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/IpApplication.java
@@ -1,4 +1,4 @@
-package org.baeldung.ip;
+package com.baeldung.roles.ip;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -7,7 +7,7 @@ import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.PropertySource;
@SpringBootApplication
-@ComponentScan("org.baeldung.ip")
+@ComponentScan("com.baeldung.ip")
@PropertySource("classpath:application-defaults.properties")
public class IpApplication extends SpringBootServletInitializer {
public static void main(String[] args) {
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/config/CustomIpAuthenticationProvider.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/config/CustomIpAuthenticationProvider.java
similarity index 98%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/config/CustomIpAuthenticationProvider.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/config/CustomIpAuthenticationProvider.java
index 078dd81259..adcadb65e8 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/config/CustomIpAuthenticationProvider.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/config/CustomIpAuthenticationProvider.java
@@ -1,4 +1,4 @@
-package org.baeldung.ip.config;
+package com.baeldung.roles.ip.config;
import java.util.ArrayList;
import java.util.HashSet;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/config/SecurityConfig.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/config/SecurityConfig.java
similarity index 97%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/config/SecurityConfig.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/config/SecurityConfig.java
index 3a8032a734..46ba62afb3 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/config/SecurityConfig.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/config/SecurityConfig.java
@@ -1,4 +1,4 @@
-package org.baeldung.ip.config;
+package com.baeldung.roles.ip.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/config/SecurityXmlConfig.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/config/SecurityXmlConfig.java
similarity index 78%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/config/SecurityXmlConfig.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/config/SecurityXmlConfig.java
index 1d22ca4c67..4b2cf43f6a 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/config/SecurityXmlConfig.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/config/SecurityXmlConfig.java
@@ -1,4 +1,4 @@
-package org.baeldung.ip.config;
+package com.baeldung.roles.ip.config;
//@Configuration
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/web/MainController.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/web/MainController.java
similarity index 94%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/web/MainController.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/web/MainController.java
index 940194c421..438b668c5f 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/ip/web/MainController.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/ip/web/MainController.java
@@ -1,11 +1,11 @@
-package org.baeldung.ip.web;
+package com.baeldung.roles.ip.web;
import java.util.List;
import javax.servlet.Filter;
import javax.servlet.http.HttpServletRequest;
-import org.baeldung.custom.persistence.model.Foo;
+import com.baeldung.roles.custom.persistence.model.Foo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.security.web.FilterChainProxy;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/CustomAuthenticationProvider.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/CustomAuthenticationProvider.java
similarity index 89%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/CustomAuthenticationProvider.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/CustomAuthenticationProvider.java
index d7195ac358..5168e64b4a 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/CustomAuthenticationProvider.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/CustomAuthenticationProvider.java
@@ -1,7 +1,7 @@
-package org.baeldung.rolesauthorities;
+package com.baeldung.roles.rolesauthorities;
-import org.baeldung.rolesauthorities.model.User;
-import org.baeldung.rolesauthorities.persistence.UserRepository;
+import com.baeldung.roles.rolesauthorities.model.User;
+import com.baeldung.roles.rolesauthorities.persistence.UserRepository;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/MyLogoutSuccessHandler.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/MyLogoutSuccessHandler.java
similarity index 95%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/MyLogoutSuccessHandler.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/MyLogoutSuccessHandler.java
index b0dc0b7537..23104e5292 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/MyLogoutSuccessHandler.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/MyLogoutSuccessHandler.java
@@ -1,4 +1,4 @@
-package org.baeldung.rolesauthorities;
+package com.baeldung.roles.rolesauthorities;
import java.io.IOException;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/MyUserDetailsService.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/MyUserDetailsService.java
similarity index 90%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/MyUserDetailsService.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/MyUserDetailsService.java
index f38b867a75..18230ba794 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/MyUserDetailsService.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/MyUserDetailsService.java
@@ -1,13 +1,13 @@
-package org.baeldung.rolesauthorities;
+package com.baeldung.roles.rolesauthorities;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
-import org.baeldung.rolesauthorities.model.Role;
-import org.baeldung.rolesauthorities.model.User;
-import org.baeldung.rolesauthorities.persistence.UserRepository;
+import com.baeldung.roles.rolesauthorities.model.Role;
+import com.baeldung.roles.rolesauthorities.model.User;
+import com.baeldung.roles.rolesauthorities.persistence.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/RolesAuthoritiesApplication.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/RolesAuthoritiesApplication.java
similarity index 87%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/RolesAuthoritiesApplication.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/RolesAuthoritiesApplication.java
index 3c4e6f7b5a..d3e54b4303 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/RolesAuthoritiesApplication.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/RolesAuthoritiesApplication.java
@@ -1,4 +1,4 @@
-package org.baeldung.rolesauthorities;
+package com.baeldung.roles.rolesauthorities;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@@ -8,7 +8,7 @@ import org.springframework.context.annotation.Configuration;
@Configuration
@EnableAutoConfiguration
-@ComponentScan("org.baeldung.rolesauthorities")
+@ComponentScan("com.baeldung.rolesauthorities")
public class RolesAuthoritiesApplication extends SpringBootServletInitializer {
public static void main(String[] args) {
System.setProperty("spring.profiles.default", "rolesauthorities");
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/config/MvcConfig.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/config/MvcConfig.java
similarity index 97%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/config/MvcConfig.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/config/MvcConfig.java
index c42958457e..61394b6178 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/config/MvcConfig.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/config/MvcConfig.java
@@ -1,4 +1,4 @@
-package org.baeldung.rolesauthorities.config;
+package com.baeldung.roles.rolesauthorities.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/config/SecurityConfig.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/config/SecurityConfig.java
similarity index 90%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/config/SecurityConfig.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/config/SecurityConfig.java
index 7624dd7d39..cb8476fcc7 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/config/SecurityConfig.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/config/SecurityConfig.java
@@ -1,7 +1,7 @@
-package org.baeldung.rolesauthorities.config;
+package com.baeldung.roles.rolesauthorities.config;
-import org.baeldung.rolesauthorities.CustomAuthenticationProvider;
-import org.baeldung.rolesauthorities.persistence.UserRepository;
+import com.baeldung.roles.rolesauthorities.CustomAuthenticationProvider;
+import com.baeldung.roles.rolesauthorities.persistence.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
@@ -18,7 +18,7 @@ import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;
@Configuration
-@ComponentScan(basePackages = { "org.baeldung.rolesauthorities" })
+@ComponentScan(basePackages = {"com.baeldung.rolesauthorities"})
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@@ -76,7 +76,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Bean
public DaoAuthenticationProvider authProvider() {
- final CustomAuthenticationProvider authProvider
+ final CustomAuthenticationProvider authProvider
= new CustomAuthenticationProvider(userRepository, userDetailsService);
authProvider.setPasswordEncoder(encoder());
return authProvider;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/model/Privilege.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/model/Privilege.java
similarity index 97%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/model/Privilege.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/model/Privilege.java
index ab2cd08610..507beaffa8 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/model/Privilege.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/model/Privilege.java
@@ -1,4 +1,4 @@
-package org.baeldung.rolesauthorities.model;
+package com.baeldung.roles.rolesauthorities.model;
import java.util.Collection;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/model/Role.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/model/Role.java
similarity index 97%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/model/Role.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/model/Role.java
index ac33e32fcf..a284d92090 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/model/Role.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/model/Role.java
@@ -1,4 +1,4 @@
-package org.baeldung.rolesauthorities.model;
+package com.baeldung.roles.rolesauthorities.model;
import java.util.Collection;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/model/User.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/model/User.java
similarity index 98%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/model/User.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/model/User.java
index dc1096541d..ebf0c9b310 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/model/User.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/model/User.java
@@ -1,4 +1,4 @@
-package org.baeldung.rolesauthorities.model;
+package com.baeldung.roles.rolesauthorities.model;
import java.util.Collection;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/IUserService.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/IUserService.java
new file mode 100644
index 0000000000..be9cb911d7
--- /dev/null
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/IUserService.java
@@ -0,0 +1,9 @@
+package com.baeldung.roles.rolesauthorities.persistence;
+
+import com.baeldung.roles.rolesauthorities.model.User;
+
+public interface IUserService {
+
+ User findUserByEmail(String email);
+
+}
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/PrivilegeRepository.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/PrivilegeRepository.java
similarity index 65%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/PrivilegeRepository.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/PrivilegeRepository.java
index 05d5f2b870..f8ba7def49 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/PrivilegeRepository.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/PrivilegeRepository.java
@@ -1,6 +1,6 @@
-package org.baeldung.rolesauthorities.persistence;
+package com.baeldung.roles.rolesauthorities.persistence;
-import org.baeldung.rolesauthorities.model.Privilege;
+import com.baeldung.roles.rolesauthorities.model.Privilege;
import org.springframework.data.jpa.repository.JpaRepository;
public interface PrivilegeRepository extends JpaRepository {
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/RoleRepository.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/RoleRepository.java
similarity index 63%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/RoleRepository.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/RoleRepository.java
index 25e3b3a1f6..e5833712fe 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/RoleRepository.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/RoleRepository.java
@@ -1,6 +1,6 @@
-package org.baeldung.rolesauthorities.persistence;
+package com.baeldung.roles.rolesauthorities.persistence;
-import org.baeldung.rolesauthorities.model.Role;
+import com.baeldung.roles.rolesauthorities.model.Role;
import org.springframework.data.jpa.repository.JpaRepository;
public interface RoleRepository extends JpaRepository {
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/SetupDataLoader.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/SetupDataLoader.java
similarity index 93%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/SetupDataLoader.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/SetupDataLoader.java
index 46dad4f06d..140fc56e53 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/SetupDataLoader.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/SetupDataLoader.java
@@ -1,13 +1,13 @@
-package org.baeldung.rolesauthorities.persistence;
+package com.baeldung.roles.rolesauthorities.persistence;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
-import org.baeldung.rolesauthorities.model.Privilege;
-import org.baeldung.rolesauthorities.model.Role;
-import org.baeldung.rolesauthorities.model.User;
+import com.baeldung.roles.rolesauthorities.model.Privilege;
+import com.baeldung.roles.rolesauthorities.model.Role;
+import com.baeldung.roles.rolesauthorities.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/UserRepository.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/UserRepository.java
similarity index 64%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/UserRepository.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/UserRepository.java
index bca2953153..6801eec01d 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/UserRepository.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/UserRepository.java
@@ -1,6 +1,6 @@
-package org.baeldung.rolesauthorities.persistence;
+package com.baeldung.roles.rolesauthorities.persistence;
-import org.baeldung.rolesauthorities.model.User;
+import com.baeldung.roles.rolesauthorities.model.User;
import org.springframework.data.jpa.repository.JpaRepository;
public interface UserRepository extends JpaRepository {
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/UserService.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/UserService.java
similarity index 77%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/UserService.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/UserService.java
index 3b16c78898..17770e5cd0 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/UserService.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/rolesauthorities/persistence/UserService.java
@@ -1,8 +1,8 @@
-package org.baeldung.rolesauthorities.persistence;
+package com.baeldung.roles.rolesauthorities.persistence;
import javax.transaction.Transactional;
-import org.baeldung.rolesauthorities.model.User;
+import com.baeldung.roles.rolesauthorities.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/MinuteBasedVoter.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/MinuteBasedVoter.java
similarity index 96%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/MinuteBasedVoter.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/MinuteBasedVoter.java
index 2beda1e557..6970441a4e 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/MinuteBasedVoter.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/MinuteBasedVoter.java
@@ -1,4 +1,4 @@
-package org.baeldung.voter;
+package com.baeldung.roles.voter;
import java.time.LocalDateTime;
import java.util.Collection;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/VoterApplication.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/VoterApplication.java
similarity index 83%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/VoterApplication.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/VoterApplication.java
index d2078e6115..d3e0652ae9 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/VoterApplication.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/VoterApplication.java
@@ -1,4 +1,4 @@
-package org.baeldung.voter;
+package com.baeldung.roles.voter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@@ -7,7 +7,7 @@ import org.springframework.context.annotation.Configuration;
@Configuration
@EnableAutoConfiguration
-@ComponentScan(basePackages = { "org.baeldung.voter" })
+@ComponentScan(basePackages = {"com.baeldung.voter"})
public class VoterApplication {
public static void main(String[] args) {
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/VoterMvcConfig.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/VoterMvcConfig.java
similarity index 71%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/VoterMvcConfig.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/VoterMvcConfig.java
index 8f41153f06..f11a4ae06c 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/VoterMvcConfig.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/VoterMvcConfig.java
@@ -1,10 +1,8 @@
-package org.baeldung.voter;
+package com.baeldung.roles.voter;
import org.springframework.context.annotation.Configuration;
-import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
/**
* Created by ambrusadrianz on 30/09/2016.
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/WebSecurityConfig.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/WebSecurityConfig.java
similarity index 96%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/WebSecurityConfig.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/WebSecurityConfig.java
index 84ed070e8e..8a0f438b49 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/WebSecurityConfig.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/WebSecurityConfig.java
@@ -1,4 +1,4 @@
-package org.baeldung.voter;
+package com.baeldung.roles.voter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
@@ -15,7 +15,6 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.access.expression.WebExpressionVoter;
-import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
import java.util.Arrays;
import java.util.List;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/XmlSecurityConfig.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/XmlSecurityConfig.java
similarity index 60%
rename from spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/XmlSecurityConfig.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/XmlSecurityConfig.java
index 8041585f42..0ef2ef51c7 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/voter/XmlSecurityConfig.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/XmlSecurityConfig.java
@@ -1,7 +1,4 @@
-package org.baeldung.voter;
-
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.ImportResource;
+package com.baeldung.roles.voter;
/**
* Created by ambrusadrianz on 09/10/2016.
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/IUserService.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/IUserService.java
deleted file mode 100644
index 2c508cbd20..0000000000
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/org/baeldung/rolesauthorities/persistence/IUserService.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.baeldung.rolesauthorities.persistence;
-
-import org.baeldung.rolesauthorities.model.User;
-
-public interface IUserService {
-
- User findUserByEmail(String email);
-
-}
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/resources/spring-security-custom-voter.xml b/spring-security-modules/spring-security-mvc-boot-1/src/main/resources/spring-security-custom-voter.xml
index 0b334a3694..9f510280a1 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/resources/spring-security-custom-voter.xml
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/resources/spring-security-custom-voter.xml
@@ -22,12 +22,12 @@
-
+
-
+
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/relationships/SpringDataWithSecurityIntegrationTest.java b/spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/relationships/SpringDataWithSecurityIntegrationTest.java
index b2def82c51..54120650d9 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/relationships/SpringDataWithSecurityIntegrationTest.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/relationships/SpringDataWithSecurityIntegrationTest.java
@@ -1,12 +1,11 @@
package com.baeldung.relationships;
-import com.baeldung.AppConfig;
-import com.baeldung.data.repositories.TweetRepository;
-import com.baeldung.data.repositories.UserRepository;
-import com.baeldung.models.AppUser;
-import com.baeldung.models.Tweet;
-import com.baeldung.security.AppUserPrincipal;
-import com.baeldung.util.DummyContentUtil;
+import com.baeldung.relationships.repositories.TweetRepository;
+import com.baeldung.relationships.repositories.UserRepository;
+import com.baeldung.relationships.models.AppUser;
+import com.baeldung.relationships.models.Tweet;
+import com.baeldung.relationships.security.AppUserPrincipal;
+import com.baeldung.relationships.util.DummyContentUtil;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/roles/SpringContextTest.java
similarity index 83%
rename from spring-security-modules/spring-security-mvc-boot-1/src/test/java/org/baeldung/SpringContextTest.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/roles/SpringContextTest.java
index 2041249b71..7b23b878c8 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/test/java/org/baeldung/SpringContextTest.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/roles/SpringContextTest.java
@@ -1,6 +1,6 @@
-package org.baeldung;
+package com.baeldung.roles;
-import org.baeldung.custom.Application;
+import com.baeldung.roles.custom.Application;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/test/java/org/baeldung/web/ApplicationLiveTest.java b/spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/roles/web/ApplicationLiveTest.java
similarity index 94%
rename from spring-security-modules/spring-security-mvc-boot-1/src/test/java/org/baeldung/web/ApplicationLiveTest.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/roles/web/ApplicationLiveTest.java
index e199411e58..5a040b8dea 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/test/java/org/baeldung/web/ApplicationLiveTest.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/roles/web/ApplicationLiveTest.java
@@ -1,9 +1,9 @@
-package org.baeldung.web;
+package com.baeldung.roles.web;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import org.baeldung.custom.persistence.model.Foo;
+import com.baeldung.roles.custom.persistence.model.Foo;
import io.restassured.RestAssured;
import io.restassured.authentication.FormAuthConfig;
@@ -13,7 +13,7 @@ import io.restassured.specification.RequestSpecification;
import org.junit.Test;
import org.springframework.http.MediaType;
-// In order to execute these tests, org.baeldung.custom.Application needs to be running.
+// In order to execute these tests, com.baeldung.custom.Application needs to be running.
public class ApplicationLiveTest {
@Test
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/test/java/org/baeldung/web/CustomUserDetailsServiceIntegrationTest.java b/spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/roles/web/CustomUserDetailsServiceIntegrationTest.java
similarity index 95%
rename from spring-security-modules/spring-security-mvc-boot-1/src/test/java/org/baeldung/web/CustomUserDetailsServiceIntegrationTest.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/roles/web/CustomUserDetailsServiceIntegrationTest.java
index a69b52c0dd..df7645150f 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/test/java/org/baeldung/web/CustomUserDetailsServiceIntegrationTest.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/roles/web/CustomUserDetailsServiceIntegrationTest.java
@@ -1,4 +1,4 @@
-package org.baeldung.web;
+package com.baeldung.roles.web;
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.csrf;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
@@ -7,8 +7,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import org.apache.http.HttpHeaders;
-import org.baeldung.custom.Application;
-import org.baeldung.custom.persistence.model.Foo;
+import com.baeldung.roles.custom.Application;
+import com.baeldung.roles.custom.persistence.model.Foo;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
@@ -59,7 +59,7 @@ public class CustomUserDetailsServiceIntegrationTest {
@WithAnonymousUser
public void givenAnonymous_whenRequestFoo_thenRetrieveUnauthorized() throws Exception {
this.mvc.perform(get("/foos/1").with(csrf()))
- .andExpect(status().isFound());
+ .andExpect(status().isFound());
}
@Test
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/test/java/org/baeldung/web/IpLiveTest.java b/spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/roles/web/IpLiveTest.java
similarity index 90%
rename from spring-security-modules/spring-security-mvc-boot-1/src/test/java/org/baeldung/web/IpLiveTest.java
rename to spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/roles/web/IpLiveTest.java
index 761f5450f7..2d0e2e5402 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/test/java/org/baeldung/web/IpLiveTest.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/test/java/com/baeldung/roles/web/IpLiveTest.java
@@ -1,4 +1,4 @@
-package org.baeldung.web;
+package com.baeldung.roles.web;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -8,7 +8,7 @@ import io.restassured.response.Response;
import org.junit.Test;
-// In order to execute these tests, org.baeldung.ip.IpApplication needs to be running.
+// In order to execute these tests, com.baeldung.ip.IpApplication needs to be running.
public class IpLiveTest {
@Test
diff --git a/spring-security-modules/spring-security-mvc-boot-2/pom.xml b/spring-security-modules/spring-security-mvc-boot-2/pom.xml
index 565528e070..668eb04cd9 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/pom.xml
+++ b/spring-security-modules/spring-security-mvc-boot-2/pom.xml
@@ -222,16 +222,15 @@
- org.baeldung.custom.Application
-
-
+
+
+ com.baeldung.multiplelogin.MultipleLoginApplication
-
+
-
+
1.1.21.6.1
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/h2/H2JdbcAuthenticationApplication.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/h2/H2JdbcAuthenticationApplication.java
similarity index 92%
rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/h2/H2JdbcAuthenticationApplication.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/h2/H2JdbcAuthenticationApplication.java
index 6936cdc560..d71885d73c 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/h2/H2JdbcAuthenticationApplication.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/h2/H2JdbcAuthenticationApplication.java
@@ -1,4 +1,4 @@
-package org.baeldung.jdbcauthentication.h2;
+package com.baeldung.jdbcauthentication.h2;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/h2/config/SecurityConfiguration.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/h2/config/SecurityConfiguration.java
similarity index 97%
rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/h2/config/SecurityConfiguration.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/h2/config/SecurityConfiguration.java
index 8b8696f0b2..50dc5b6958 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/h2/config/SecurityConfiguration.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/h2/config/SecurityConfiguration.java
@@ -1,4 +1,4 @@
-package org.baeldung.jdbcauthentication.h2.config;
+package com.baeldung.jdbcauthentication.h2.config;
import javax.sql.DataSource;
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/h2/web/UserController.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/h2/web/UserController.java
similarity index 89%
rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/h2/web/UserController.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/h2/web/UserController.java
index 0955061614..03271677a4 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/h2/web/UserController.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/h2/web/UserController.java
@@ -1,4 +1,4 @@
-package org.baeldung.jdbcauthentication.h2.web;
+package com.baeldung.jdbcauthentication.h2.web;
import java.security.Principal;
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/mysql/MySqlJdbcAuthenticationApplication.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/mysql/MySqlJdbcAuthenticationApplication.java
similarity index 90%
rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/mysql/MySqlJdbcAuthenticationApplication.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/mysql/MySqlJdbcAuthenticationApplication.java
index 52934e0096..1f4c54e512 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/mysql/MySqlJdbcAuthenticationApplication.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/mysql/MySqlJdbcAuthenticationApplication.java
@@ -1,4 +1,4 @@
-package org.baeldung.jdbcauthentication.mysql;
+package com.baeldung.jdbcauthentication.mysql;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/mysql/config/SecurityConfiguration.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/mysql/config/SecurityConfiguration.java
similarity index 95%
rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/mysql/config/SecurityConfiguration.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/mysql/config/SecurityConfiguration.java
index 157c0be748..a0584818cd 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/mysql/config/SecurityConfiguration.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/mysql/config/SecurityConfiguration.java
@@ -1,4 +1,4 @@
-package org.baeldung.jdbcauthentication.mysql.config;
+package com.baeldung.jdbcauthentication.mysql.config;
import javax.sql.DataSource;
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/mysql/web/UserController.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/mysql/web/UserController.java
similarity index 88%
rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/mysql/web/UserController.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/mysql/web/UserController.java
index f1060b5f78..ed15f8bfe6 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/mysql/web/UserController.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/mysql/web/UserController.java
@@ -1,4 +1,4 @@
-package org.baeldung.jdbcauthentication.mysql.web;
+package com.baeldung.jdbcauthentication.mysql.web;
import java.security.Principal;
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/postgre/PostgreJdbcAuthenticationApplication.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/postgre/PostgreJdbcAuthenticationApplication.java
similarity index 90%
rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/postgre/PostgreJdbcAuthenticationApplication.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/postgre/PostgreJdbcAuthenticationApplication.java
index 2c4d1a5255..4b074ef51d 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/postgre/PostgreJdbcAuthenticationApplication.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/postgre/PostgreJdbcAuthenticationApplication.java
@@ -1,4 +1,4 @@
-package org.baeldung.jdbcauthentication.postgre;
+package com.baeldung.jdbcauthentication.postgre;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/postgre/config/SecurityConfiguration.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/postgre/config/SecurityConfiguration.java
similarity index 93%
rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/postgre/config/SecurityConfiguration.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/postgre/config/SecurityConfiguration.java
index ba79635852..85dc9d364c 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/postgre/config/SecurityConfiguration.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/postgre/config/SecurityConfiguration.java
@@ -1,4 +1,4 @@
-package org.baeldung.jdbcauthentication.postgre.config;
+package com.baeldung.jdbcauthentication.postgre.config;
import javax.sql.DataSource;
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/postgre/web/UserController.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/postgre/web/UserController.java
similarity index 88%
rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/postgre/web/UserController.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/postgre/web/UserController.java
index c8fd3812b1..da85a46562 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/jdbcauthentication/postgre/web/UserController.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/jdbcauthentication/postgre/web/UserController.java
@@ -1,4 +1,4 @@
-package org.baeldung.jdbcauthentication.postgre.web;
+package com.baeldung.jdbcauthentication.postgre.web;
import java.security.Principal;
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleauthproviders/CustomAuthenticationProvider.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleauthproviders/CustomAuthenticationProvider.java
similarity index 96%
rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleauthproviders/CustomAuthenticationProvider.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleauthproviders/CustomAuthenticationProvider.java
index 1a89c362cd..97a8d8ac2a 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleauthproviders/CustomAuthenticationProvider.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleauthproviders/CustomAuthenticationProvider.java
@@ -1,4 +1,4 @@
-package org.baeldung.multipleauthproviders;
+package com.baeldung.multipleauthproviders;
import java.util.Collections;
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthController.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleauthproviders/MultipleAuthController.java
similarity index 85%
rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthController.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleauthproviders/MultipleAuthController.java
index b63169bb00..0079c84c6c 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthController.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleauthproviders/MultipleAuthController.java
@@ -1,4 +1,4 @@
-package org.baeldung.multipleauthproviders;
+package com.baeldung.multipleauthproviders;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthProvidersApplication.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleauthproviders/MultipleAuthProvidersApplication.java
similarity index 92%
rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthProvidersApplication.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleauthproviders/MultipleAuthProvidersApplication.java
index 1f641298c3..e1a437e9a9 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthProvidersApplication.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleauthproviders/MultipleAuthProvidersApplication.java
@@ -1,4 +1,4 @@
-package org.baeldung.multipleauthproviders;
+package com.baeldung.multipleauthproviders;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthProvidersSecurityConfig.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleauthproviders/MultipleAuthProvidersSecurityConfig.java
similarity index 97%
rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthProvidersSecurityConfig.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleauthproviders/MultipleAuthProvidersSecurityConfig.java
index 3819e981a2..aa2ffc9046 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthProvidersSecurityConfig.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleauthproviders/MultipleAuthProvidersSecurityConfig.java
@@ -1,4 +1,4 @@
-package org.baeldung.multipleauthproviders;
+package com.baeldung.multipleauthproviders;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleentrypoints/MultipleEntryPointsApplication.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleentrypoints/MultipleEntryPointsApplication.java
similarity index 92%
rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleentrypoints/MultipleEntryPointsApplication.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleentrypoints/MultipleEntryPointsApplication.java
index 847dab073e..4ed36f770f 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleentrypoints/MultipleEntryPointsApplication.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleentrypoints/MultipleEntryPointsApplication.java
@@ -1,4 +1,4 @@
-package org.baeldung.multipleentrypoints;
+package com.baeldung.multipleentrypoints;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleentrypoints/MultipleEntryPointsSecurityConfig.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleentrypoints/MultipleEntryPointsSecurityConfig.java
similarity index 99%
rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleentrypoints/MultipleEntryPointsSecurityConfig.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleentrypoints/MultipleEntryPointsSecurityConfig.java
index dc89c83cde..b6155fc100 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleentrypoints/MultipleEntryPointsSecurityConfig.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleentrypoints/MultipleEntryPointsSecurityConfig.java
@@ -1,4 +1,4 @@
-package org.baeldung.multipleentrypoints;
+package com.baeldung.multipleentrypoints;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleentrypoints/PagesController.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleentrypoints/PagesController.java
similarity index 96%
rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleentrypoints/PagesController.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleentrypoints/PagesController.java
index b3462d4061..ba5028aea7 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multipleentrypoints/PagesController.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multipleentrypoints/PagesController.java
@@ -1,4 +1,4 @@
-package org.baeldung.multipleentrypoints;
+package com.baeldung.multipleentrypoints;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multiplelogin/MultipleLoginApplication.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multiplelogin/MultipleLoginApplication.java
similarity index 85%
rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multiplelogin/MultipleLoginApplication.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multiplelogin/MultipleLoginApplication.java
index 90bb5e4260..abba2ba339 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multiplelogin/MultipleLoginApplication.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multiplelogin/MultipleLoginApplication.java
@@ -1,4 +1,4 @@
-package org.baeldung.multiplelogin;
+package com.baeldung.multiplelogin;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -7,7 +7,6 @@ import org.springframework.context.annotation.PropertySource;
@SpringBootApplication
@PropertySource("classpath:application-defaults.properties")
-@ComponentScan("org.baeldung.multiplelogin")
public class MultipleLoginApplication {
public static void main(String[] args) {
SpringApplication.run(MultipleLoginApplication.class, args);
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multiplelogin/MultipleLoginMvcConfig.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multiplelogin/MultipleLoginMvcConfig.java
similarity index 89%
rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multiplelogin/MultipleLoginMvcConfig.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multiplelogin/MultipleLoginMvcConfig.java
index 204b186411..86b3314c7c 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multiplelogin/MultipleLoginMvcConfig.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multiplelogin/MultipleLoginMvcConfig.java
@@ -1,4 +1,4 @@
-package org.baeldung.multiplelogin;
+package com.baeldung.multiplelogin;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -6,14 +6,12 @@ import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import org.springframework.web.servlet.view.JstlView;
import org.springframework.context.annotation.ComponentScan;
@EnableWebMvc
@Configuration
-@ComponentScan("org.baeldung.controller")
public class MultipleLoginMvcConfig implements WebMvcConfigurer {
public MultipleLoginMvcConfig() {
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multiplelogin/MultipleLoginSecurityConfig.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multiplelogin/MultipleLoginSecurityConfig.java
similarity index 99%
rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multiplelogin/MultipleLoginSecurityConfig.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multiplelogin/MultipleLoginSecurityConfig.java
index 9962bf41a9..3d12951f39 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multiplelogin/MultipleLoginSecurityConfig.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multiplelogin/MultipleLoginSecurityConfig.java
@@ -1,4 +1,4 @@
-package org.baeldung.multiplelogin;
+package com.baeldung.multiplelogin;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multiplelogin/UsersController.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multiplelogin/UsersController.java
similarity index 95%
rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multiplelogin/UsersController.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multiplelogin/UsersController.java
index 61d7da127c..03be0fd6b2 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/multiplelogin/UsersController.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/multiplelogin/UsersController.java
@@ -1,4 +1,4 @@
-package org.baeldung.multiplelogin;
+package com.baeldung.multiplelogin;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/ssl/HttpsEnabledApplication.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/ssl/HttpsEnabledApplication.java
similarity index 95%
rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/ssl/HttpsEnabledApplication.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/ssl/HttpsEnabledApplication.java
index 17c249067c..f6a550ae54 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/ssl/HttpsEnabledApplication.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/ssl/HttpsEnabledApplication.java
@@ -1,4 +1,4 @@
-package org.baeldung.ssl;
+package com.baeldung.ssl;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/ssl/SecurityConfig.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/ssl/SecurityConfig.java
similarity index 95%
rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/ssl/SecurityConfig.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/ssl/SecurityConfig.java
index 92f92d8fc7..4bddf0592a 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/ssl/SecurityConfig.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/ssl/SecurityConfig.java
@@ -1,4 +1,4 @@
-package org.baeldung.ssl;
+package com.baeldung.ssl;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/ssl/WelcomeController.java b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/ssl/WelcomeController.java
similarity index 74%
rename from spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/ssl/WelcomeController.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/ssl/WelcomeController.java
index 72ad8abb85..2bd8c8cfde 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/main/java/org/baeldung/ssl/WelcomeController.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/main/java/com/baeldung/ssl/WelcomeController.java
@@ -1,8 +1,7 @@
-package org.baeldung.ssl;
+package com.baeldung.ssl;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class WelcomeController {
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/jdbcauthentication/h2/SpringContextTest.java b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/jdbcauthentication/h2/SpringContextTest.java
similarity index 76%
rename from spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/jdbcauthentication/h2/SpringContextTest.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/jdbcauthentication/h2/SpringContextTest.java
index 659dad9155..5bd2a0ce27 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/jdbcauthentication/h2/SpringContextTest.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/jdbcauthentication/h2/SpringContextTest.java
@@ -1,6 +1,5 @@
-package org.baeldung.jdbcauthentication.h2;
+package com.baeldung.jdbcauthentication.h2;
-import org.baeldung.jdbcauthentication.h2.H2JdbcAuthenticationApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/jdbcauthentication/h2/web/UserControllerLiveTest.java b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/jdbcauthentication/h2/web/UserControllerLiveTest.java
similarity index 95%
rename from spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/jdbcauthentication/h2/web/UserControllerLiveTest.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/jdbcauthentication/h2/web/UserControllerLiveTest.java
index 638e9d7919..12b5ca5867 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/jdbcauthentication/h2/web/UserControllerLiveTest.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/jdbcauthentication/h2/web/UserControllerLiveTest.java
@@ -1,4 +1,4 @@
-package org.baeldung.jdbcauthentication.h2.web;
+package com.baeldung.jdbcauthentication.h2.web;
import static io.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.is;
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/jdbcauthentication/mysql/web/UserControllerLiveTest.java b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/jdbcauthentication/mysql/web/UserControllerLiveTest.java
similarity index 95%
rename from spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/jdbcauthentication/mysql/web/UserControllerLiveTest.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/jdbcauthentication/mysql/web/UserControllerLiveTest.java
index 261063cbb6..79bc84ea69 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/jdbcauthentication/mysql/web/UserControllerLiveTest.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/jdbcauthentication/mysql/web/UserControllerLiveTest.java
@@ -1,4 +1,4 @@
-package org.baeldung.jdbcauthentication.mysql.web;
+package com.baeldung.jdbcauthentication.mysql.web;
import static io.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.is;
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/jdbcauthentication/postgre/web/UserControllerLiveTest.java b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/jdbcauthentication/postgre/web/UserControllerLiveTest.java
similarity index 95%
rename from spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/jdbcauthentication/postgre/web/UserControllerLiveTest.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/jdbcauthentication/postgre/web/UserControllerLiveTest.java
index 82bf6df8db..e6426a843e 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/jdbcauthentication/postgre/web/UserControllerLiveTest.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/jdbcauthentication/postgre/web/UserControllerLiveTest.java
@@ -1,4 +1,4 @@
-package org.baeldung.jdbcauthentication.postgre.web;
+package com.baeldung.jdbcauthentication.postgre.web;
import static io.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.is;
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/web/HttpsApplicationIntegrationTest.java b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/web/HttpsApplicationIntegrationTest.java
similarity index 96%
rename from spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/web/HttpsApplicationIntegrationTest.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/web/HttpsApplicationIntegrationTest.java
index fe7883ec94..63d47e6a46 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/web/HttpsApplicationIntegrationTest.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/web/HttpsApplicationIntegrationTest.java
@@ -1,10 +1,10 @@
-package org.baeldung.web;
+package com.baeldung.web;
import org.apache.http.client.HttpClient;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.ssl.SSLContextBuilder;
-import org.baeldung.ssl.HttpsEnabledApplication;
+import com.baeldung.ssl.HttpsEnabledApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Value;
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/web/MultipleAuthProvidersApplicationIntegrationTest.java b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/web/MultipleAuthProvidersApplicationIntegrationTest.java
similarity index 96%
rename from spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/web/MultipleAuthProvidersApplicationIntegrationTest.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/web/MultipleAuthProvidersApplicationIntegrationTest.java
index 9ef09f1f67..c5ef469fe8 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/web/MultipleAuthProvidersApplicationIntegrationTest.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/web/MultipleAuthProvidersApplicationIntegrationTest.java
@@ -1,10 +1,10 @@
-package org.baeldung.web;
+package com.baeldung.web;
import static org.assertj.core.api.Assertions.assertThat;
import java.util.Collections;
-import org.baeldung.multipleauthproviders.MultipleAuthProvidersApplication;
+import com.baeldung.multipleauthproviders.MultipleAuthProvidersApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/web/MultipleEntryPointsIntegrationTest.java b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/web/MultipleEntryPointsIntegrationTest.java
similarity index 96%
rename from spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/web/MultipleEntryPointsIntegrationTest.java
rename to spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/web/MultipleEntryPointsIntegrationTest.java
index 422be2ac88..352b4af244 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/src/test/java/org/baeldung/web/MultipleEntryPointsIntegrationTest.java
+++ b/spring-security-modules/spring-security-mvc-boot-2/src/test/java/com/baeldung/web/MultipleEntryPointsIntegrationTest.java
@@ -1,4 +1,4 @@
-package org.baeldung.web;
+package com.baeldung.web;
import org.junit.Before;
import org.junit.Test;
@@ -15,7 +15,7 @@ import org.springframework.web.context.WebApplicationContext;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
-import org.baeldung.multipleentrypoints.MultipleEntryPointsApplication;
+import com.baeldung.multipleentrypoints.MultipleEntryPointsApplication;
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.*;
diff --git a/spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/security/MySimpleUrlAuthenticationSuccessHandler.java b/spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/security/MySimpleUrlAuthenticationSuccessHandler.java
index 19f49ea59d..73c186cae3 100644
--- a/spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/security/MySimpleUrlAuthenticationSuccessHandler.java
+++ b/spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/security/MySimpleUrlAuthenticationSuccessHandler.java
@@ -2,6 +2,8 @@ package org.baeldung.security;
import java.io.IOException;
import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -47,26 +49,21 @@ public class MySimpleUrlAuthenticationSuccessHandler implements AuthenticationSu
}
protected String determineTargetUrl(final Authentication authentication) {
- boolean isUser = false;
- boolean isAdmin = false;
+
+ Map roleTargetUrlMap = new HashMap<>();
+ roleTargetUrlMap.put("ROLE_USER", "/homepage.html");
+ roleTargetUrlMap.put("ROLE_ADMIN", "/console.html");
+
final Collection extends GrantedAuthority> authorities = authentication.getAuthorities();
for (final GrantedAuthority grantedAuthority : authorities) {
- if (grantedAuthority.getAuthority().equals("ROLE_USER")) {
- isUser = true;
- break;
- } else if (grantedAuthority.getAuthority().equals("ROLE_ADMIN")) {
- isAdmin = true;
- break;
+
+ String authorityName = grantedAuthority.getAuthority();
+ if(roleTargetUrlMap.containsKey(authorityName)) {
+ return roleTargetUrlMap.get(authorityName);
}
}
- if (isUser) {
- return "/homepage.html";
- } else if (isAdmin) {
- return "/console.html";
- } else {
- throw new IllegalStateException();
- }
+ throw new IllegalStateException();
}
/**
@@ -83,12 +80,4 @@ public class MySimpleUrlAuthenticationSuccessHandler implements AuthenticationSu
session.removeAttribute(WebAttributes.AUTHENTICATION_EXCEPTION);
}
- public void setRedirectStrategy(final RedirectStrategy redirectStrategy) {
- this.redirectStrategy = redirectStrategy;
- }
-
- protected RedirectStrategy getRedirectStrategy() {
- return redirectStrategy;
- }
-
}
diff --git a/spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/spring/MyUserDetailsService.java b/spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/spring/MyUserDetailsService.java
new file mode 100644
index 0000000000..43eb39e927
--- /dev/null
+++ b/spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/spring/MyUserDetailsService.java
@@ -0,0 +1,32 @@
+package org.baeldung.spring;
+
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.authority.SimpleGrantedAuthority;
+import org.springframework.security.core.userdetails.User;
+import org.springframework.security.core.userdetails.UserDetails;
+import org.springframework.security.core.userdetails.UserDetailsService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.PostConstruct;
+import java.util.*;
+
+@Service
+public class MyUserDetailsService implements UserDetailsService {
+
+ private Map roles = new HashMap<>();
+
+ @PostConstruct
+ public void init() {
+ roles.put("admin", new User("admin", "{noop}admin1", getAuthority("ROLE_ADMIN")));
+ roles.put("user", new User("user", "{noop}user1", getAuthority("ROLE_USER")));
+ }
+
+ @Override
+ public UserDetails loadUserByUsername(String username) {
+ return roles.get(username);
+ }
+
+ private List getAuthority(String role) {
+ return Collections.singletonList(new SimpleGrantedAuthority(role));
+ }
+}
\ No newline at end of file
diff --git a/spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/spring/SecSecurityConfig.java b/spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/spring/SecSecurityConfig.java
index ebe23950a7..fe00e6943b 100644
--- a/spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/spring/SecSecurityConfig.java
+++ b/spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/spring/SecSecurityConfig.java
@@ -1,11 +1,9 @@
package org.baeldung.spring;
import org.baeldung.security.MySimpleUrlAuthenticationSuccessHandler;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
-import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@@ -15,7 +13,7 @@ import org.springframework.security.web.authentication.AuthenticationSuccessHand
//@ImportResource({ "classpath:webSecurityConfig.xml" })
@EnableWebSecurity
public class SecSecurityConfig extends WebSecurityConfigurerAdapter {
-
+
public SecSecurityConfig() {
super();
}
@@ -26,43 +24,34 @@ public class SecSecurityConfig extends WebSecurityConfigurerAdapter {
return super.authenticationManagerBean();
}
- @Autowired
- public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
- // @formatter:off
- auth.inMemoryAuthentication()
- .withUser("user1").password("{noop}user1Pass").roles("USER")
- .and()
- .withUser("admin1").password("{noop}admin1Pass").roles("ADMIN");
- // @formatter:on
- }
-
@Override
protected void configure(final HttpSecurity http) throws Exception {
// @formatter:off
- http.authorizeRequests()
- .antMatchers("/anonymous*").anonymous()
- .antMatchers("/login*").permitAll()
- .anyRequest().authenticated()
-
+ http
+ .authorizeRequests()
+ .antMatchers("/anonymous*").anonymous()
+ .antMatchers("/login*").permitAll()
+ .anyRequest().authenticated()
+
.and()
.formLogin()
- .loginPage("/login.html")
- .loginProcessingUrl("/login")
- .successHandler(myAuthenticationSuccessHandler())
- .failureUrl("/login.html?error=true")
-
+ .loginPage("/login.html")
+ .loginProcessingUrl("/login")
+ .successHandler(myAuthenticationSuccessHandler())
+ .failureUrl("/login.html?error=true")
+
.and()
- .logout().deleteCookies("JSESSIONID")
-
+ .logout().deleteCookies("JSESSIONID")
+
.and()
- .rememberMe().key("uniqueAndSecret").tokenValiditySeconds(86400)
-
+ .rememberMe().key("uniqueAndSecret").tokenValiditySeconds(86400)
+
.and()
- .csrf().disable()
+ .csrf().disable()
;
// @formatter:on
}
-
+
@Bean
public AuthenticationSuccessHandler myAuthenticationSuccessHandler(){
return new MySimpleUrlAuthenticationSuccessHandler();
diff --git a/spring-session/pom.xml b/spring-session/pom.xml
index 579d2327e8..42a414afdc 100644
--- a/spring-session/pom.xml
+++ b/spring-session/pom.xml
@@ -2,7 +2,7 @@
4.0.0
- org.baeldung
+ com.baeldungspring-session1.0.0-SNAPSHOTspring-session
diff --git a/spring-session/spring-session-jdbc/src/test/java/org/baeldung/SpringContextTest.java b/spring-session/spring-session-jdbc/src/test/java/com/baeldung/SpringContextTest.java
similarity index 95%
rename from spring-session/spring-session-jdbc/src/test/java/org/baeldung/SpringContextTest.java
rename to spring-session/spring-session-jdbc/src/test/java/com/baeldung/SpringContextTest.java
index b69855ba38..8f6c2f2889 100644
--- a/spring-session/spring-session-jdbc/src/test/java/org/baeldung/SpringContextTest.java
+++ b/spring-session/spring-session-jdbc/src/test/java/com/baeldung/SpringContextTest.java
@@ -1,4 +1,4 @@
-package org.baeldung;
+package com.baeldung;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/spring-session/spring-session-mongodb/src/test/java/org/baeldung/SpringContextTest.java b/spring-session/spring-session-mongodb/src/test/java/com/baeldung/SpringContextTest.java
similarity index 96%
rename from spring-session/spring-session-mongodb/src/test/java/org/baeldung/SpringContextTest.java
rename to spring-session/spring-session-mongodb/src/test/java/com/baeldung/SpringContextTest.java
index cc935b8cfb..babcdb2ccf 100644
--- a/spring-session/spring-session-mongodb/src/test/java/org/baeldung/SpringContextTest.java
+++ b/spring-session/spring-session-mongodb/src/test/java/com/baeldung/SpringContextTest.java
@@ -1,4 +1,4 @@
-package org.baeldung;
+package com.baeldung;
import com.baeldung.springsessionmongodb.SpringSessionMongoDBApplication;
import org.junit.Test;
diff --git a/spring-session/spring-session-redis/src/test/java/org/baeldung/SpringContextLiveTest.java b/spring-session/spring-session-redis/src/test/java/com/baeldung/SpringContextLiveTest.java
similarity index 96%
rename from spring-session/spring-session-redis/src/test/java/org/baeldung/SpringContextLiveTest.java
rename to spring-session/spring-session-redis/src/test/java/com/baeldung/SpringContextLiveTest.java
index 3a4f14e9e6..2e33255e01 100644
--- a/spring-session/spring-session-redis/src/test/java/org/baeldung/SpringContextLiveTest.java
+++ b/spring-session/spring-session-redis/src/test/java/com/baeldung/SpringContextLiveTest.java
@@ -1,4 +1,4 @@
-package org.baeldung;
+package com.baeldung;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/spring-sleuth/src/test/java/org/baeldung/SpringContextTest.java b/spring-sleuth/src/test/java/com/baeldung/SpringContextTest.java
similarity index 95%
rename from spring-sleuth/src/test/java/org/baeldung/SpringContextTest.java
rename to spring-sleuth/src/test/java/com/baeldung/SpringContextTest.java
index ff22398ca4..8dc2455e63 100644
--- a/spring-sleuth/src/test/java/org/baeldung/SpringContextTest.java
+++ b/spring-sleuth/src/test/java/com/baeldung/SpringContextTest.java
@@ -1,4 +1,4 @@
-package org.baeldung;
+package com.baeldung;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/spring-social-login/src/main/java/org/baeldung/config/Application.java b/spring-social-login/src/main/java/com/baeldung/config/Application.java
similarity index 80%
rename from spring-social-login/src/main/java/org/baeldung/config/Application.java
rename to spring-social-login/src/main/java/com/baeldung/config/Application.java
index cf6251a51e..5d083d2d47 100644
--- a/spring-social-login/src/main/java/org/baeldung/config/Application.java
+++ b/spring-social-login/src/main/java/com/baeldung/config/Application.java
@@ -1,4 +1,4 @@
-package org.baeldung.config;
+package com.baeldung.config;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -7,8 +7,8 @@ import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
@SpringBootApplication
-@EnableJpaRepositories("org.baeldung.persistence.dao")
-@EntityScan("org.baeldung.persistence.model")
+@EnableJpaRepositories("com.baeldung.persistence.dao")
+@EntityScan("com.baeldung.persistence.model")
public class Application extends SpringBootServletInitializer {
public static void main(String[] args) {
diff --git a/spring-social-login/src/main/java/org/baeldung/config/SecurityConfig.java b/spring-social-login/src/main/java/com/baeldung/config/SecurityConfig.java
similarity index 92%
rename from spring-social-login/src/main/java/org/baeldung/config/SecurityConfig.java
rename to spring-social-login/src/main/java/com/baeldung/config/SecurityConfig.java
index 8e439653a9..3d3081fef9 100644
--- a/spring-social-login/src/main/java/org/baeldung/config/SecurityConfig.java
+++ b/spring-social-login/src/main/java/com/baeldung/config/SecurityConfig.java
@@ -1,7 +1,7 @@
-package org.baeldung.config;
+package com.baeldung.config;
-import org.baeldung.security.FacebookSignInAdapter;
-import org.baeldung.security.FacebookConnectionSignup;
+import com.baeldung.security.FacebookSignInAdapter;
+import com.baeldung.security.FacebookConnectionSignup;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
@@ -18,7 +18,7 @@ import org.springframework.social.connect.web.ProviderSignInController;
@Configuration
@EnableWebSecurity
-@ComponentScan(basePackages = { "org.baeldung.security" })
+@ComponentScan(basePackages = { "com.baeldung.security" })
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
diff --git a/spring-social-login/src/main/java/org/baeldung/config/WebConfig.java b/spring-social-login/src/main/java/com/baeldung/config/WebConfig.java
similarity index 98%
rename from spring-social-login/src/main/java/org/baeldung/config/WebConfig.java
rename to spring-social-login/src/main/java/com/baeldung/config/WebConfig.java
index 8cfcd6cb41..d178cc28a6 100644
--- a/spring-social-login/src/main/java/org/baeldung/config/WebConfig.java
+++ b/spring-social-login/src/main/java/com/baeldung/config/WebConfig.java
@@ -1,4 +1,4 @@
-package org.baeldung.config;
+package com.baeldung.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
diff --git a/spring-social-login/src/main/java/org/baeldung/persistence/dao/UserRepository.java b/spring-social-login/src/main/java/com/baeldung/persistence/dao/UserRepository.java
similarity index 69%
rename from spring-social-login/src/main/java/org/baeldung/persistence/dao/UserRepository.java
rename to spring-social-login/src/main/java/com/baeldung/persistence/dao/UserRepository.java
index 679dd6c363..aeb443dd06 100644
--- a/spring-social-login/src/main/java/org/baeldung/persistence/dao/UserRepository.java
+++ b/spring-social-login/src/main/java/com/baeldung/persistence/dao/UserRepository.java
@@ -1,6 +1,6 @@
-package org.baeldung.persistence.dao;
+package com.baeldung.persistence.dao;
-import org.baeldung.persistence.model.User;
+import com.baeldung.persistence.model.User;
import org.springframework.data.jpa.repository.JpaRepository;
public interface UserRepository extends JpaRepository {
diff --git a/spring-social-login/src/main/java/org/baeldung/persistence/model/User.java b/spring-social-login/src/main/java/com/baeldung/persistence/model/User.java
similarity index 96%
rename from spring-social-login/src/main/java/org/baeldung/persistence/model/User.java
rename to spring-social-login/src/main/java/com/baeldung/persistence/model/User.java
index a4cffc27d0..ce1774ca2c 100644
--- a/spring-social-login/src/main/java/org/baeldung/persistence/model/User.java
+++ b/spring-social-login/src/main/java/com/baeldung/persistence/model/User.java
@@ -1,4 +1,4 @@
-package org.baeldung.persistence.model;
+package com.baeldung.persistence.model;
import javax.persistence.Column;
import javax.persistence.Entity;
diff --git a/spring-social-login/src/main/java/org/baeldung/security/FacebookConnectionSignup.java b/spring-social-login/src/main/java/com/baeldung/security/FacebookConnectionSignup.java
similarity index 85%
rename from spring-social-login/src/main/java/org/baeldung/security/FacebookConnectionSignup.java
rename to spring-social-login/src/main/java/com/baeldung/security/FacebookConnectionSignup.java
index 6a9e30d7d8..e0a9fdc2e7 100644
--- a/spring-social-login/src/main/java/org/baeldung/security/FacebookConnectionSignup.java
+++ b/spring-social-login/src/main/java/com/baeldung/security/FacebookConnectionSignup.java
@@ -1,9 +1,9 @@
-package org.baeldung.security;
+package com.baeldung.security;
import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
-import org.baeldung.persistence.dao.UserRepository;
-import org.baeldung.persistence.model.User;
+import com.baeldung.persistence.dao.UserRepository;
+import com.baeldung.persistence.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.social.connect.Connection;
import org.springframework.social.connect.ConnectionSignUp;
diff --git a/spring-social-login/src/main/java/org/baeldung/security/FacebookSignInAdapter.java b/spring-social-login/src/main/java/com/baeldung/security/FacebookSignInAdapter.java
similarity index 96%
rename from spring-social-login/src/main/java/org/baeldung/security/FacebookSignInAdapter.java
rename to spring-social-login/src/main/java/com/baeldung/security/FacebookSignInAdapter.java
index b861609a01..3050941ffa 100644
--- a/spring-social-login/src/main/java/org/baeldung/security/FacebookSignInAdapter.java
+++ b/spring-social-login/src/main/java/com/baeldung/security/FacebookSignInAdapter.java
@@ -1,4 +1,4 @@
-package org.baeldung.security;
+package com.baeldung.security;
import java.util.Arrays;
diff --git a/spring-social-login/src/main/java/org/baeldung/security/MyUserDetailsService.java b/spring-social-login/src/main/java/com/baeldung/security/MyUserDetailsService.java
similarity index 89%
rename from spring-social-login/src/main/java/org/baeldung/security/MyUserDetailsService.java
rename to spring-social-login/src/main/java/com/baeldung/security/MyUserDetailsService.java
index 5d0d5d793a..126f02e74a 100644
--- a/spring-social-login/src/main/java/org/baeldung/security/MyUserDetailsService.java
+++ b/spring-social-login/src/main/java/com/baeldung/security/MyUserDetailsService.java
@@ -1,9 +1,9 @@
-package org.baeldung.security;
+package com.baeldung.security;
import java.util.Arrays;
-import org.baeldung.persistence.dao.UserRepository;
-import org.baeldung.persistence.model.User;
+import com.baeldung.persistence.dao.UserRepository;
+import com.baeldung.persistence.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
diff --git a/spring-social-login/src/test/java/org/baeldung/SpringContextTest.java b/spring-social-login/src/test/java/com/baeldung/SpringContextTest.java
similarity index 88%
rename from spring-social-login/src/test/java/org/baeldung/SpringContextTest.java
rename to spring-social-login/src/test/java/com/baeldung/SpringContextTest.java
index cfd8759c52..1d9711b5a4 100644
--- a/spring-social-login/src/test/java/org/baeldung/SpringContextTest.java
+++ b/spring-social-login/src/test/java/com/baeldung/SpringContextTest.java
@@ -1,6 +1,6 @@
-package org.baeldung;
+package com.baeldung;
-import org.baeldung.config.Application;
+import com.baeldung.config.Application;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
diff --git a/spring-spel/src/test/java/org/baeldung/SpringContextTest.java b/spring-spel/src/test/java/com/baeldung/SpringContextTest.java
similarity index 95%
rename from spring-spel/src/test/java/org/baeldung/SpringContextTest.java
rename to spring-spel/src/test/java/com/baeldung/SpringContextTest.java
index e25c1bf8e4..338b8b1e68 100644
--- a/spring-spel/src/test/java/org/baeldung/SpringContextTest.java
+++ b/spring-spel/src/test/java/com/baeldung/SpringContextTest.java
@@ -1,4 +1,4 @@
-package org.baeldung;
+package com.baeldung;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/spring-state-machine/src/test/java/org/baeldung/SpringContextTest.java b/spring-state-machine/src/test/java/com/baeldung/SpringContextTest.java
similarity index 97%
rename from spring-state-machine/src/test/java/org/baeldung/SpringContextTest.java
rename to spring-state-machine/src/test/java/com/baeldung/SpringContextTest.java
index 1e847c0d65..407cd8ebb0 100644
--- a/spring-state-machine/src/test/java/org/baeldung/SpringContextTest.java
+++ b/spring-state-machine/src/test/java/com/baeldung/SpringContextTest.java
@@ -1,4 +1,4 @@
-package org.baeldung;
+package com.baeldung;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/spring-static-resources/src/main/java/org/baeldung/security/MySimpleUrlAuthenticationSuccessHandler.java b/spring-static-resources/src/main/java/com/baeldung/security/MySimpleUrlAuthenticationSuccessHandler.java
similarity index 98%
rename from spring-static-resources/src/main/java/org/baeldung/security/MySimpleUrlAuthenticationSuccessHandler.java
rename to spring-static-resources/src/main/java/com/baeldung/security/MySimpleUrlAuthenticationSuccessHandler.java
index 316642ab6f..d6c54f8099 100644
--- a/spring-static-resources/src/main/java/org/baeldung/security/MySimpleUrlAuthenticationSuccessHandler.java
+++ b/spring-static-resources/src/main/java/com/baeldung/security/MySimpleUrlAuthenticationSuccessHandler.java
@@ -1,4 +1,4 @@
-package org.baeldung.security;
+package com.baeldung.security;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
diff --git a/spring-static-resources/src/main/java/org/baeldung/spring/AppConfig.java b/spring-static-resources/src/main/java/com/baeldung/spring/AppConfig.java
similarity index 83%
rename from spring-static-resources/src/main/java/org/baeldung/spring/AppConfig.java
rename to spring-static-resources/src/main/java/com/baeldung/spring/AppConfig.java
index c379d20047..97e7cf96fc 100644
--- a/spring-static-resources/src/main/java/org/baeldung/spring/AppConfig.java
+++ b/spring-static-resources/src/main/java/com/baeldung/spring/AppConfig.java
@@ -1,4 +1,4 @@
-package org.baeldung.spring;
+package com.baeldung.spring;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
@@ -8,7 +8,7 @@ import org.springframework.context.annotation.PropertySource;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
@Configuration
-@ComponentScan(basePackages = { "org.baeldung.persistence.service", "org.baeldung.persistence.dao" })
+@ComponentScan(basePackages = { "com.baeldung.persistence.service", "com.baeldung.persistence.dao" })
@Import({ MvcConfig.class, SecSecurityConfig.class })
@PropertySource("classpath:application.properties")
public class AppConfig {
diff --git a/spring-static-resources/src/main/java/org/baeldung/spring/MvcConfig.java b/spring-static-resources/src/main/java/com/baeldung/spring/MvcConfig.java
similarity index 96%
rename from spring-static-resources/src/main/java/org/baeldung/spring/MvcConfig.java
rename to spring-static-resources/src/main/java/com/baeldung/spring/MvcConfig.java
index 7bd03617be..f23fe14fb8 100644
--- a/spring-static-resources/src/main/java/org/baeldung/spring/MvcConfig.java
+++ b/spring-static-resources/src/main/java/com/baeldung/spring/MvcConfig.java
@@ -1,4 +1,4 @@
-package org.baeldung.spring;
+package com.baeldung.spring;
import java.util.Locale;
@@ -25,7 +25,7 @@ import org.springframework.web.servlet.view.InternalResourceViewResolver;
import org.springframework.web.servlet.view.JstlView;
@Configuration
-@ComponentScan(basePackages = { "org.baeldung.web.controller", "org.baeldung.persistence.service", "org.baeldung.persistence.dao" })
+@ComponentScan(basePackages = { "com.baeldung.web.controller", "com.baeldung.persistence.service", "com.baeldung.persistence.dao" })
@EnableWebMvc
public class MvcConfig implements WebMvcConfigurer {
@Autowired
diff --git a/spring-static-resources/src/main/java/org/baeldung/spring/SecSecurityConfig.java b/spring-static-resources/src/main/java/com/baeldung/spring/SecSecurityConfig.java
similarity index 90%
rename from spring-static-resources/src/main/java/org/baeldung/spring/SecSecurityConfig.java
rename to spring-static-resources/src/main/java/com/baeldung/spring/SecSecurityConfig.java
index 4da114c78b..3e630b8729 100644
--- a/spring-static-resources/src/main/java/org/baeldung/spring/SecSecurityConfig.java
+++ b/spring-static-resources/src/main/java/com/baeldung/spring/SecSecurityConfig.java
@@ -1,4 +1,4 @@
-package org.baeldung.spring;
+package com.baeldung.spring;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
diff --git a/spring-static-resources/src/main/java/org/baeldung/web/controller/HomeController.java b/spring-static-resources/src/main/java/com/baeldung/web/controller/HomeController.java
similarity index 96%
rename from spring-static-resources/src/main/java/org/baeldung/web/controller/HomeController.java
rename to spring-static-resources/src/main/java/com/baeldung/web/controller/HomeController.java
index 44645a1471..dd58c7c2b6 100644
--- a/spring-static-resources/src/main/java/org/baeldung/web/controller/HomeController.java
+++ b/spring-static-resources/src/main/java/com/baeldung/web/controller/HomeController.java
@@ -1,4 +1,4 @@
-package org.baeldung.web.controller;
+package com.baeldung.web.controller;
import java.io.IOException;
import java.text.DateFormat;
diff --git a/spring-static-resources/src/main/resources/webSecurityConfig.xml b/spring-static-resources/src/main/resources/webSecurityConfig.xml
index ea64ad5aea..2278cb6138 100644
--- a/spring-static-resources/src/main/resources/webSecurityConfig.xml
+++ b/spring-static-resources/src/main/resources/webSecurityConfig.xml
@@ -23,7 +23,7 @@
-
+
diff --git a/spring-static-resources/src/test/java/com/baeldung/SpringContextTest.java b/spring-static-resources/src/test/java/com/baeldung/SpringContextTest.java
index 0dcbba3221..153b290de7 100644
--- a/spring-static-resources/src/test/java/com/baeldung/SpringContextTest.java
+++ b/spring-static-resources/src/test/java/com/baeldung/SpringContextTest.java
@@ -1,6 +1,6 @@
package com.baeldung;
-import org.baeldung.spring.SecSecurityConfig;
+import com.baeldung.spring.SecSecurityConfig;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
diff --git a/spring-swagger-codegen/pom.xml b/spring-swagger-codegen/pom.xml
index dee9415679..39d8902956 100644
--- a/spring-swagger-codegen/pom.xml
+++ b/spring-swagger-codegen/pom.xml
@@ -15,6 +15,7 @@
spring-swagger-codegen-api-client
+ spring-openapi-generator-api-clientspring-swagger-codegen-app
diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/.openapi-generator-ignore b/spring-swagger-codegen/spring-openapi-generator-api-client/.openapi-generator-ignore
new file mode 100644
index 0000000000..7484ee590a
--- /dev/null
+++ b/spring-swagger-codegen/spring-openapi-generator-api-client/.openapi-generator-ignore
@@ -0,0 +1,23 @@
+# OpenAPI Generator Ignore
+# Generated by openapi-generator https://github.com/openapitools/openapi-generator
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/.openapi-generator/VERSION b/spring-swagger-codegen/spring-openapi-generator-api-client/.openapi-generator/VERSION
new file mode 100644
index 0000000000..ec87108d82
--- /dev/null
+++ b/spring-swagger-codegen/spring-openapi-generator-api-client/.openapi-generator/VERSION
@@ -0,0 +1 @@
+4.2.3
\ No newline at end of file
diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/.travis.yml b/spring-swagger-codegen/spring-openapi-generator-api-client/.travis.yml
new file mode 100644
index 0000000000..e3bdf2af1b
--- /dev/null
+++ b/spring-swagger-codegen/spring-openapi-generator-api-client/.travis.yml
@@ -0,0 +1,22 @@
+#
+# Generated by OpenAPI Generator: https://openapi-generator.tech
+#
+# Ref: https://docs.travis-ci.com/user/languages/java/
+#
+language: java
+jdk:
+ - openjdk12
+ - openjdk11
+ - openjdk10
+ - openjdk9
+ - openjdk8
+before_install:
+ # ensure gradlew has proper permission
+ - chmod a+x ./gradlew
+script:
+ # test using maven
+ #- mvn test
+ # test using gradle
+ - gradle test
+ # test using sbt
+ # - sbt test
diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/README.md b/spring-swagger-codegen/spring-openapi-generator-api-client/README.md
new file mode 100644
index 0000000000..01fd596268
--- /dev/null
+++ b/spring-swagger-codegen/spring-openapi-generator-api-client/README.md
@@ -0,0 +1,174 @@
+# spring-openapi-generator-api-client
+
+Swagger Petstore
+
+- API version: 1.0.3
+
+- Build date: 2020-03-15T06:14:01.568992-05:00[America/Chicago]
+
+This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
+
+
+*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*
+
+## Requirements
+
+Building the API client library requires:
+
+1. Java 1.8+
+2. Maven/Gradle
+
+## Installation
+
+To install the API client library to your local Maven repository, simply execute:
+
+```shell
+mvn clean install
+```
+
+To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
+
+```shell
+mvn clean deploy
+```
+
+Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information.
+
+### Maven users
+
+Add this dependency to your project's POM:
+
+```xml
+
+ com.baeldung
+ spring-openapi-generator-api-client
+ 0.0.1-SNAPSHOT
+ compile
+
+```
+
+### Gradle users
+
+Add this dependency to your project's build file:
+
+```groovy
+compile "com.baeldung:spring-openapi-generator-api-client:0.0.1-SNAPSHOT"
+```
+
+### Others
+
+At first generate the JAR by executing:
+
+```shell
+mvn clean package
+```
+
+Then manually install the following JARs:
+
+- `target/spring-openapi-generator-api-client-0.0.1-SNAPSHOT.jar`
+- `target/lib/*.jar`
+
+## Getting Started
+
+Please follow the [installation](#installation) instruction and execute the following Java code:
+
+```java
+
+import com.baeldung.petstore.client.invoker.*;
+import com.baeldung.petstore.client.invoker.auth.*;
+import com.baeldung.petstore.client.model.*;
+import com.baeldung.petstore.client.api.PetApi;
+
+public class PetApiExample {
+
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://petstore.swagger.io/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Pet body = new Pet(); // Pet | Pet object that needs to be added to the store
+ try {
+ apiInstance.addPet(body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#addPet");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+
+```
+
+## Documentation for API Endpoints
+
+All URIs are relative to *https://petstore.swagger.io/v2*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+*PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
+*PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
+*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
+*PetApi* | [**findPetsByTags**](docs/PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
+*PetApi* | [**getPetById**](docs/PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
+*PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
+*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
+*PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
+*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
+*StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
+*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID
+*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
+*UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user
+*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
+*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
+*UserApi* | [**deleteUser**](docs/UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user
+*UserApi* | [**getUserByName**](docs/UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name
+*UserApi* | [**loginUser**](docs/UserApi.md#loginUser) | **GET** /user/login | Logs user into the system
+*UserApi* | [**logoutUser**](docs/UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
+*UserApi* | [**updateUser**](docs/UserApi.md#updateUser) | **PUT** /user/{username} | Updated user
+
+
+## Documentation for Models
+
+ - [Category](docs/Category.md)
+ - [ModelApiResponse](docs/ModelApiResponse.md)
+ - [Order](docs/Order.md)
+ - [Pet](docs/Pet.md)
+ - [Tag](docs/Tag.md)
+ - [User](docs/User.md)
+
+
+## Documentation for Authorization
+
+Authentication schemes defined for the API:
+### api_key
+
+
+- **Type**: API key
+- **API key parameter name**: api_key
+- **Location**: HTTP header
+
+### petstore_auth
+
+
+- **Type**: OAuth
+- **Flow**: implicit
+- **Authorization URL**: https://petstore.swagger.io/oauth/authorize
+- **Scopes**:
+ - read:pets: read your pets
+ - write:pets: modify pets in your account
+
+
+## Recommendation
+
+It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
+
+## Author
+
+apiteam@swagger.io
+
diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/build.gradle b/spring-swagger-codegen/spring-openapi-generator-api-client/build.gradle
new file mode 100644
index 0000000000..d86deb75b8
--- /dev/null
+++ b/spring-swagger-codegen/spring-openapi-generator-api-client/build.gradle
@@ -0,0 +1,120 @@
+apply plugin: 'idea'
+apply plugin: 'eclipse'
+
+group = 'com.baeldung'
+version = '0.0.1-SNAPSHOT'
+
+buildscript {
+ repositories {
+ maven { url "https://repo1.maven.org/maven2" }
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:1.5.+'
+ classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
+ }
+}
+
+repositories {
+ jcenter()
+}
+
+
+if(hasProperty('target') && target == 'android') {
+
+ apply plugin: 'com.android.library'
+ apply plugin: 'com.github.dcendents.android-maven'
+
+ android {
+ compileSdkVersion 23
+ buildToolsVersion '23.0.2'
+ defaultConfig {
+ minSdkVersion 14
+ targetSdkVersion 22
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+
+ // Rename the aar correctly
+ libraryVariants.all { variant ->
+ variant.outputs.each { output ->
+ def outputFile = output.outputFile
+ if (outputFile != null && outputFile.name.endsWith('.aar')) {
+ def fileName = "${project.name}-${variant.baseName}-${version}.aar"
+ output.outputFile = new File(outputFile.parent, fileName)
+ }
+ }
+ }
+
+ dependencies {
+ provided 'javax.annotation:jsr250-api:1.0'
+ }
+ }
+
+ afterEvaluate {
+ android.libraryVariants.all { variant ->
+ def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
+ task.description = "Create jar artifact for ${variant.name}"
+ task.dependsOn variant.javaCompile
+ task.from variant.javaCompile.destinationDir
+ task.destinationDir = project.file("${project.buildDir}/outputs/jar")
+ task.archiveName = "${project.name}-${variant.baseName}-${version}.jar"
+ artifacts.add('archives', task);
+ }
+ }
+
+ task sourcesJar(type: Jar) {
+ from android.sourceSets.main.java.srcDirs
+ classifier = 'sources'
+ }
+
+ artifacts {
+ archives sourcesJar
+ }
+
+} else {
+
+ apply plugin: 'java'
+ apply plugin: 'maven'
+
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+
+ install {
+ repositories.mavenInstaller {
+ pom.artifactId = 'spring-openapi-generator-api-client'
+ }
+ }
+
+ task execute(type:JavaExec) {
+ main = System.getProperty('mainClass')
+ classpath = sourceSets.main.runtimeClasspath
+ }
+}
+
+ext {
+ swagger_annotations_version = "1.5.22"
+ jackson_version = "2.10.1"
+ jackson_databind_version = "2.10.1"
+ jackson_databind_nullable_version = "0.2.1"
+ spring_web_version = "4.3.9.RELEASE"
+ jodatime_version = "2.9.9"
+ junit_version = "4.13"
+ jackson_threeten_version = "2.9.10"
+}
+
+dependencies {
+ compile "io.swagger:swagger-annotations:$swagger_annotations_version"
+ compile "com.google.code.findbugs:jsr305:3.0.2"
+ compile "org.springframework:spring-web:$spring_web_version"
+ compile "com.fasterxml.jackson.core:jackson-core:$jackson_version"
+ compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
+ compile "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version"
+ compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version"
+ compile "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version"
+ compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
+ compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threeten_version"
+ testCompile "junit:junit:$junit_version"
+}
diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/build.sbt b/spring-swagger-codegen/spring-openapi-generator-api-client/build.sbt
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/docs/Category.md b/spring-swagger-codegen/spring-openapi-generator-api-client/docs/Category.md
new file mode 100644
index 0000000000..848fb61818
--- /dev/null
+++ b/spring-swagger-codegen/spring-openapi-generator-api-client/docs/Category.md
@@ -0,0 +1,13 @@
+
+
+# Category
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**name** | **String** | | [optional]
+
+
+
diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/docs/ModelApiResponse.md b/spring-swagger-codegen/spring-openapi-generator-api-client/docs/ModelApiResponse.md
new file mode 100644
index 0000000000..14fb7f1ed2
--- /dev/null
+++ b/spring-swagger-codegen/spring-openapi-generator-api-client/docs/ModelApiResponse.md
@@ -0,0 +1,14 @@
+
+
+# ModelApiResponse
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**code** | **Integer** | | [optional]
+**type** | **String** | | [optional]
+**message** | **String** | | [optional]
+
+
+
diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/docs/Order.md b/spring-swagger-codegen/spring-openapi-generator-api-client/docs/Order.md
new file mode 100644
index 0000000000..409fc4cc96
--- /dev/null
+++ b/spring-swagger-codegen/spring-openapi-generator-api-client/docs/Order.md
@@ -0,0 +1,27 @@
+
+
+# Order
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**petId** | **Long** | | [optional]
+**quantity** | **Integer** | | [optional]
+**shipDate** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
+**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional]
+**complete** | **Boolean** | | [optional]
+
+
+
+## Enum: StatusEnum
+
+Name | Value
+---- | -----
+PLACED | "placed"
+APPROVED | "approved"
+DELIVERED | "delivered"
+
+
+
diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/docs/Pet.md b/spring-swagger-codegen/spring-openapi-generator-api-client/docs/Pet.md
new file mode 100644
index 0000000000..37ac007b79
--- /dev/null
+++ b/spring-swagger-codegen/spring-openapi-generator-api-client/docs/Pet.md
@@ -0,0 +1,27 @@
+
+
+# Pet
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**category** | [**Category**](Category.md) | | [optional]
+**name** | **String** | |
+**photoUrls** | **List<String>** | |
+**tags** | [**List<Tag>**](Tag.md) | | [optional]
+**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional]
+
+
+
+## Enum: StatusEnum
+
+Name | Value
+---- | -----
+AVAILABLE | "available"
+PENDING | "pending"
+SOLD | "sold"
+
+
+
diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/docs/PetApi.md b/spring-swagger-codegen/spring-openapi-generator-api-client/docs/PetApi.md
new file mode 100644
index 0000000000..56e81ea3aa
--- /dev/null
+++ b/spring-swagger-codegen/spring-openapi-generator-api-client/docs/PetApi.md
@@ -0,0 +1,581 @@
+# PetApi
+
+All URIs are relative to *https://petstore.swagger.io/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
+[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
+[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
+[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
+[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
+[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
+[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
+[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
+
+
+
+## addPet
+
+> addPet(body)
+
+Add a new pet to the store
+
+### Example
+
+```java
+// Import classes:
+import com.baeldung.petstore.client.invoker.ApiClient;
+import com.baeldung.petstore.client.invoker.ApiException;
+import com.baeldung.petstore.client.invoker.Configuration;
+import com.baeldung.petstore.client.invoker.auth.*;
+import com.baeldung.petstore.client.invoker.models.*;
+import com.baeldung.petstore.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://petstore.swagger.io/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Pet body = new Pet(); // Pet | Pet object that needs to be added to the store
+ try {
+ apiInstance.addPet(body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#addPet");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: application/json, application/xml
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **405** | Invalid input | - |
+
+
+## deletePet
+
+> deletePet(petId, apiKey)
+
+Deletes a pet
+
+### Example
+
+```java
+// Import classes:
+import com.baeldung.petstore.client.invoker.ApiClient;
+import com.baeldung.petstore.client.invoker.ApiException;
+import com.baeldung.petstore.client.invoker.Configuration;
+import com.baeldung.petstore.client.invoker.auth.*;
+import com.baeldung.petstore.client.invoker.models.*;
+import com.baeldung.petstore.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://petstore.swagger.io/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Long petId = 56L; // Long | Pet id to delete
+ String apiKey = "apiKey_example"; // String |
+ try {
+ apiInstance.deletePet(petId, apiKey);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#deletePet");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **Long**| Pet id to delete |
+ **apiKey** | **String**| | [optional]
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **400** | Invalid ID supplied | - |
+| **404** | Pet not found | - |
+
+
+## findPetsByStatus
+
+> List<Pet> findPetsByStatus(status)
+
+Finds Pets by status
+
+Multiple status values can be provided with comma separated strings
+
+### Example
+
+```java
+// Import classes:
+import com.baeldung.petstore.client.invoker.ApiClient;
+import com.baeldung.petstore.client.invoker.ApiException;
+import com.baeldung.petstore.client.invoker.Configuration;
+import com.baeldung.petstore.client.invoker.auth.*;
+import com.baeldung.petstore.client.invoker.models.*;
+import com.baeldung.petstore.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://petstore.swagger.io/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ List status = Arrays.asList("available"); // List | Status values that need to be considered for filter
+ try {
+ List result = apiInstance.findPetsByStatus(status);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#findPetsByStatus");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
+
+### Return type
+
+[**List<Pet>**](Pet.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json, application/xml
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+| **400** | Invalid status value | - |
+
+
+## findPetsByTags
+
+> List<Pet> findPetsByTags(tags)
+
+Finds Pets by tags
+
+Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+
+### Example
+
+```java
+// Import classes:
+import com.baeldung.petstore.client.invoker.ApiClient;
+import com.baeldung.petstore.client.invoker.ApiException;
+import com.baeldung.petstore.client.invoker.Configuration;
+import com.baeldung.petstore.client.invoker.auth.*;
+import com.baeldung.petstore.client.invoker.models.*;
+import com.baeldung.petstore.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://petstore.swagger.io/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ List tags = Arrays.asList(); // List | Tags to filter by
+ try {
+ List result = apiInstance.findPetsByTags(tags);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#findPetsByTags");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **tags** | [**List<String>**](String.md)| Tags to filter by |
+
+### Return type
+
+[**List<Pet>**](Pet.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json, application/xml
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+| **400** | Invalid tag value | - |
+
+
+## getPetById
+
+> Pet getPetById(petId)
+
+Find pet by ID
+
+Returns a single pet
+
+### Example
+
+```java
+// Import classes:
+import com.baeldung.petstore.client.invoker.ApiClient;
+import com.baeldung.petstore.client.invoker.ApiException;
+import com.baeldung.petstore.client.invoker.Configuration;
+import com.baeldung.petstore.client.invoker.auth.*;
+import com.baeldung.petstore.client.invoker.models.*;
+import com.baeldung.petstore.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://petstore.swagger.io/v2");
+
+ // Configure API key authorization: api_key
+ ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
+ api_key.setApiKey("YOUR API KEY");
+ // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+ //api_key.setApiKeyPrefix("Token");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Long petId = 56L; // Long | ID of pet to return
+ try {
+ Pet result = apiInstance.getPetById(petId);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#getPetById");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **Long**| ID of pet to return |
+
+### Return type
+
+[**Pet**](Pet.md)
+
+### Authorization
+
+[api_key](../README.md#api_key)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json, application/xml
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+| **400** | Invalid ID supplied | - |
+| **404** | Pet not found | - |
+
+
+## updatePet
+
+> updatePet(body)
+
+Update an existing pet
+
+### Example
+
+```java
+// Import classes:
+import com.baeldung.petstore.client.invoker.ApiClient;
+import com.baeldung.petstore.client.invoker.ApiException;
+import com.baeldung.petstore.client.invoker.Configuration;
+import com.baeldung.petstore.client.invoker.auth.*;
+import com.baeldung.petstore.client.invoker.models.*;
+import com.baeldung.petstore.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://petstore.swagger.io/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Pet body = new Pet(); // Pet | Pet object that needs to be added to the store
+ try {
+ apiInstance.updatePet(body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#updatePet");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: application/json, application/xml
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **400** | Invalid ID supplied | - |
+| **404** | Pet not found | - |
+| **405** | Validation exception | - |
+
+
+## updatePetWithForm
+
+> updatePetWithForm(petId, name, status)
+
+Updates a pet in the store with form data
+
+### Example
+
+```java
+// Import classes:
+import com.baeldung.petstore.client.invoker.ApiClient;
+import com.baeldung.petstore.client.invoker.ApiException;
+import com.baeldung.petstore.client.invoker.Configuration;
+import com.baeldung.petstore.client.invoker.auth.*;
+import com.baeldung.petstore.client.invoker.models.*;
+import com.baeldung.petstore.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://petstore.swagger.io/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Long petId = 56L; // Long | ID of pet that needs to be updated
+ String name = "name_example"; // String | Updated name of the pet
+ String status = "status_example"; // String | Updated status of the pet
+ try {
+ apiInstance.updatePetWithForm(petId, name, status);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#updatePetWithForm");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **Long**| ID of pet that needs to be updated |
+ **name** | **String**| Updated name of the pet | [optional]
+ **status** | **String**| Updated status of the pet | [optional]
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: application/x-www-form-urlencoded
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **405** | Invalid input | - |
+
+
+## uploadFile
+
+> ModelApiResponse uploadFile(petId, additionalMetadata, file)
+
+uploads an image
+
+### Example
+
+```java
+// Import classes:
+import com.baeldung.petstore.client.invoker.ApiClient;
+import com.baeldung.petstore.client.invoker.ApiException;
+import com.baeldung.petstore.client.invoker.Configuration;
+import com.baeldung.petstore.client.invoker.auth.*;
+import com.baeldung.petstore.client.invoker.models.*;
+import com.baeldung.petstore.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://petstore.swagger.io/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Long petId = 56L; // Long | ID of pet to update
+ String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
+ File file = new File("/path/to/file"); // File | file to upload
+ try {
+ ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#uploadFile");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **Long**| ID of pet to update |
+ **additionalMetadata** | **String**| Additional data to pass to server | [optional]
+ **file** | **File**| file to upload | [optional]
+
+### Return type
+
+[**ModelApiResponse**](ModelApiResponse.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: multipart/form-data
+- **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+
diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/docs/StoreApi.md b/spring-swagger-codegen/spring-openapi-generator-api-client/docs/StoreApi.md
new file mode 100644
index 0000000000..7a70c0bdbc
--- /dev/null
+++ b/spring-swagger-codegen/spring-openapi-generator-api-client/docs/StoreApi.md
@@ -0,0 +1,276 @@
+# StoreApi
+
+All URIs are relative to *https://petstore.swagger.io/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
+[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
+[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID
+[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
+
+
+
+## deleteOrder
+
+> deleteOrder(orderId)
+
+Delete purchase order by ID
+
+For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors
+
+### Example
+
+```java
+// Import classes:
+import com.baeldung.petstore.client.invoker.ApiClient;
+import com.baeldung.petstore.client.invoker.ApiException;
+import com.baeldung.petstore.client.invoker.Configuration;
+import com.baeldung.petstore.client.invoker.models.*;
+import com.baeldung.petstore.client.api.StoreApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://petstore.swagger.io/v2");
+
+ StoreApi apiInstance = new StoreApi(defaultClient);
+ Long orderId = 56L; // Long | ID of the order that needs to be deleted
+ try {
+ apiInstance.deleteOrder(orderId);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#deleteOrder");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **orderId** | **Long**| ID of the order that needs to be deleted |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **400** | Invalid ID supplied | - |
+| **404** | Order not found | - |
+
+
+## getInventory
+
+> Map<String, Integer> getInventory()
+
+Returns pet inventories by status
+
+Returns a map of status codes to quantities
+
+### Example
+
+```java
+// Import classes:
+import com.baeldung.petstore.client.invoker.ApiClient;
+import com.baeldung.petstore.client.invoker.ApiException;
+import com.baeldung.petstore.client.invoker.Configuration;
+import com.baeldung.petstore.client.invoker.auth.*;
+import com.baeldung.petstore.client.invoker.models.*;
+import com.baeldung.petstore.client.api.StoreApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://petstore.swagger.io/v2");
+
+ // Configure API key authorization: api_key
+ ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
+ api_key.setApiKey("YOUR API KEY");
+ // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+ //api_key.setApiKeyPrefix("Token");
+
+ StoreApi apiInstance = new StoreApi(defaultClient);
+ try {
+ Map result = apiInstance.getInventory();
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#getInventory");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+**Map<String, Integer>**
+
+### Authorization
+
+[api_key](../README.md#api_key)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+
+
+## getOrderById
+
+> Order getOrderById(orderId)
+
+Find purchase order by ID
+
+For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions
+
+### Example
+
+```java
+// Import classes:
+import com.baeldung.petstore.client.invoker.ApiClient;
+import com.baeldung.petstore.client.invoker.ApiException;
+import com.baeldung.petstore.client.invoker.Configuration;
+import com.baeldung.petstore.client.invoker.models.*;
+import com.baeldung.petstore.client.api.StoreApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://petstore.swagger.io/v2");
+
+ StoreApi apiInstance = new StoreApi(defaultClient);
+ Long orderId = 56L; // Long | ID of pet that needs to be fetched
+ try {
+ Order result = apiInstance.getOrderById(orderId);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#getOrderById");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **orderId** | **Long**| ID of pet that needs to be fetched |
+
+### Return type
+
+[**Order**](Order.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json, application/xml
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+| **400** | Invalid ID supplied | - |
+| **404** | Order not found | - |
+
+
+## placeOrder
+
+> Order placeOrder(body)
+
+Place an order for a pet
+
+### Example
+
+```java
+// Import classes:
+import com.baeldung.petstore.client.invoker.ApiClient;
+import com.baeldung.petstore.client.invoker.ApiException;
+import com.baeldung.petstore.client.invoker.Configuration;
+import com.baeldung.petstore.client.invoker.models.*;
+import com.baeldung.petstore.client.api.StoreApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://petstore.swagger.io/v2");
+
+ StoreApi apiInstance = new StoreApi(defaultClient);
+ Order body = new Order(); // Order | order placed for purchasing the pet
+ try {
+ Order result = apiInstance.placeOrder(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#placeOrder");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**Order**](Order.md)| order placed for purchasing the pet |
+
+### Return type
+
+[**Order**](Order.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json, application/xml
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+| **400** | Invalid Order | - |
+
diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/docs/Tag.md b/spring-swagger-codegen/spring-openapi-generator-api-client/docs/Tag.md
new file mode 100644
index 0000000000..f24eba7d22
--- /dev/null
+++ b/spring-swagger-codegen/spring-openapi-generator-api-client/docs/Tag.md
@@ -0,0 +1,13 @@
+
+
+# Tag
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**name** | **String** | | [optional]
+
+
+
diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/docs/User.md b/spring-swagger-codegen/spring-openapi-generator-api-client/docs/User.md
new file mode 100644
index 0000000000..c4ea94b7fc
--- /dev/null
+++ b/spring-swagger-codegen/spring-openapi-generator-api-client/docs/User.md
@@ -0,0 +1,19 @@
+
+
+# User
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**username** | **String** | | [optional]
+**firstName** | **String** | | [optional]
+**lastName** | **String** | | [optional]
+**email** | **String** | | [optional]
+**password** | **String** | | [optional]
+**phone** | **String** | | [optional]
+**userStatus** | **Integer** | User Status | [optional]
+
+
+
diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/docs/UserApi.md b/spring-swagger-codegen/spring-openapi-generator-api-client/docs/UserApi.md
new file mode 100644
index 0000000000..ff3815e352
--- /dev/null
+++ b/spring-swagger-codegen/spring-openapi-generator-api-client/docs/UserApi.md
@@ -0,0 +1,525 @@
+# UserApi
+
+All URIs are relative to *https://petstore.swagger.io/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**createUser**](UserApi.md#createUser) | **POST** /user | Create user
+[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
+[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
+[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user
+[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name
+[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system
+[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
+[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user
+
+
+
+## createUser
+
+> createUser(body)
+
+Create user
+
+This can only be done by the logged in user.
+
+### Example
+
+```java
+// Import classes:
+import com.baeldung.petstore.client.invoker.ApiClient;
+import com.baeldung.petstore.client.invoker.ApiException;
+import com.baeldung.petstore.client.invoker.Configuration;
+import com.baeldung.petstore.client.invoker.models.*;
+import com.baeldung.petstore.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://petstore.swagger.io/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ User body = new User(); // User | Created user object
+ try {
+ apiInstance.createUser(body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#createUser");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**User**](User.md)| Created user object |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **0** | successful operation | - |
+
+
+## createUsersWithArrayInput
+
+> createUsersWithArrayInput(body)
+
+Creates list of users with given input array
+
+### Example
+
+```java
+// Import classes:
+import com.baeldung.petstore.client.invoker.ApiClient;
+import com.baeldung.petstore.client.invoker.ApiException;
+import com.baeldung.petstore.client.invoker.Configuration;
+import com.baeldung.petstore.client.invoker.models.*;
+import com.baeldung.petstore.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://petstore.swagger.io/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ List body = Arrays.asList(); // List | List of user object
+ try {
+ apiInstance.createUsersWithArrayInput(body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#createUsersWithArrayInput");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**List<User>**](User.md)| List of user object |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **0** | successful operation | - |
+
+
+## createUsersWithListInput
+
+> createUsersWithListInput(body)
+
+Creates list of users with given input array
+
+### Example
+
+```java
+// Import classes:
+import com.baeldung.petstore.client.invoker.ApiClient;
+import com.baeldung.petstore.client.invoker.ApiException;
+import com.baeldung.petstore.client.invoker.Configuration;
+import com.baeldung.petstore.client.invoker.models.*;
+import com.baeldung.petstore.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://petstore.swagger.io/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ List body = Arrays.asList(); // List | List of user object
+ try {
+ apiInstance.createUsersWithListInput(body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#createUsersWithListInput");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**List<User>**](User.md)| List of user object |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **0** | successful operation | - |
+
+
+## deleteUser
+
+> deleteUser(username)
+
+Delete user
+
+This can only be done by the logged in user.
+
+### Example
+
+```java
+// Import classes:
+import com.baeldung.petstore.client.invoker.ApiClient;
+import com.baeldung.petstore.client.invoker.ApiException;
+import com.baeldung.petstore.client.invoker.Configuration;
+import com.baeldung.petstore.client.invoker.models.*;
+import com.baeldung.petstore.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://petstore.swagger.io/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ String username = "username_example"; // String | The name that needs to be deleted
+ try {
+ apiInstance.deleteUser(username);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#deleteUser");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| The name that needs to be deleted |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **400** | Invalid username supplied | - |
+| **404** | User not found | - |
+
+
+## getUserByName
+
+> User getUserByName(username)
+
+Get user by user name
+
+### Example
+
+```java
+// Import classes:
+import com.baeldung.petstore.client.invoker.ApiClient;
+import com.baeldung.petstore.client.invoker.ApiException;
+import com.baeldung.petstore.client.invoker.Configuration;
+import com.baeldung.petstore.client.invoker.models.*;
+import com.baeldung.petstore.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://petstore.swagger.io/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing.
+ try {
+ User result = apiInstance.getUserByName(username);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#getUserByName");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| The name that needs to be fetched. Use user1 for testing. |
+
+### Return type
+
+[**User**](User.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json, application/xml
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+| **400** | Invalid username supplied | - |
+| **404** | User not found | - |
+
+
+## loginUser
+
+> String loginUser(username, password)
+
+Logs user into the system
+
+### Example
+
+```java
+// Import classes:
+import com.baeldung.petstore.client.invoker.ApiClient;
+import com.baeldung.petstore.client.invoker.ApiException;
+import com.baeldung.petstore.client.invoker.Configuration;
+import com.baeldung.petstore.client.invoker.models.*;
+import com.baeldung.petstore.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://petstore.swagger.io/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ String username = "username_example"; // String | The user name for login
+ String password = "password_example"; // String | The password for login in clear text
+ try {
+ String result = apiInstance.loginUser(username, password);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#loginUser");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| The user name for login |
+ **password** | **String**| The password for login in clear text |
+
+### Return type
+
+**String**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json, application/xml
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user * X-Expires-After - date in UTC when token expires |
+| **400** | Invalid username/password supplied | - |
+
+
+## logoutUser
+
+> logoutUser()
+
+Logs out current logged in user session
+
+### Example
+
+```java
+// Import classes:
+import com.baeldung.petstore.client.invoker.ApiClient;
+import com.baeldung.petstore.client.invoker.ApiException;
+import com.baeldung.petstore.client.invoker.Configuration;
+import com.baeldung.petstore.client.invoker.models.*;
+import com.baeldung.petstore.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://petstore.swagger.io/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ try {
+ apiInstance.logoutUser();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#logoutUser");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **0** | successful operation | - |
+
+
+## updateUser
+
+> updateUser(username, body)
+
+Updated user
+
+This can only be done by the logged in user.
+
+### Example
+
+```java
+// Import classes:
+import com.baeldung.petstore.client.invoker.ApiClient;
+import com.baeldung.petstore.client.invoker.ApiException;
+import com.baeldung.petstore.client.invoker.Configuration;
+import com.baeldung.petstore.client.invoker.models.*;
+import com.baeldung.petstore.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("https://petstore.swagger.io/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ String username = "username_example"; // String | name that need to be updated
+ User body = new User(); // User | Updated user object
+ try {
+ apiInstance.updateUser(username, body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#updateUser");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| name that need to be updated |
+ **body** | [**User**](User.md)| Updated user object |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **400** | Invalid user supplied | - |
+| **404** | User not found | - |
+
diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/git_push.sh b/spring-swagger-codegen/spring-openapi-generator-api-client/git_push.sh
new file mode 100644
index 0000000000..ced3be2b0c
--- /dev/null
+++ b/spring-swagger-codegen/spring-openapi-generator-api-client/git_push.sh
@@ -0,0 +1,58 @@
+#!/bin/sh
+# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
+#
+# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
+
+git_user_id=$1
+git_repo_id=$2
+release_note=$3
+git_host=$4
+
+if [ "$git_host" = "" ]; then
+ git_host="github.com"
+ echo "[INFO] No command line input provided. Set \$git_host to $git_host"
+fi
+
+if [ "$git_user_id" = "" ]; then
+ git_user_id="GIT_USER_ID"
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
+fi
+
+if [ "$git_repo_id" = "" ]; then
+ git_repo_id="GIT_REPO_ID"
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
+fi
+
+if [ "$release_note" = "" ]; then
+ release_note="Minor update"
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
+fi
+
+# Initialize the local directory as a Git repository
+git init
+
+# Adds the files in the local repository and stages them for commit.
+git add .
+
+# Commits the tracked changes and prepares them to be pushed to a remote repository.
+git commit -m "$release_note"
+
+# Sets the new remote
+git_remote=`git remote`
+if [ "$git_remote" = "" ]; then # git remote not defined
+
+ if [ "$GIT_TOKEN" = "" ]; then
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
+ git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
+ else
+ git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
+ fi
+
+fi
+
+git pull origin master
+
+# Pushes (Forces) the changes in the local repository up to the remote repository
+echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
+git push origin master 2>&1 | grep -v 'To https'
+
diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/gradle.properties b/spring-swagger-codegen/spring-openapi-generator-api-client/gradle.properties
new file mode 100644
index 0000000000..05644f0754
--- /dev/null
+++ b/spring-swagger-codegen/spring-openapi-generator-api-client/gradle.properties
@@ -0,0 +1,2 @@
+# Uncomment to build for Android
+#target = android
\ No newline at end of file
diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/gradle/wrapper/gradle-wrapper.jar b/spring-swagger-codegen/spring-openapi-generator-api-client/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000000..cc4fdc293d
Binary files /dev/null and b/spring-swagger-codegen/spring-openapi-generator-api-client/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/gradle/wrapper/gradle-wrapper.properties b/spring-swagger-codegen/spring-openapi-generator-api-client/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000000..94920145f3
--- /dev/null
+++ b/spring-swagger-codegen/spring-openapi-generator-api-client/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/gradlew b/spring-swagger-codegen/spring-openapi-generator-api-client/gradlew
new file mode 100644
index 0000000000..2fe81a7d95
--- /dev/null
+++ b/spring-swagger-codegen/spring-openapi-generator-api-client/gradlew
@@ -0,0 +1,183 @@
+#!/usr/bin/env sh
+
+#
+# Copyright 2015 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=`expr $i + 1`
+ done
+ case $i in
+ 0) set -- ;;
+ 1) set -- "$args0" ;;
+ 2) set -- "$args0" "$args1" ;;
+ 3) set -- "$args0" "$args1" "$args2" ;;
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=`save "$@"`
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+exec "$JAVACMD" "$@"
diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/gradlew.bat b/spring-swagger-codegen/spring-openapi-generator-api-client/gradlew.bat
new file mode 100644
index 0000000000..9618d8d960
--- /dev/null
+++ b/spring-swagger-codegen/spring-openapi-generator-api-client/gradlew.bat
@@ -0,0 +1,100 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/pom.xml b/spring-swagger-codegen/spring-openapi-generator-api-client/pom.xml
new file mode 100644
index 0000000000..cc70a9f654
--- /dev/null
+++ b/spring-swagger-codegen/spring-openapi-generator-api-client/pom.xml
@@ -0,0 +1,274 @@
+
+ 4.0.0
+ com.baeldung
+ spring-openapi-generator-api-client
+ jar
+ spring-openapi-generator-api-client
+ 0.0.1-SNAPSHOT
+ https://github.com/openapitools/openapi-generator
+ OpenAPI Java
+
+ scm:git:git@github.com:openapitools/openapi-generator.git
+ scm:git:git@github.com:openapitools/openapi-generator.git
+ https://github.com/openapitools/openapi-generator
+
+
+
+
+ Unlicense
+ http://www.apache.org/licenses/LICENSE-2.0.html
+ repo
+
+
+
+
+
+ OpenAPI-Generator Contributors
+ team@openapitools.org
+ OpenAPITools.org
+ http://openapitools.org
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-enforcer-plugin
+ 3.0.0-M1
+
+
+ enforce-maven
+
+ enforce
+
+
+
+
+ 2.2.0
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 2.12
+
+
+
+ loggerPath
+ conf/log4j.properties
+
+
+ -Xms512m -Xmx1500m
+ methods
+ pertest
+
+
+
+ maven-dependency-plugin
+
+
+ package
+
+ copy-dependencies
+
+
+ ${project.build.directory}/lib
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ 2.2
+
+
+
+ jar
+ test-jar
+
+
+
+
+
+
+
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+ 1.10
+
+
+ add_sources
+ generate-sources
+
+ add-source
+
+
+
+
+
+
+
+
+ add_test_sources
+ generate-test-sources
+
+ add-test-source
+
+
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.6.1
+
+
+ 1.8
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 2.10.4
+
+
+ attach-javadocs
+
+ jar
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 2.2.1
+
+
+ attach-sources
+
+ jar-no-fork
+
+
+
+
+
+
+
+
+
+ sign-artifacts
+
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ 1.5
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+
+
+
+
+
+
+
+
+ io.swagger
+ swagger-annotations
+ ${swagger-annotations-version}
+
+
+
+
+ com.google.code.findbugs
+ jsr305
+ 3.0.2
+
+
+
+
+ org.springframework
+ spring-web
+ ${spring-web-version}
+
+
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+ ${jackson-version}
+
+
+ com.fasterxml.jackson.core
+ jackson-annotations
+ ${jackson-version}
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ ${jackson-databind-version}
+
+
+ com.fasterxml.jackson.jaxrs
+ jackson-jaxrs-json-provider
+ ${jackson-version}
+
+
+ org.openapitools
+ jackson-databind-nullable
+ ${jackson-databind-nullable-version}
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+ ${jackson-version}
+
+
+ com.github.joschi.jackson
+ jackson-datatype-threetenbp
+ ${jackson-threetenbp-version}
+
+
+
+
+ junit
+ junit
+ ${junit-version}
+ test
+
+
+
+ UTF-8
+ 1.5.22
+ 4.3.9.RELEASE
+ 2.10.1
+ 2.10.1
+ 0.2.1
+ 2.9.10
+ 1.0.0
+ 4.13
+
+
diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/settings.gradle b/spring-swagger-codegen/spring-openapi-generator-api-client/settings.gradle
new file mode 100644
index 0000000000..06a087cb49
--- /dev/null
+++ b/spring-swagger-codegen/spring-openapi-generator-api-client/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = "spring-openapi-generator-api-client"
\ No newline at end of file
diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/src/main/AndroidManifest.xml b/spring-swagger-codegen/spring-openapi-generator-api-client/src/main/AndroidManifest.xml
new file mode 100644
index 0000000000..cd581f9f78
--- /dev/null
+++ b/spring-swagger-codegen/spring-openapi-generator-api-client/src/main/AndroidManifest.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/src/main/java/com/baeldung/petstore/client/api/PetApi.java b/spring-swagger-codegen/spring-openapi-generator-api-client/src/main/java/com/baeldung/petstore/client/api/PetApi.java
new file mode 100644
index 0000000000..b7256c81fb
--- /dev/null
+++ b/spring-swagger-codegen/spring-openapi-generator-api-client/src/main/java/com/baeldung/petstore/client/api/PetApi.java
@@ -0,0 +1,477 @@
+package com.baeldung.petstore.client.api;
+
+import com.baeldung.petstore.client.invoker.ApiClient;
+import com.baeldung.petstore.client.model.ModelApiResponse;
+import com.baeldung.petstore.client.model.Pet;
+
+import java.io.File;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.core.io.FileSystemResource;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Component;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.HttpClientErrorException;
+import org.springframework.web.client.RestClientException;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2020-03-15T06:14:01.568992-05:00[America/Chicago]")
+@Component("com.baeldung.petstore.client.api.PetApi")
+public class PetApi {
+ private ApiClient apiClient;
+
+ public PetApi() {
+ this(new ApiClient());
+ }
+
+ @Autowired
+ public PetApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Add a new pet to the store
+ *
+ *
405 - Invalid input
+ * @param body Pet object that needs to be added to the store (required)
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public void addPet(Pet body) throws RestClientException {
+ addPetWithHttpInfo(body);
+ }
+
+ /**
+ * Add a new pet to the store
+ *
+ *
405 - Invalid input
+ * @param body Pet object that needs to be added to the store (required)
+ * @return ResponseEntity<Void>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public ResponseEntity addPetWithHttpInfo(Pet body) throws RestClientException {
+ Object postBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling addPet");
+ }
+
+ String path = apiClient.expandPath("/pet", Collections.emptyMap());
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap cookieParams = new LinkedMultiValueMap();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ final String[] accepts = { };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = {
+ "application/json", "application/xml"
+ };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { "petstore_auth" };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ * Deletes a pet
+ *
+ *
400 - Invalid ID supplied
+ *
404 - Pet not found
+ * @param petId Pet id to delete (required)
+ * @param apiKey (optional)
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public void deletePet(Long petId, String apiKey) throws RestClientException {
+ deletePetWithHttpInfo(petId, apiKey);
+ }
+
+ /**
+ * Deletes a pet
+ *
+ *
400 - Invalid ID supplied
+ *
404 - Pet not found
+ * @param petId Pet id to delete (required)
+ * @param apiKey (optional)
+ * @return ResponseEntity<Void>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public ResponseEntity deletePetWithHttpInfo(Long petId, String apiKey) throws RestClientException {
+ Object postBody = null;
+
+ // verify the required parameter 'petId' is set
+ if (petId == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'petId' when calling deletePet");
+ }
+
+ // create path and map variables
+ final Map uriVariables = new HashMap();
+ uriVariables.put("petId", petId);
+ String path = apiClient.expandPath("/pet/{petId}", uriVariables);
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap cookieParams = new LinkedMultiValueMap();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ if (apiKey != null)
+ headerParams.add("api_key", apiClient.parameterToString(apiKey));
+
+ final String[] accepts = { };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = { };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { "petstore_auth" };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ * Finds Pets by status
+ * Multiple status values can be provided with comma separated strings
+ *
200 - successful operation
+ *
400 - Invalid status value
+ * @param status Status values that need to be considered for filter (required)
+ * @return List<Pet>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public List findPetsByStatus(List status) throws RestClientException {
+ return findPetsByStatusWithHttpInfo(status).getBody();
+ }
+
+ /**
+ * Finds Pets by status
+ * Multiple status values can be provided with comma separated strings
+ *
200 - successful operation
+ *
400 - Invalid status value
+ * @param status Status values that need to be considered for filter (required)
+ * @return ResponseEntity<List<Pet>>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public ResponseEntity> findPetsByStatusWithHttpInfo(List status) throws RestClientException {
+ Object postBody = null;
+
+ // verify the required parameter 'status' is set
+ if (status == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'status' when calling findPetsByStatus");
+ }
+
+ String path = apiClient.expandPath("/pet/findByStatus", Collections.emptyMap());
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap cookieParams = new LinkedMultiValueMap();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "status", status));
+
+ final String[] accepts = {
+ "application/json", "application/xml"
+ };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = { };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { "petstore_auth" };
+
+ ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {};
+ return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ * Finds Pets by tags
+ * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ *
200 - successful operation
+ *
400 - Invalid tag value
+ * @param tags Tags to filter by (required)
+ * @return List<Pet>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ @Deprecated
+ public List findPetsByTags(List tags) throws RestClientException {
+ return findPetsByTagsWithHttpInfo(tags).getBody();
+ }
+
+ /**
+ * Finds Pets by tags
+ * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ *
200 - successful operation
+ *
400 - Invalid tag value
+ * @param tags Tags to filter by (required)
+ * @return ResponseEntity<List<Pet>>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ @Deprecated
+ public ResponseEntity> findPetsByTagsWithHttpInfo(List tags) throws RestClientException {
+ Object postBody = null;
+
+ // verify the required parameter 'tags' is set
+ if (tags == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'tags' when calling findPetsByTags");
+ }
+
+ String path = apiClient.expandPath("/pet/findByTags", Collections.emptyMap());
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap cookieParams = new LinkedMultiValueMap();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "tags", tags));
+
+ final String[] accepts = {
+ "application/json", "application/xml"
+ };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = { };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { "petstore_auth" };
+
+ ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {};
+ return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ * Find pet by ID
+ * Returns a single pet
+ *
200 - successful operation
+ *
400 - Invalid ID supplied
+ *
404 - Pet not found
+ * @param petId ID of pet to return (required)
+ * @return Pet
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public Pet getPetById(Long petId) throws RestClientException {
+ return getPetByIdWithHttpInfo(petId).getBody();
+ }
+
+ /**
+ * Find pet by ID
+ * Returns a single pet
+ *
200 - successful operation
+ *
400 - Invalid ID supplied
+ *
404 - Pet not found
+ * @param petId ID of pet to return (required)
+ * @return ResponseEntity<Pet>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public ResponseEntity getPetByIdWithHttpInfo(Long petId) throws RestClientException {
+ Object postBody = null;
+
+ // verify the required parameter 'petId' is set
+ if (petId == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'petId' when calling getPetById");
+ }
+
+ // create path and map variables
+ final Map uriVariables = new HashMap();
+ uriVariables.put("petId", petId);
+ String path = apiClient.expandPath("/pet/{petId}", uriVariables);
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap cookieParams = new LinkedMultiValueMap();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ final String[] accepts = {
+ "application/json", "application/xml"
+ };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = { };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { "api_key" };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ * Update an existing pet
+ *
+ *
400 - Invalid ID supplied
+ *
404 - Pet not found
+ *
405 - Validation exception
+ * @param body Pet object that needs to be added to the store (required)
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public void updatePet(Pet body) throws RestClientException {
+ updatePetWithHttpInfo(body);
+ }
+
+ /**
+ * Update an existing pet
+ *
+ *
400 - Invalid ID supplied
+ *
404 - Pet not found
+ *
405 - Validation exception
+ * @param body Pet object that needs to be added to the store (required)
+ * @return ResponseEntity<Void>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public ResponseEntity updatePetWithHttpInfo(Pet body) throws RestClientException {
+ Object postBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling updatePet");
+ }
+
+ String path = apiClient.expandPath("/pet", Collections.emptyMap());
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap cookieParams = new LinkedMultiValueMap();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ final String[] accepts = { };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = {
+ "application/json", "application/xml"
+ };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { "petstore_auth" };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ * Updates a pet in the store with form data
+ *
+ *
405 - Invalid input
+ * @param petId ID of pet that needs to be updated (required)
+ * @param name Updated name of the pet (optional)
+ * @param status Updated status of the pet (optional)
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public void updatePetWithForm(Long petId, String name, String status) throws RestClientException {
+ updatePetWithFormWithHttpInfo(petId, name, status);
+ }
+
+ /**
+ * Updates a pet in the store with form data
+ *
+ *
405 - Invalid input
+ * @param petId ID of pet that needs to be updated (required)
+ * @param name Updated name of the pet (optional)
+ * @param status Updated status of the pet (optional)
+ * @return ResponseEntity<Void>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public ResponseEntity updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws RestClientException {
+ Object postBody = null;
+
+ // verify the required parameter 'petId' is set
+ if (petId == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'petId' when calling updatePetWithForm");
+ }
+
+ // create path and map variables
+ final Map uriVariables = new HashMap();
+ uriVariables.put("petId", petId);
+ String path = apiClient.expandPath("/pet/{petId}", uriVariables);
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap cookieParams = new LinkedMultiValueMap();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ if (name != null)
+ formParams.add("name", name);
+ if (status != null)
+ formParams.add("status", status);
+
+ final String[] accepts = { };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = {
+ "application/x-www-form-urlencoded"
+ };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { "petstore_auth" };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ * uploads an image
+ *
+ *
200 - successful operation
+ * @param petId ID of pet to update (required)
+ * @param additionalMetadata Additional data to pass to server (optional)
+ * @param file file to upload (optional)
+ * @return ModelApiResponse
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws RestClientException {
+ return uploadFileWithHttpInfo(petId, additionalMetadata, file).getBody();
+ }
+
+ /**
+ * uploads an image
+ *
+ *
200 - successful operation
+ * @param petId ID of pet to update (required)
+ * @param additionalMetadata Additional data to pass to server (optional)
+ * @param file file to upload (optional)
+ * @return ResponseEntity<ModelApiResponse>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public ResponseEntity uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws RestClientException {
+ Object postBody = null;
+
+ // verify the required parameter 'petId' is set
+ if (petId == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'petId' when calling uploadFile");
+ }
+
+ // create path and map variables
+ final Map uriVariables = new HashMap();
+ uriVariables.put("petId", petId);
+ String path = apiClient.expandPath("/pet/{petId}/uploadImage", uriVariables);
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap cookieParams = new LinkedMultiValueMap();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ if (additionalMetadata != null)
+ formParams.add("additionalMetadata", additionalMetadata);
+ if (file != null)
+ formParams.add("file", new FileSystemResource(file));
+
+ final String[] accepts = {
+ "application/json"
+ };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = {
+ "multipart/form-data"
+ };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { "petstore_auth" };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType);
+ }
+}
diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/src/main/java/com/baeldung/petstore/client/api/StoreApi.java b/spring-swagger-codegen/spring-openapi-generator-api-client/src/main/java/com/baeldung/petstore/client/api/StoreApi.java
new file mode 100644
index 0000000000..792617bc28
--- /dev/null
+++ b/spring-swagger-codegen/spring-openapi-generator-api-client/src/main/java/com/baeldung/petstore/client/api/StoreApi.java
@@ -0,0 +1,240 @@
+package com.baeldung.petstore.client.api;
+
+import com.baeldung.petstore.client.invoker.ApiClient;
+import com.baeldung.petstore.client.model.Order;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Component;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.HttpClientErrorException;
+import org.springframework.web.client.RestClientException;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2020-03-15T06:14:01.568992-05:00[America/Chicago]")
+@Component("com.baeldung.petstore.client.api.StoreApi")
+public class StoreApi {
+ private ApiClient apiClient;
+
+ public StoreApi() {
+ this(new ApiClient());
+ }
+
+ @Autowired
+ public StoreApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Delete purchase order by ID
+ * For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors
+ *
400 - Invalid ID supplied
+ *
404 - Order not found
+ * @param orderId ID of the order that needs to be deleted (required)
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public void deleteOrder(Long orderId) throws RestClientException {
+ deleteOrderWithHttpInfo(orderId);
+ }
+
+ /**
+ * Delete purchase order by ID
+ * For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors
+ *
400 - Invalid ID supplied
+ *
404 - Order not found
+ * @param orderId ID of the order that needs to be deleted (required)
+ * @return ResponseEntity<Void>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public ResponseEntity deleteOrderWithHttpInfo(Long orderId) throws RestClientException {
+ Object postBody = null;
+
+ // verify the required parameter 'orderId' is set
+ if (orderId == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'orderId' when calling deleteOrder");
+ }
+
+ // create path and map variables
+ final Map uriVariables = new HashMap();
+ uriVariables.put("orderId", orderId);
+ String path = apiClient.expandPath("/store/order/{orderId}", uriVariables);
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap cookieParams = new LinkedMultiValueMap();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ final String[] accepts = { };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = { };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ * Returns pet inventories by status
+ * Returns a map of status codes to quantities
+ *
200 - successful operation
+ * @return Map<String, Integer>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public Map getInventory() throws RestClientException {
+ return getInventoryWithHttpInfo().getBody();
+ }
+
+ /**
+ * Returns pet inventories by status
+ * Returns a map of status codes to quantities
+ *
200 - successful operation
+ * @return ResponseEntity<Map<String, Integer>>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public ResponseEntity