diff --git a/aws-app-sync/README.md b/aws-app-sync/README.md
new file mode 100644
index 0000000000..976a999f40
--- /dev/null
+++ b/aws-app-sync/README.md
@@ -0,0 +1,3 @@
+### Relevant Articles:
+
+- [AWS AppSync With Spring Boot](https://www.baeldung.com/aws-appsync-spring)
diff --git a/core-java-modules/core-java-8-2/pom.xml b/core-java-modules/core-java-8-2/pom.xml
index 00579c49b2..48474a5eef 100644
--- a/core-java-modules/core-java-8-2/pom.xml
+++ b/core-java-modules/core-java-8-2/pom.xml
@@ -8,12 +8,11 @@
0.1.0-SNAPSHOT
core-java-8-2
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-8-datetime-2/pom.xml b/core-java-modules/core-java-8-datetime-2/pom.xml
index ce98b72781..629ce5234d 100644
--- a/core-java-modules/core-java-8-datetime-2/pom.xml
+++ b/core-java-modules/core-java-8-datetime-2/pom.xml
@@ -8,12 +8,11 @@
${project.parent.version}
core-java-8-datetime
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-8-datetime/pom.xml b/core-java-modules/core-java-8-datetime/pom.xml
index ce98b72781..629ce5234d 100644
--- a/core-java-modules/core-java-8-datetime/pom.xml
+++ b/core-java-modules/core-java-8-datetime/pom.xml
@@ -8,12 +8,11 @@
${project.parent.version}
core-java-8-datetime
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-8/pom.xml b/core-java-modules/core-java-8/pom.xml
index a434be028d..557f9e0dce 100644
--- a/core-java-modules/core-java-8/pom.xml
+++ b/core-java-modules/core-java-8/pom.xml
@@ -8,12 +8,11 @@
0.1.0-SNAPSHOT
core-java-8
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-9-streams/pom.xml b/core-java-modules/core-java-9-streams/pom.xml
index 7865b336a7..8c1af89b24 100644
--- a/core-java-modules/core-java-9-streams/pom.xml
+++ b/core-java-modules/core-java-9-streams/pom.xml
@@ -8,12 +8,11 @@
0.1.0-SNAPSHOT
core-java-9-streams
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-annotations/pom.xml b/core-java-modules/core-java-annotations/pom.xml
index 8fc4c15cde..92ba4991bb 100644
--- a/core-java-modules/core-java-annotations/pom.xml
+++ b/core-java-modules/core-java-annotations/pom.xml
@@ -10,10 +10,10 @@
jar
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-arrays-convert/pom.xml b/core-java-modules/core-java-arrays-convert/pom.xml
index bd50289f47..67dc645936 100644
--- a/core-java-modules/core-java-arrays-convert/pom.xml
+++ b/core-java-modules/core-java-arrays-convert/pom.xml
@@ -5,7 +5,7 @@
core-java-modules
com.baeldung.core-java-modules
- 1.0.0-SNAPSHOT
+ 0.0.1-SNAPSHOT
4.0.0
diff --git a/core-java-modules/core-java-arrays-guides/pom.xml b/core-java-modules/core-java-arrays-guides/pom.xml
index ef718d5117..df8639820d 100644
--- a/core-java-modules/core-java-arrays-guides/pom.xml
+++ b/core-java-modules/core-java-arrays-guides/pom.xml
@@ -5,7 +5,7 @@
core-java-modules
com.baeldung.core-java-modules
- 1.0.0-SNAPSHOT
+ 0.0.1-SNAPSHOT
4.0.0
diff --git a/core-java-modules/core-java-arrays-multidimensional/pom.xml b/core-java-modules/core-java-arrays-multidimensional/pom.xml
index 6e49a20521..d90853678c 100644
--- a/core-java-modules/core-java-arrays-multidimensional/pom.xml
+++ b/core-java-modules/core-java-arrays-multidimensional/pom.xml
@@ -5,7 +5,7 @@
core-java-modules
com.baeldung.core-java-modules
- 1.0.0-SNAPSHOT
+ 0.0.1-SNAPSHOT
4.0.0
diff --git a/core-java-modules/core-java-arrays-operations-advanced/pom.xml b/core-java-modules/core-java-arrays-operations-advanced/pom.xml
index 8989e91189..d73fdcee28 100644
--- a/core-java-modules/core-java-arrays-operations-advanced/pom.xml
+++ b/core-java-modules/core-java-arrays-operations-advanced/pom.xml
@@ -5,7 +5,7 @@
core-java-modules
com.baeldung.core-java-modules
- 1.0.0-SNAPSHOT
+ 0.0.1-SNAPSHOT
4.0.0
diff --git a/core-java-modules/core-java-arrays-operations-basic/pom.xml b/core-java-modules/core-java-arrays-operations-basic/pom.xml
index 4480c14bb2..73588d662a 100644
--- a/core-java-modules/core-java-arrays-operations-basic/pom.xml
+++ b/core-java-modules/core-java-arrays-operations-basic/pom.xml
@@ -5,7 +5,7 @@
core-java-modules
com.baeldung.core-java-modules
- 1.0.0-SNAPSHOT
+ 0.0.1-SNAPSHOT
4.0.0
diff --git a/core-java-modules/core-java-arrays-sorting/pom.xml b/core-java-modules/core-java-arrays-sorting/pom.xml
index 127d921b2a..d5e2beaac4 100644
--- a/core-java-modules/core-java-arrays-sorting/pom.xml
+++ b/core-java-modules/core-java-arrays-sorting/pom.xml
@@ -5,8 +5,8 @@
core-java-modules
com.baeldung.core-java-modules
- 1.0.0-SNAPSHOT
- ../pom.xml
+ 0.0.1-SNAPSHOT
+ ../
4.0.0
diff --git a/core-java-modules/core-java-collections-2/pom.xml b/core-java-modules/core-java-collections-2/pom.xml
index 3a7c70b1a2..d163aabdbc 100644
--- a/core-java-modules/core-java-collections-2/pom.xml
+++ b/core-java-modules/core-java-collections-2/pom.xml
@@ -7,12 +7,11 @@
core-java-collections-2
core-java-collections-2
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-collections-3/pom.xml b/core-java-modules/core-java-collections-3/pom.xml
index 1e1695c8bc..bd991bfefa 100644
--- a/core-java-modules/core-java-collections-3/pom.xml
+++ b/core-java-modules/core-java-collections-3/pom.xml
@@ -8,12 +8,11 @@
0.1.0-SNAPSHOT
core-java-collections-3
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-collections-array-list/pom.xml b/core-java-modules/core-java-collections-array-list/pom.xml
index 74a6513cac..81ee4eff55 100644
--- a/core-java-modules/core-java-collections-array-list/pom.xml
+++ b/core-java-modules/core-java-collections-array-list/pom.xml
@@ -8,12 +8,11 @@
0.1.0-SNAPSHOT
core-java-collections-array-list
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-collections-list-2/pom.xml b/core-java-modules/core-java-collections-list-2/pom.xml
index 3184da1294..230787d14d 100644
--- a/core-java-modules/core-java-collections-list-2/pom.xml
+++ b/core-java-modules/core-java-collections-list-2/pom.xml
@@ -8,12 +8,11 @@
0.1.0-SNAPSHOT
core-java-collections-list-2
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-collections-list-3/pom.xml b/core-java-modules/core-java-collections-list-3/pom.xml
index 090e756ac6..373190a130 100644
--- a/core-java-modules/core-java-collections-list-3/pom.xml
+++ b/core-java-modules/core-java-collections-list-3/pom.xml
@@ -8,12 +8,11 @@
0.1.0-SNAPSHOT
core-java-collections-list-3
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-collections-list/pom.xml b/core-java-modules/core-java-collections-list/pom.xml
index e6dce5a0db..509f58ea61 100644
--- a/core-java-modules/core-java-collections-list/pom.xml
+++ b/core-java-modules/core-java-collections-list/pom.xml
@@ -8,12 +8,11 @@
0.1.0-SNAPSHOT
core-java-collections-list
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-collections-maps-2/pom.xml b/core-java-modules/core-java-collections-maps-2/pom.xml
index a08a4ac072..a64a11c6ea 100644
--- a/core-java-modules/core-java-collections-maps-2/pom.xml
+++ b/core-java-modules/core-java-collections-maps-2/pom.xml
@@ -7,12 +7,11 @@
0.1.0-SNAPSHOT
core-java-collections-maps-2
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-collections-maps-3/pom.xml b/core-java-modules/core-java-collections-maps-3/pom.xml
index 95414c12c2..f547968b22 100644
--- a/core-java-modules/core-java-collections-maps-3/pom.xml
+++ b/core-java-modules/core-java-collections-maps-3/pom.xml
@@ -7,12 +7,11 @@
0.1.0-SNAPSHOT
core-java-collections-maps-3
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-collections-maps/pom.xml b/core-java-modules/core-java-collections-maps/pom.xml
index c0dd705c1c..742e264504 100644
--- a/core-java-modules/core-java-collections-maps/pom.xml
+++ b/core-java-modules/core-java-collections-maps/pom.xml
@@ -6,12 +6,11 @@
0.1.0-SNAPSHOT
core-java-collections-maps
jar
-
-
- com.baeldung
- parent-java
+
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-collections-set/pom.xml b/core-java-modules/core-java-collections-set/pom.xml
index c89ba0c091..7c55f2ff2a 100644
--- a/core-java-modules/core-java-collections-set/pom.xml
+++ b/core-java-modules/core-java-collections-set/pom.xml
@@ -8,12 +8,11 @@
0.1.0-SNAPSHOT
core-java-collections-set
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-collections/pom.xml b/core-java-modules/core-java-collections/pom.xml
index 515d19d7fb..e1219c4713 100644
--- a/core-java-modules/core-java-collections/pom.xml
+++ b/core-java-modules/core-java-collections/pom.xml
@@ -8,12 +8,11 @@
0.1.0-SNAPSHOT
core-java-collections
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-concurrency-2/pom.xml b/core-java-modules/core-java-concurrency-2/pom.xml
index dfb5674c8e..75fd3890b3 100644
--- a/core-java-modules/core-java-concurrency-2/pom.xml
+++ b/core-java-modules/core-java-concurrency-2/pom.xml
@@ -8,12 +8,11 @@
0.1.0-SNAPSHOT
core-java-concurrency-2
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-concurrency-advanced-2/pom.xml b/core-java-modules/core-java-concurrency-advanced-2/pom.xml
index 8752e7b7db..2f374bffac 100644
--- a/core-java-modules/core-java-concurrency-advanced-2/pom.xml
+++ b/core-java-modules/core-java-concurrency-advanced-2/pom.xml
@@ -8,12 +8,11 @@
0.1.0-SNAPSHOT
core-java-concurrency-advanced-2
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-concurrency-advanced-3/README.md b/core-java-modules/core-java-concurrency-advanced-3/README.md
index dfd264116c..e33b6ab692 100644
--- a/core-java-modules/core-java-concurrency-advanced-3/README.md
+++ b/core-java-modules/core-java-concurrency-advanced-3/README.md
@@ -12,4 +12,5 @@ This module contains articles about advanced topics about multithreading with co
- [Asynchronous Programming in Java](https://www.baeldung.com/java-asynchronous-programming)
- [Java Thread Deadlock and Livelock](https://www.baeldung.com/java-deadlock-livelock)
- [Guide to AtomicStampedReference in Java](https://www.baeldung.com/java-atomicstampedreference)
+- [The ABA Problem in Concurrency](https://www.baeldung.com/cs/aba-concurrency)
- [[<-- previous]](/core-java-modules/core-java-concurrency-advanced-2)
diff --git a/core-java-modules/core-java-concurrency-advanced-3/pom.xml b/core-java-modules/core-java-concurrency-advanced-3/pom.xml
index cf81214125..32267fb800 100644
--- a/core-java-modules/core-java-concurrency-advanced-3/pom.xml
+++ b/core-java-modules/core-java-concurrency-advanced-3/pom.xml
@@ -9,12 +9,11 @@
0.1.0-SNAPSHOT
core-java-concurrency-advanced-3
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-concurrency-advanced/pom.xml b/core-java-modules/core-java-concurrency-advanced/pom.xml
index d39712468f..67db486121 100644
--- a/core-java-modules/core-java-concurrency-advanced/pom.xml
+++ b/core-java-modules/core-java-concurrency-advanced/pom.xml
@@ -8,12 +8,11 @@
0.1.0-SNAPSHOT
core-java-concurrency-advanced
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-concurrency-basic-2/pom.xml b/core-java-modules/core-java-concurrency-basic-2/pom.xml
index 8c9bbef54c..adc4fd33e3 100644
--- a/core-java-modules/core-java-concurrency-basic-2/pom.xml
+++ b/core-java-modules/core-java-concurrency-basic-2/pom.xml
@@ -8,12 +8,11 @@
0.1.0-SNAPSHOT
core-java-concurrency-basic-2
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-concurrency-basic/pom.xml b/core-java-modules/core-java-concurrency-basic/pom.xml
index c15200da1f..29d393805b 100644
--- a/core-java-modules/core-java-concurrency-basic/pom.xml
+++ b/core-java-modules/core-java-concurrency-basic/pom.xml
@@ -8,12 +8,11 @@
0.1.0-SNAPSHOT
core-java-concurrency-basic
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-concurrency-collections/pom.xml b/core-java-modules/core-java-concurrency-collections/pom.xml
index 5c038639a7..31f5a0fca8 100644
--- a/core-java-modules/core-java-concurrency-collections/pom.xml
+++ b/core-java-modules/core-java-concurrency-collections/pom.xml
@@ -8,12 +8,11 @@
0.1.0-SNAPSHOT
core-java-concurrency-collections
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-date-operations-1/pom.xml b/core-java-modules/core-java-date-operations-1/pom.xml
index 54cbc79678..e12e4aa4ee 100644
--- a/core-java-modules/core-java-date-operations-1/pom.xml
+++ b/core-java-modules/core-java-date-operations-1/pom.xml
@@ -8,12 +8,11 @@
${project.parent.version}
core-java-date-operations-1
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-date-operations-2/pom.xml b/core-java-modules/core-java-date-operations-2/pom.xml
index ea5f852b0d..5861a9ab98 100644
--- a/core-java-modules/core-java-date-operations-2/pom.xml
+++ b/core-java-modules/core-java-date-operations-2/pom.xml
@@ -8,12 +8,11 @@
${project.parent.version}
core-java-date-operations-2
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-datetime-conversion/pom.xml b/core-java-modules/core-java-datetime-conversion/pom.xml
index e2dd579335..79d1394576 100644
--- a/core-java-modules/core-java-datetime-conversion/pom.xml
+++ b/core-java-modules/core-java-datetime-conversion/pom.xml
@@ -8,12 +8,11 @@
${project.parent.version}
core-java-datetime-conversion
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-datetime-string/pom.xml b/core-java-modules/core-java-datetime-string/pom.xml
index ceb7641320..c1181f670a 100644
--- a/core-java-modules/core-java-datetime-string/pom.xml
+++ b/core-java-modules/core-java-datetime-string/pom.xml
@@ -8,12 +8,11 @@
${project.parent.version}
core-java-datetime-string
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-exceptions-2/pom.xml b/core-java-modules/core-java-exceptions-2/pom.xml
index 915ec1da69..a53bf37b77 100644
--- a/core-java-modules/core-java-exceptions-2/pom.xml
+++ b/core-java-modules/core-java-exceptions-2/pom.xml
@@ -7,12 +7,11 @@
core-java-exceptions-2
core-java-exceptions-2
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-exceptions/pom.xml b/core-java-modules/core-java-exceptions/pom.xml
index 0778b6b5a3..b708aff6b9 100644
--- a/core-java-modules/core-java-exceptions/pom.xml
+++ b/core-java-modules/core-java-exceptions/pom.xml
@@ -9,12 +9,11 @@
0.1.0-SNAPSHOT
core-java-exceptions
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-function/pom.xml b/core-java-modules/core-java-function/pom.xml
index 1a853d5580..0eb34bed7b 100644
--- a/core-java-modules/core-java-function/pom.xml
+++ b/core-java-modules/core-java-function/pom.xml
@@ -8,12 +8,11 @@
0.1.0-SNAPSHOT
core-java-function
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-io-2/pom.xml b/core-java-modules/core-java-io-2/pom.xml
index ec27c76435..bdc2ee37f5 100644
--- a/core-java-modules/core-java-io-2/pom.xml
+++ b/core-java-modules/core-java-io-2/pom.xml
@@ -8,12 +8,11 @@
0.1.0-SNAPSHOT
core-java-io-2
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-io-apis/pom.xml b/core-java-modules/core-java-io-apis/pom.xml
index 9628027309..9350e4b527 100644
--- a/core-java-modules/core-java-io-apis/pom.xml
+++ b/core-java-modules/core-java-io-apis/pom.xml
@@ -8,12 +8,11 @@
0.1.0-SNAPSHOT
core-java-io-apis
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-io-conversions-2/pom.xml b/core-java-modules/core-java-io-conversions-2/pom.xml
index e95d1f4b67..46bce7988b 100644
--- a/core-java-modules/core-java-io-conversions-2/pom.xml
+++ b/core-java-modules/core-java-io-conversions-2/pom.xml
@@ -8,12 +8,11 @@
0.1.0-SNAPSHOT
core-java-io-conversions-2
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
@@ -22,6 +21,11 @@
commons-lang3
${commons-lang3.version}
+
+ org.json
+ json
+ 20200518
+
diff --git a/core-java-modules/core-java-io-conversions-2/src/test/java/com/baeldung/bufferedreadertojsonobject/JavaBufferedReaderToJSONObjectUnitTest.java b/core-java-modules/core-java-io-conversions-2/src/test/java/com/baeldung/bufferedreadertojsonobject/JavaBufferedReaderToJSONObjectUnitTest.java
new file mode 100644
index 0000000000..80007e9c2f
--- /dev/null
+++ b/core-java-modules/core-java-io-conversions-2/src/test/java/com/baeldung/bufferedreadertojsonobject/JavaBufferedReaderToJSONObjectUnitTest.java
@@ -0,0 +1,48 @@
+package com.baeldung.bufferedreadertojsonobject;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
+
+import org.json.JSONObject;
+import org.json.JSONTokener;
+import org.junit.Test;
+
+public class JavaBufferedReaderToJSONObjectUnitTest {
+
+ @Test
+ public void givenValidJson_whenUsingBufferedReader_thenJSONTokenerConverts() {
+ byte[] b = "{ \"name\" : \"John\", \"age\" : 18 }".getBytes(StandardCharsets.UTF_8);
+ InputStream is = new ByteArrayInputStream(b);
+ BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(is));
+ JSONTokener tokener = new JSONTokener(bufferedReader);
+ JSONObject json = new JSONObject(tokener);
+
+ assertNotNull(json);
+ assertEquals("John", json.get("name"));
+ assertEquals(18, json.get("age"));
+ }
+
+ @Test
+ public void givenValidJson_whenUsingString_thenJSONObjectConverts() throws IOException {
+ byte[] b = "{ \"name\" : \"John\", \"age\" : 18 }".getBytes(StandardCharsets.UTF_8);
+ InputStream is = new ByteArrayInputStream(b);
+ BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(is));
+ StringBuilder sb = new StringBuilder();
+ String line;
+ while ((line = bufferedReader.readLine()) != null) {
+ sb.append(line);
+ }
+ JSONObject json = new JSONObject(sb.toString());
+
+ assertNotNull(json);
+ assertEquals("John", json.get("name"));
+ assertEquals(18, json.get("age"));
+ }
+}
diff --git a/core-java-modules/core-java-io-conversions/pom.xml b/core-java-modules/core-java-io-conversions/pom.xml
index f5ccaa45a3..0012b02d7e 100644
--- a/core-java-modules/core-java-io-conversions/pom.xml
+++ b/core-java-modules/core-java-io-conversions/pom.xml
@@ -8,12 +8,11 @@
0.1.0-SNAPSHOT
core-java-io-conversions
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-io/pom.xml b/core-java-modules/core-java-io/pom.xml
index 103a809f90..ccfb57e909 100644
--- a/core-java-modules/core-java-io/pom.xml
+++ b/core-java-modules/core-java-io/pom.xml
@@ -8,12 +8,11 @@
0.1.0-SNAPSHOT
core-java-io
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-jar/pom.xml b/core-java-modules/core-java-jar/pom.xml
index 1d87bcda5f..6e9d713d7c 100644
--- a/core-java-modules/core-java-jar/pom.xml
+++ b/core-java-modules/core-java-jar/pom.xml
@@ -8,12 +8,11 @@
0.1.0-SNAPSHOT
core-java-jar
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-jndi/pom.xml b/core-java-modules/core-java-jndi/pom.xml
index 4a491a1a47..030a5f5d50 100644
--- a/core-java-modules/core-java-jndi/pom.xml
+++ b/core-java-modules/core-java-jndi/pom.xml
@@ -12,7 +12,7 @@
com.baeldung.core-java-modules
core-java-modules
- 1.0.0-SNAPSHOT
+ 0.0.1-SNAPSHOT
diff --git a/core-java-modules/core-java-jpms/pom.xml b/core-java-modules/core-java-jpms/pom.xml
index 4610baab49..5809c0f579 100644
--- a/core-java-modules/core-java-jpms/pom.xml
+++ b/core-java-modules/core-java-jpms/pom.xml
@@ -12,7 +12,7 @@
com.baeldung.core-java-modules
core-java-modules
- 1.0.0-SNAPSHOT
+ 0.0.1-SNAPSHOT
diff --git a/core-java-modules/core-java-jvm/pom.xml b/core-java-modules/core-java-jvm/pom.xml
index edf7a4f3c5..f3e5470a61 100644
--- a/core-java-modules/core-java-jvm/pom.xml
+++ b/core-java-modules/core-java-jvm/pom.xml
@@ -10,10 +10,10 @@
jar
- com.baeldung
- parent-modules
- 1.0.0-SNAPSHOT
- ../../
+ com.baeldung.core-java-modules
+ core-java-modules
+ 0.0.1-SNAPSHOT
+ ../
diff --git a/core-java-modules/core-java-lambdas/pom.xml b/core-java-modules/core-java-lambdas/pom.xml
index 421ca2f394..318b04fcf5 100644
--- a/core-java-modules/core-java-lambdas/pom.xml
+++ b/core-java-modules/core-java-lambdas/pom.xml
@@ -8,12 +8,11 @@
0.1.0-SNAPSHOT
core-java-lambdas
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-lang-2/pom.xml b/core-java-modules/core-java-lang-2/pom.xml
index 21a63d8091..5f2d4ec901 100644
--- a/core-java-modules/core-java-lang-2/pom.xml
+++ b/core-java-modules/core-java-lang-2/pom.xml
@@ -8,12 +8,11 @@
0.1.0-SNAPSHOT
core-java-lang-2
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/inttoenum/PizzaStatus.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/inttoenum/PizzaStatus.java
new file mode 100644
index 0000000000..8d7c626521
--- /dev/null
+++ b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/inttoenum/PizzaStatus.java
@@ -0,0 +1,36 @@
+package com.baeldung.inttoenum;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum PizzaStatus {
+ ORDERED(5),
+ READY(2),
+ DELIVERED(0);
+
+ private int timeToDelivery;
+
+ PizzaStatus(int timeToDelivery) {
+ this.timeToDelivery = timeToDelivery;
+ }
+
+ public int getTimeToDelivery() {
+ return timeToDelivery;
+ }
+
+ private static Map timeToDeliveryToEnumValuesMapping = new HashMap<>();
+
+ static {
+ PizzaStatus[] pizzaStatuses = PizzaStatus.values();
+ for (int pizzaStatusIndex = 0; pizzaStatusIndex < pizzaStatuses.length; pizzaStatusIndex++) {
+ timeToDeliveryToEnumValuesMapping.put(
+ pizzaStatuses[pizzaStatusIndex].getTimeToDelivery(),
+ pizzaStatuses[pizzaStatusIndex]
+ );
+ }
+ }
+
+ public static PizzaStatus castIntToEnum(int timeToDelivery) {
+ return timeToDeliveryToEnumValuesMapping.get(timeToDelivery);
+ }
+}
\ No newline at end of file
diff --git a/core-java-modules/core-java-lang-2/src/test/java/com/baeldung/inttoenum/IntToEnumUnitTest.java b/core-java-modules/core-java-lang-2/src/test/java/com/baeldung/inttoenum/IntToEnumUnitTest.java
new file mode 100644
index 0000000000..876c230827
--- /dev/null
+++ b/core-java-modules/core-java-lang-2/src/test/java/com/baeldung/inttoenum/IntToEnumUnitTest.java
@@ -0,0 +1,27 @@
+package com.baeldung.inttoenum;
+
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class IntToEnumUnitTest {
+
+ @Test
+ public void whenIntToEnumUsingValuesMethod_thenReturnEnumObject() {
+ int timeToDeliveryForOrderedPizzaStatus = 5;
+ PizzaStatus[] pizzaStatuses = PizzaStatus.values();
+ PizzaStatus pizzaOrderedStatus = null;
+ for (int pizzaStatusIndex = 0; pizzaStatusIndex < pizzaStatuses.length; pizzaStatusIndex++) {
+ if (pizzaStatuses[pizzaStatusIndex].getTimeToDelivery() == timeToDeliveryForOrderedPizzaStatus) {
+ pizzaOrderedStatus = pizzaStatuses[pizzaStatusIndex];
+ }
+ }
+ assertEquals(pizzaOrderedStatus, PizzaStatus.ORDERED);
+ }
+
+ @Test
+ public void whenIntToEnumUsingMap_thenReturnEnumObject() {
+ int timeToDeliveryForOrderedPizzaStatus = 5;
+ assertEquals(PizzaStatus.castIntToEnum(timeToDeliveryForOrderedPizzaStatus), PizzaStatus.ORDERED);
+ }
+}
\ No newline at end of file
diff --git a/core-java-modules/core-java-lang-math-2/pom.xml b/core-java-modules/core-java-lang-math-2/pom.xml
index 92ebcc6a94..e2cced4fbf 100644
--- a/core-java-modules/core-java-lang-math-2/pom.xml
+++ b/core-java-modules/core-java-lang-math-2/pom.xml
@@ -5,12 +5,11 @@
core-java-lang-math-2
0.0.1-SNAPSHOT
core-java-lang-math-2
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-lang-math/pom.xml b/core-java-modules/core-java-lang-math/pom.xml
index bcb5cf39d2..81ff0d43ea 100644
--- a/core-java-modules/core-java-lang-math/pom.xml
+++ b/core-java-modules/core-java-lang-math/pom.xml
@@ -8,12 +8,11 @@
0.1.0-SNAPSHOT
core-java-lang-math
jar
-
- com.baeldung
- parent-java
+ com.baeldung.core-java-modules
+ core-java-modules
0.0.1-SNAPSHOT
- ../../parent-java
+ ../
diff --git a/core-java-modules/core-java-lang-oop-constructors/pom.xml b/core-java-modules/core-java-lang-oop-constructors/pom.xml
index 76507103ea..e54286a822 100644
--- a/core-java-modules/core-java-lang-oop-constructors/pom.xml
+++ b/core-java-modules/core-java-lang-oop-constructors/pom.xml
@@ -5,7 +5,7 @@
core-java-modules
com.baeldung.core-java-modules
- 1.0.0-SNAPSHOT
+ 0.0.1-SNAPSHOT
4.0.0
diff --git a/core-java-modules/core-java-lang-oop-generics/pom.xml b/core-java-modules/core-java-lang-oop-generics/pom.xml
index ae141ecda2..65a0aeac59 100644
--- a/core-java-modules/core-java-lang-oop-generics/pom.xml
+++ b/core-java-modules/core-java-lang-oop-generics/pom.xml
@@ -5,7 +5,7 @@
core-java-modules
com.baeldung.core-java-modules
- 1.0.0-SNAPSHOT
+ 0.0.1-SNAPSHOT
4.0.0
diff --git a/core-java-modules/core-java-lang-oop-generics/src/main/java/com/baeldung/supertype/TypeReference.java b/core-java-modules/core-java-lang-oop-generics/src/main/java/com/baeldung/supertype/TypeReference.java
new file mode 100644
index 0000000000..2021f42239
--- /dev/null
+++ b/core-java-modules/core-java-lang-oop-generics/src/main/java/com/baeldung/supertype/TypeReference.java
@@ -0,0 +1,18 @@
+package com.baeldung.supertype;
+
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+
+public abstract class TypeReference {
+
+ private final Type type;
+
+ public TypeReference() {
+ Type superclass = getClass().getGenericSuperclass();
+ type = ((ParameterizedType) superclass).getActualTypeArguments()[0];
+ }
+
+ public Type getType() {
+ return type;
+ }
+}
diff --git a/core-java-modules/core-java-lang-oop-generics/src/test/java/com/baeldung/supertype/TypeReferenceUnitTest.java b/core-java-modules/core-java-lang-oop-generics/src/test/java/com/baeldung/supertype/TypeReferenceUnitTest.java
new file mode 100644
index 0000000000..24e3b698e2
--- /dev/null
+++ b/core-java-modules/core-java-lang-oop-generics/src/test/java/com/baeldung/supertype/TypeReferenceUnitTest.java
@@ -0,0 +1,24 @@
+package com.baeldung.supertype;
+
+import org.junit.Test;
+
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.Map;
+
+import static org.junit.Assert.assertEquals;
+
+public class TypeReferenceUnitTest {
+
+ @Test
+ public void givenGenericToken_whenUsingSuperTypeToken_thenPreservesTheTypeInfo() {
+ TypeReference
@@ -60,4 +82,4 @@
2.2.2.RELEASE
-
\ No newline at end of file
+
diff --git a/spring-core-4/src/main/java/com/baeldung/postprocessor/GlobalEventBus.java b/spring-core-4/src/main/java/com/baeldung/postprocessor/GlobalEventBus.java
new file mode 100644
index 0000000000..8b95ea7c6f
--- /dev/null
+++ b/spring-core-4/src/main/java/com/baeldung/postprocessor/GlobalEventBus.java
@@ -0,0 +1,39 @@
+package com.baeldung.postprocessor;
+
+import com.google.common.eventbus.AsyncEventBus;
+import com.google.common.eventbus.EventBus;
+
+import java.util.concurrent.Executors;
+
+@SuppressWarnings("ALL")
+public final class GlobalEventBus {
+
+ public static final String GLOBAL_EVENT_BUS_EXPRESSION = "T(com.baeldung.postprocessor.GlobalEventBus).getEventBus()";
+
+ private static final String IDENTIFIER = "global-event-bus";
+
+ private static final GlobalEventBus GLOBAL_EVENT_BUS = new GlobalEventBus();
+
+ private final EventBus eventBus = new AsyncEventBus(IDENTIFIER, Executors.newCachedThreadPool());
+
+ private GlobalEventBus() {
+ }
+
+ public static GlobalEventBus getInstance() {
+ return GlobalEventBus.GLOBAL_EVENT_BUS;
+ }
+
+ public static EventBus getEventBus() {
+ return GlobalEventBus.GLOBAL_EVENT_BUS.eventBus;
+ }
+
+ public static void subscribe(Object obj) {
+ getEventBus().register(obj);
+ }
+ public static void unsubscribe(Object obj) {
+ getEventBus().unregister(obj);
+ }
+ public static void post(Object event) {
+ getEventBus().post(event);
+ }
+}
diff --git a/spring-core-4/src/main/java/com/baeldung/postprocessor/GuavaEventBusBeanFactoryPostProcessor.java b/spring-core-4/src/main/java/com/baeldung/postprocessor/GuavaEventBusBeanFactoryPostProcessor.java
new file mode 100644
index 0000000000..fba31fde6a
--- /dev/null
+++ b/spring-core-4/src/main/java/com/baeldung/postprocessor/GuavaEventBusBeanFactoryPostProcessor.java
@@ -0,0 +1,63 @@
+package com.baeldung.postprocessor;
+
+import com.google.common.eventbus.EventBus;
+
+import java.util.Iterator;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.aop.framework.Advised;
+import org.springframework.aop.support.AopUtils;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.FatalBeanException;
+import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
+import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.core.annotation.AnnotationUtils;
+import org.springframework.expression.Expression;
+import org.springframework.expression.ExpressionException;
+import org.springframework.expression.spel.standard.SpelExpressionParser;
+
+@SuppressWarnings("ALL")
+public class GuavaEventBusBeanFactoryPostProcessor implements BeanFactoryPostProcessor {
+
+ private final Logger logger = LoggerFactory.getLogger(this.getClass());
+ private final SpelExpressionParser expressionParser = new SpelExpressionParser();
+
+ @Override
+ public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
+ for (Iterator names = beanFactory.getBeanNamesIterator(); names.hasNext(); ) {
+ Object proxy = this.getTargetObject(beanFactory.getBean(names.next()));
+ final Subscriber annotation = AnnotationUtils.getAnnotation(proxy.getClass(), Subscriber.class);
+ if (annotation == null)
+ continue;
+ this.logger.info("{}: processing bean of type {} during initialization", this.getClass().getSimpleName(),
+ proxy.getClass().getName());
+ final String annotationValue = annotation.value();
+ try {
+ final Expression expression = this.expressionParser.parseExpression(annotationValue);
+ final Object value = expression.getValue();
+ if (!(value instanceof EventBus)) {
+ this.logger.error("{}: expression {} did not evaluate to an instance of EventBus for bean of type {}",
+ this.getClass().getSimpleName(), annotationValue, proxy.getClass().getSimpleName());
+ return;
+ }
+ final EventBus eventBus = (EventBus)value;
+ eventBus.register(proxy);
+ } catch (ExpressionException ex) {
+ this.logger.error("{}: unable to parse/evaluate expression {} for bean of type {}", this.getClass().getSimpleName(),
+ annotationValue, proxy.getClass().getName());
+ }
+ }
+ }
+
+ private Object getTargetObject(Object proxy) throws BeansException {
+ if (AopUtils.isJdkDynamicProxy(proxy)) {
+ try {
+ return ((Advised)proxy).getTargetSource().getTarget();
+ } catch (Exception e) {
+ throw new FatalBeanException("Error getting target of JDK proxy", e);
+ }
+ }
+ return proxy;
+ }
+}
diff --git a/spring-core-4/src/main/java/com/baeldung/postprocessor/GuavaEventBusBeanPostProcessor.java b/spring-core-4/src/main/java/com/baeldung/postprocessor/GuavaEventBusBeanPostProcessor.java
new file mode 100644
index 0000000000..677c839444
--- /dev/null
+++ b/spring-core-4/src/main/java/com/baeldung/postprocessor/GuavaEventBusBeanPostProcessor.java
@@ -0,0 +1,87 @@
+package com.baeldung.postprocessor;
+
+import com.google.common.eventbus.EventBus;
+
+import java.util.function.BiConsumer;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.aop.framework.Advised;
+import org.springframework.aop.support.AopUtils;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.FatalBeanException;
+import org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor;
+import org.springframework.core.annotation.AnnotationUtils;
+import org.springframework.expression.Expression;
+import org.springframework.expression.ExpressionException;
+import org.springframework.expression.spel.standard.SpelExpressionParser;
+
+/**
+ * A {@link DestructionAwareBeanPostProcessor} which registers/un-registers subscribers to a Guava {@link EventBus}. The class must
+ * be annotated with {@link Subscriber} and each subscribing method must be annotated with
+ * {@link com.google.common.eventbus.Subscribe}.
+ */
+@SuppressWarnings("ALL")
+public class GuavaEventBusBeanPostProcessor implements DestructionAwareBeanPostProcessor {
+
+ private final Logger logger = LoggerFactory.getLogger(this.getClass());
+ private final SpelExpressionParser expressionParser = new SpelExpressionParser();
+
+ @Override
+ public void postProcessBeforeDestruction(final Object bean, final String beanName) throws BeansException {
+ this.process(bean, EventBus::unregister, "destruction");
+ }
+
+ @Override
+ public boolean requiresDestruction(Object bean) {
+ return true;
+ }
+
+ @Override
+ public Object postProcessBeforeInitialization(final Object bean, final String beanName) throws BeansException {
+ return bean;
+ }
+
+ @Override
+ public Object postProcessAfterInitialization(final Object bean, final String beanName) throws BeansException {
+ this.process(bean, EventBus::register, "initialization");
+ return bean;
+ }
+
+ private void process(final Object bean, final BiConsumer consumer, final String action) {
+ Object proxy = this.getTargetObject(bean);
+ final Subscriber annotation = AnnotationUtils.getAnnotation(proxy.getClass(), Subscriber.class);
+ if (annotation == null)
+ return;
+ this.logger.info("{}: processing bean of type {} during {}", this.getClass().getSimpleName(), proxy.getClass().getName(),
+ action);
+ final String annotationValue = annotation.value();
+ try {
+ final Expression expression = this.expressionParser.parseExpression(annotationValue);
+ final Object value = expression.getValue();
+ if (!(value instanceof EventBus)) {
+ this.logger.error("{}: expression {} did not evaluate to an instance of EventBus for bean of type {}",
+ this.getClass().getSimpleName(), annotationValue, proxy.getClass().getSimpleName());
+ return;
+ }
+ final EventBus eventBus = (EventBus)value;
+ consumer.accept(eventBus, proxy);
+ } catch (ExpressionException ex) {
+ this.logger.error("{}: unable to parse/evaluate expression {} for bean of type {}", this.getClass().getSimpleName(),
+ annotationValue, proxy.getClass().getName());
+ }
+ }
+
+ private Object getTargetObject(Object proxy) throws BeansException {
+ if (AopUtils.isJdkDynamicProxy(proxy)) {
+ try {
+ return ((Advised)proxy).getTargetSource().getTarget();
+ } catch (Exception e) {
+ throw new FatalBeanException("Error getting target of JDK proxy", e);
+ }
+ }
+ return proxy;
+ }
+}
+
+
diff --git a/spring-core-4/src/main/java/com/baeldung/postprocessor/StockTrade.java b/spring-core-4/src/main/java/com/baeldung/postprocessor/StockTrade.java
new file mode 100644
index 0000000000..7711cf7101
--- /dev/null
+++ b/spring-core-4/src/main/java/com/baeldung/postprocessor/StockTrade.java
@@ -0,0 +1,34 @@
+package com.baeldung.postprocessor;
+
+import java.util.Date;
+
+public class StockTrade {
+
+ private final String symbol;
+ private final int quantity;
+ private final double price;
+ private final Date tradeDate;
+
+ public StockTrade(String symbol, int quantity, double price, Date tradeDate) {
+ this.symbol = symbol;
+ this.quantity = quantity;
+ this.price = price;
+ this.tradeDate = tradeDate;
+ }
+
+ public String getSymbol() {
+ return this.symbol;
+ }
+
+ public int getQuantity() {
+ return this.quantity;
+ }
+
+ public double getPrice() {
+ return this.price;
+ }
+
+ public Date getTradeDate() {
+ return this.tradeDate;
+ }
+}
diff --git a/spring-core-4/src/main/java/com/baeldung/postprocessor/StockTradeListener.java b/spring-core-4/src/main/java/com/baeldung/postprocessor/StockTradeListener.java
new file mode 100644
index 0000000000..bf34d66f24
--- /dev/null
+++ b/spring-core-4/src/main/java/com/baeldung/postprocessor/StockTradeListener.java
@@ -0,0 +1,7 @@
+package com.baeldung.postprocessor;
+
+@FunctionalInterface
+public interface StockTradeListener {
+
+ void stockTradePublished(StockTrade trade);
+}
diff --git a/spring-core-4/src/main/java/com/baeldung/postprocessor/StockTradePublisher.java b/spring-core-4/src/main/java/com/baeldung/postprocessor/StockTradePublisher.java
new file mode 100644
index 0000000000..bf339872d9
--- /dev/null
+++ b/spring-core-4/src/main/java/com/baeldung/postprocessor/StockTradePublisher.java
@@ -0,0 +1,36 @@
+package com.baeldung.postprocessor;
+
+import com.google.common.eventbus.AllowConcurrentEvents;
+import com.google.common.eventbus.Subscribe;
+
+import java.util.HashSet;
+import java.util.Set;
+
+@Subscriber
+public class StockTradePublisher {
+
+ private final Set stockTradeListeners = new HashSet<>();
+
+ public void addStockTradeListener(StockTradeListener listener) {
+ synchronized (this.stockTradeListeners) {
+ this.stockTradeListeners.add(listener);
+ }
+ }
+
+ public void removeStockTradeListener(StockTradeListener listener) {
+ synchronized (this.stockTradeListeners) {
+ this.stockTradeListeners.remove(listener);
+ }
+ }
+
+ @Subscribe
+ @AllowConcurrentEvents
+ private void handleNewStockTradeEvent(StockTrade trade) {
+ // publish to DB, send to PubNub, whatever you want here
+ final Set listeners;
+ synchronized (this.stockTradeListeners) {
+ listeners = new HashSet<>(this.stockTradeListeners);
+ }
+ listeners.forEach(li -> li.stockTradePublished(trade));
+ }
+}
diff --git a/spring-core-4/src/main/java/com/baeldung/postprocessor/Subscriber.java b/spring-core-4/src/main/java/com/baeldung/postprocessor/Subscriber.java
new file mode 100644
index 0000000000..bef38333d6
--- /dev/null
+++ b/spring-core-4/src/main/java/com/baeldung/postprocessor/Subscriber.java
@@ -0,0 +1,21 @@
+package com.baeldung.postprocessor;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * An annotation which indicates which Guava {@link com.google.common.eventbus.EventBus} a Spring bean wishes to subscribe to.
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+@Inherited
+public @interface Subscriber {
+
+ /**
+ * A SpEL expression which selects the {@link com.google.common.eventbus.EventBus}.
+ */
+ String value() default GlobalEventBus.GLOBAL_EVENT_BUS_EXPRESSION;
+}
diff --git a/spring-core-4/src/test/java/com/baeldung/postprocessor/PostProcessorConfiguration.java b/spring-core-4/src/test/java/com/baeldung/postprocessor/PostProcessorConfiguration.java
new file mode 100644
index 0000000000..b28e36663a
--- /dev/null
+++ b/spring-core-4/src/test/java/com/baeldung/postprocessor/PostProcessorConfiguration.java
@@ -0,0 +1,23 @@
+package com.baeldung.postprocessor;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class PostProcessorConfiguration {
+
+ @Bean
+ public GlobalEventBus eventBus() {
+ return GlobalEventBus.getInstance();
+ }
+
+ @Bean
+ public GuavaEventBusBeanPostProcessor eventBusBeanPostProcessor() {
+ return new GuavaEventBusBeanPostProcessor();
+ }
+
+ @Bean
+ public StockTradePublisher stockTradePublisher() {
+ return new StockTradePublisher();
+ }
+}
diff --git a/spring-core-4/src/test/java/com/baeldung/postprocessor/StockTradeIntegrationTest.java b/spring-core-4/src/test/java/com/baeldung/postprocessor/StockTradeIntegrationTest.java
new file mode 100644
index 0000000000..ae3cd968dc
--- /dev/null
+++ b/spring-core-4/src/test/java/com/baeldung/postprocessor/StockTradeIntegrationTest.java
@@ -0,0 +1,46 @@
+package com.baeldung.postprocessor;
+
+import java.time.Duration;
+import java.util.Date;
+import java.util.Objects;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.awaitility.Awaitility.await;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration(classes = {PostProcessorConfiguration.class})
+public class StockTradeIntegrationTest {
+
+ @Autowired
+ private StockTradePublisher stockTradePublisher;
+
+ @Test
+ public void givenValidConfig_whenTradePublished_thenTradeReceived() {
+ Date tradeDate = new Date();
+ StockTrade stockTrade = new StockTrade("AMZN", 100, 2483.52d, tradeDate);
+ AtomicBoolean assertionsPassed = new AtomicBoolean(false);
+ StockTradeListener listener = trade -> assertionsPassed.set(this.verifyExact(stockTrade, trade));
+ this.stockTradePublisher.addStockTradeListener(listener);
+ try {
+ GlobalEventBus.post(stockTrade);
+ await().atMost(Duration.ofSeconds(2L))
+ .untilAsserted(() -> assertThat(assertionsPassed.get()).isTrue());
+ } finally {
+ this.stockTradePublisher.removeStockTradeListener(listener);
+ }
+ }
+
+ private boolean verifyExact(StockTrade stockTrade, StockTrade trade) {
+ return Objects.equals(stockTrade.getSymbol(), trade.getSymbol())
+ && Objects.equals(stockTrade.getTradeDate(), trade.getTradeDate())
+ && stockTrade.getQuantity() == trade.getQuantity()
+ && stockTrade.getPrice() == trade.getPrice();
+ }
+}
diff --git a/spring-mvc-webflow/pom.xml b/spring-mvc-webflow/pom.xml
index 5a6856385c..22ae3c913d 100644
--- a/spring-mvc-webflow/pom.xml
+++ b/spring-mvc-webflow/pom.xml
@@ -72,6 +72,24 @@
+
+ org.apache.tomee.maven
+ tomee-maven-plugin
+ 8.0.1
+
+ 8080
+ spring-mvc-webflow
+ true
+ plume
+
+
+ .class
+
+
+ -Xmx2048m -XX:PermSize=256m -Dtomee.serialization.class.blacklist=- -Dtomee.serialization.class.whitelist=*
+ true
+
+
org.apache.maven.plugins
maven-war-plugin
diff --git a/spring-security-modules/pom.xml b/spring-security-modules/pom.xml
index 7ce33dd3e3..60a662781f 100644
--- a/spring-security-modules/pom.xml
+++ b/spring-security-modules/pom.xml
@@ -15,6 +15,7 @@
spring-security-acl
+ spring-security-auth0
spring-security-angular/server
spring-security-cache-control
spring-security-core
diff --git a/spring-security-modules/spring-security-auth0/pom.xml b/spring-security-modules/spring-security-auth0/pom.xml
new file mode 100644
index 0000000000..0bd879a40b
--- /dev/null
+++ b/spring-security-modules/spring-security-auth0/pom.xml
@@ -0,0 +1,75 @@
+
+
+ 4.0.0
+ spring-security-auth0
+ 1.0-SNAPSHOT
+ spring-security-auth0
+ war
+
+
+ com.baeldung
+ parent-boot-2
+ 0.0.1-SNAPSHOT
+ ../../parent-boot-2
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ org.springframework.boot
+ spring-boot-starter-security
+
+
+ org.springframework.security
+ spring-security-core
+
+
+ org.springframework.security
+ spring-security-oauth2-resource-server
+
+
+ com.auth0
+ mvc-auth-commons
+ ${mvc-auth-commons.version}
+
+
+ org.json
+ json
+ ${json.version}
+
+
+
+
+ spring-security-auth0
+
+
+ src/main/resources
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+ true
+
+
+
+
+ repackage
+
+
+
+
+
+
+
+
+ 20190722
+ 1.2.0
+
+
\ No newline at end of file
diff --git a/spring-security-modules/spring-security-auth0/src/main/java/com/baeldung/auth0/Application.java b/spring-security-modules/spring-security-auth0/src/main/java/com/baeldung/auth0/Application.java
new file mode 100644
index 0000000000..42f8d946b5
--- /dev/null
+++ b/spring-security-modules/spring-security-auth0/src/main/java/com/baeldung/auth0/Application.java
@@ -0,0 +1,13 @@
+package com.baeldung.auth0;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class Application {
+
+ public static void main(String[] args) {
+ SpringApplication.run(Application.class, args);
+ }
+
+}
diff --git a/spring-security-modules/spring-security-auth0/src/main/java/com/baeldung/auth0/AuthConfig.java b/spring-security-modules/spring-security-auth0/src/main/java/com/baeldung/auth0/AuthConfig.java
new file mode 100644
index 0000000000..69cf8b3071
--- /dev/null
+++ b/spring-security-modules/spring-security-auth0/src/main/java/com/baeldung/auth0/AuthConfig.java
@@ -0,0 +1,114 @@
+package com.baeldung.auth0;
+
+import java.io.UnsupportedEncodingException;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
+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;
+import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;
+
+import com.auth0.AuthenticationController;
+import com.baeldung.auth0.controller.LogoutController;
+import com.auth0.jwk.JwkProvider;
+import com.auth0.jwk.JwkProviderBuilder;
+
+@Configuration
+@EnableWebSecurity
+public class AuthConfig extends WebSecurityConfigurerAdapter {
+
+ @Value(value = "${com.auth0.domain}")
+ private String domain;
+
+ @Value(value = "${com.auth0.clientId}")
+ private String clientId;
+
+ @Value(value = "${com.auth0.clientSecret}")
+ private String clientSecret;
+
+ @Value(value = "${com.auth0.managementApi.clientId}")
+ private String managementApiClientId;
+
+ @Value(value = "${com.auth0.managementApi.clientSecret}")
+ private String managementApiClientSecret;
+
+ @Value(value = "${com.auth0.managementApi.grantType}")
+ private String grantType;
+
+ @Bean
+ public LogoutSuccessHandler logoutSuccessHandler() {
+ return new LogoutController();
+ }
+
+ @Bean
+ public AuthenticationController authenticationController() throws UnsupportedEncodingException {
+ JwkProvider jwkProvider = new JwkProviderBuilder(domain).build();
+ return AuthenticationController.newBuilder(domain, clientId, clientSecret)
+ .withJwkProvider(jwkProvider)
+ .build();
+ }
+
+ @Override
+ protected void configure(HttpSecurity http) throws Exception {
+ http.csrf().disable();
+ http
+ .authorizeRequests()
+ .antMatchers("/callback", "/login", "/").permitAll()
+ .anyRequest().authenticated()
+ .and()
+ .formLogin()
+ .loginPage("/login")
+ .and()
+ .logout().logoutSuccessHandler(logoutSuccessHandler()).permitAll();
+ }
+
+ public String getDomain() {
+ return domain;
+ }
+
+ public String getClientId() {
+ return clientId;
+ }
+
+ public String getClientSecret() {
+ return clientSecret;
+ }
+
+ public String getManagementApiClientId() {
+ return managementApiClientId;
+ }
+
+ public String getManagementApiClientSecret() {
+ return managementApiClientSecret;
+ }
+
+ public String getGrantType() {
+ return grantType;
+ }
+
+ public String getUserInfoUrl() {
+ return "https://" + getDomain() + "/userinfo";
+ }
+
+ public String getUsersUrl() {
+ return "https://" + getDomain() + "/api/v2/users";
+ }
+
+ public String getUsersByEmailUrl() {
+ return "https://" + getDomain() + "/api/v2/users-by-email?email=";
+ }
+
+ public String getLogoutUrl() {
+ return "https://" + getDomain() +"/v2/logout";
+ }
+
+ public String getContextPath(HttpServletRequest request) {
+ String path = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort();
+ return path;
+ }
+}
diff --git a/spring-security-modules/spring-security-auth0/src/main/java/com/baeldung/auth0/controller/AuthController.java b/spring-security-modules/spring-security-auth0/src/main/java/com/baeldung/auth0/controller/AuthController.java
new file mode 100644
index 0000000000..48d09db155
--- /dev/null
+++ b/spring-security-modules/spring-security-auth0/src/main/java/com/baeldung/auth0/controller/AuthController.java
@@ -0,0 +1,77 @@
+package com.baeldung.auth0.controller;
+
+import java.io.IOException;
+import java.util.HashMap;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.json.JSONObject;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.security.authentication.TestingAuthenticationToken;
+import org.springframework.security.core.context.SecurityContextHolder;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.client.RestTemplate;
+
+import com.auth0.AuthenticationController;
+import com.auth0.IdentityVerificationException;
+import com.auth0.Tokens;
+import com.auth0.jwt.JWT;
+import com.auth0.jwt.interfaces.DecodedJWT;
+import com.baeldung.auth0.AuthConfig;
+
+@Controller
+public class AuthController {
+
+ @Autowired
+ private AuthenticationController authenticationController;
+
+ @Autowired
+ private AuthConfig config;
+
+ private static final String AUTH0_TOKEN_URL = "https://dev-example.auth0.com/oauth/token";
+
+ @GetMapping(value = "/login")
+ protected void login(HttpServletRequest request, HttpServletResponse response) throws IOException {
+ String redirectUri = config.getContextPath(request) + "/callback";
+ String authorizeUrl = authenticationController.buildAuthorizeUrl(request, response, redirectUri)
+ .withScope("openid email")
+ .build();
+ response.sendRedirect(authorizeUrl);
+ }
+
+ @GetMapping(value="/callback")
+ public void callback(HttpServletRequest request, HttpServletResponse response) throws IOException, IdentityVerificationException {
+ Tokens tokens = authenticationController.handle(request, response);
+
+ DecodedJWT jwt = JWT.decode(tokens.getIdToken());
+ TestingAuthenticationToken authToken2 = new TestingAuthenticationToken(jwt.getSubject(), jwt.getToken());
+ authToken2.setAuthenticated(true);
+
+ SecurityContextHolder.getContext().setAuthentication(authToken2);
+ response.sendRedirect(config.getContextPath(request) + "/");
+ }
+
+ public String getManagementApiToken() {
+ HttpHeaders headers = new HttpHeaders();
+ headers.setContentType(MediaType.APPLICATION_JSON);
+
+ JSONObject requestBody = new JSONObject();
+ requestBody.put("client_id", config.getManagementApiClientId());
+ requestBody.put("client_secret", config.getManagementApiClientSecret());
+ requestBody.put("audience", "https://dev-example.auth0.com/api/v2/");
+ requestBody.put("grant_type", config.getGrantType());
+
+ HttpEntity request = new HttpEntity(requestBody.toString(), headers);
+
+ RestTemplate restTemplate = new RestTemplate();
+ HashMap result = restTemplate.postForObject(AUTH0_TOKEN_URL, request, HashMap.class);
+
+ return result.get("access_token");
+ }
+
+}
diff --git a/spring-security-modules/spring-security-auth0/src/main/java/com/baeldung/auth0/controller/HomeController.java b/spring-security-modules/spring-security-auth0/src/main/java/com/baeldung/auth0/controller/HomeController.java
new file mode 100644
index 0000000000..8a4e650846
--- /dev/null
+++ b/spring-security-modules/spring-security-auth0/src/main/java/com/baeldung/auth0/controller/HomeController.java
@@ -0,0 +1,37 @@
+package com.baeldung.auth0.controller;
+
+import java.io.IOException;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.security.authentication.TestingAuthenticationToken;
+import org.springframework.security.core.Authentication;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.auth0.jwt.JWT;
+import com.auth0.jwt.interfaces.DecodedJWT;
+
+@Controller
+public class HomeController {
+
+ @GetMapping(value = "/")
+ @ResponseBody
+ public String home(HttpServletRequest request, HttpServletResponse response, final Authentication authentication) throws IOException {
+
+ if (authentication!= null && authentication instanceof TestingAuthenticationToken) {
+ TestingAuthenticationToken token = (TestingAuthenticationToken) authentication;
+
+ DecodedJWT jwt = JWT.decode(token.getCredentials().toString());
+ String email = jwt.getClaims().get("email").asString();
+
+ return "Welcome, " + email + "!";
+ } else {
+ response.sendRedirect("http://localhost:8080/login");
+ return null;
+ }
+ }
+
+}
diff --git a/spring-security-modules/spring-security-auth0/src/main/java/com/baeldung/auth0/controller/LogoutController.java b/spring-security-modules/spring-security-auth0/src/main/java/com/baeldung/auth0/controller/LogoutController.java
new file mode 100755
index 0000000000..d508fe2c44
--- /dev/null
+++ b/spring-security-modules/spring-security-auth0/src/main/java/com/baeldung/auth0/controller/LogoutController.java
@@ -0,0 +1,35 @@
+package com.baeldung.auth0.controller;
+
+import java.io.IOException;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;
+import org.springframework.stereotype.Controller;
+
+import com.baeldung.auth0.AuthConfig;
+
+@Controller
+public class LogoutController implements LogoutSuccessHandler {
+
+ @Autowired
+ private AuthConfig config;
+
+ @Override
+ public void onLogoutSuccess(HttpServletRequest req, HttpServletResponse res, Authentication authentication) {
+ if (req.getSession() != null) {
+ req.getSession().invalidate();
+ }
+ String returnTo = config.getContextPath(req);
+ String logoutUrl = config.getLogoutUrl() + "?client_id=" + config.getClientId() + "&returnTo=" +returnTo;
+ try {
+ res.sendRedirect(logoutUrl);
+ } catch(IOException e){
+ e.printStackTrace();
+ }
+ }
+
+}
diff --git a/spring-security-modules/spring-security-auth0/src/main/java/com/baeldung/auth0/controller/UserController.java b/spring-security-modules/spring-security-auth0/src/main/java/com/baeldung/auth0/controller/UserController.java
new file mode 100644
index 0000000000..86601a06d3
--- /dev/null
+++ b/spring-security-modules/spring-security-auth0/src/main/java/com/baeldung/auth0/controller/UserController.java
@@ -0,0 +1,57 @@
+package com.baeldung.auth0.controller;
+
+import java.io.IOException;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.json.JSONObject;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.auth0.IdentityVerificationException;
+import com.baeldung.auth0.AuthConfig;
+import com.baeldung.auth0.service.ApiService;
+
+@Controller
+public class UserController {
+
+ @Autowired
+ private ApiService apiService;
+
+ @Autowired
+ private AuthConfig config;
+
+ @GetMapping(value="/users")
+ @ResponseBody
+ public ResponseEntity users(HttpServletRequest request, HttpServletResponse response) throws IOException, IdentityVerificationException {
+ ResponseEntity result = apiService.getCall(config.getUsersUrl());
+ return result;
+ }
+
+ @GetMapping(value = "/userByEmail")
+ @ResponseBody
+ public ResponseEntity userByEmail(HttpServletResponse response, @RequestParam String email) {
+ ResponseEntity result = apiService.getCall(config.getUsersByEmailUrl()+email);
+ return result;
+ }
+
+ @GetMapping(value = "/createUser")
+ @ResponseBody
+ public ResponseEntity createUser(HttpServletResponse response) {
+ JSONObject request = new JSONObject();
+ request.put("email", "norman.lewis@email.com");
+ request.put("given_name", "Norman");
+ request.put("family_name", "Lewis");
+ request.put("connection", "Username-Password-Authentication");
+ request.put("password", "Pa33w0rd");
+
+ ResponseEntity result = apiService.postCall(config.getUsersUrl(), request.toString());
+ return result;
+ }
+
+}
diff --git a/spring-security-modules/spring-security-auth0/src/main/java/com/baeldung/auth0/service/ApiService.java b/spring-security-modules/spring-security-auth0/src/main/java/com/baeldung/auth0/service/ApiService.java
new file mode 100644
index 0000000000..0d8263ae19
--- /dev/null
+++ b/spring-security-modules/spring-security-auth0/src/main/java/com/baeldung/auth0/service/ApiService.java
@@ -0,0 +1,44 @@
+package com.baeldung.auth0.service;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+import org.springframework.web.client.RestTemplate;
+
+import com.baeldung.auth0.controller.AuthController;
+
+@Service
+public class ApiService {
+
+ @Autowired
+ private AuthController controller;
+
+ public ResponseEntity getCall(String url) {
+ HttpHeaders headers = new HttpHeaders();
+ headers.setContentType(MediaType.APPLICATION_JSON);
+ headers.set("Authorization", "Bearer "+controller.getManagementApiToken());
+
+ HttpEntity entity = new HttpEntity(headers);
+ RestTemplate restTemplate = new RestTemplate();
+ ResponseEntity result = restTemplate.exchange(url, HttpMethod.GET, entity, String.class);
+
+ return result;
+ }
+
+ public ResponseEntity postCall(String url, String requestBody) {
+ HttpHeaders headers = new HttpHeaders();
+ headers.setContentType(MediaType.APPLICATION_JSON);
+ headers.set("Authorization", "Bearer "+controller.getManagementApiToken());
+
+ HttpEntity request = new HttpEntity(requestBody, headers);
+ RestTemplate restTemplate = new RestTemplate();
+ ResponseEntity result = restTemplate.postForEntity(url, request, String.class);
+
+ return result;
+ }
+
+}
diff --git a/spring-security-modules/spring-security-auth0/src/main/resources/application.properties b/spring-security-modules/spring-security-auth0/src/main/resources/application.properties
new file mode 100644
index 0000000000..45492c5c00
--- /dev/null
+++ b/spring-security-modules/spring-security-auth0/src/main/resources/application.properties
@@ -0,0 +1,7 @@
+com.auth0.domain: dev-example.auth0.com
+com.auth0.clientId: exampleClientId
+com.auth0.clientSecret: exampleClientSecret
+
+com.auth0.managementApi.clientId: exampleManagementApiClientId
+com.auth0.managementApi.clientSecret: exampleManagementApiClientSecret
+com.auth0.managementApi.grantType: client_credentials
\ No newline at end of file
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 7ad18376ec..b00b7bab32 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/pom.xml
+++ b/spring-security-modules/spring-security-mvc-boot-1/pom.xml
@@ -106,6 +106,10 @@
${ehcache-core.version}
jar
+
+ net.bytebuddy
+ byte-buddy
+
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/VoterApplication.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/VoterApplication.java
index d3e0652ae9..148f9c17b1 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/VoterApplication.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/VoterApplication.java
@@ -7,7 +7,7 @@ import org.springframework.context.annotation.Configuration;
@Configuration
@EnableAutoConfiguration
-@ComponentScan(basePackages = {"com.baeldung.voter"})
+@ComponentScan(basePackages = {"com.baeldung.roles.voter"})
public class VoterApplication {
public static void main(String[] args) {
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/VoterMvcConfig.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/VoterMvcConfig.java
index f11a4ae06c..402065129f 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/VoterMvcConfig.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/VoterMvcConfig.java
@@ -12,6 +12,6 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
public class VoterMvcConfig implements WebMvcConfigurer {
@Override
public void addViewControllers(ViewControllerRegistry registry) {
- registry.addViewController("/").setViewName("private");
+ registry.addViewController("/private").setViewName("private");
}
}
diff --git a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/WebSecurityConfig.java b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/WebSecurityConfig.java
index 8a0f438b49..1a6d1b8235 100644
--- a/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/WebSecurityConfig.java
+++ b/spring-security-modules/spring-security-mvc-boot-1/src/main/java/com/baeldung/roles/voter/WebSecurityConfig.java
@@ -34,7 +34,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
// @formatter: off
http
// needed so our login could work
- .csrf().disable().authorizeRequests().anyRequest().authenticated().accessDecisionManager(accessDecisionManager()).antMatchers("/").hasAnyRole("ROLE_ADMIN", "ROLE_USER").and().formLogin().permitAll().and().logout().permitAll()
+ .csrf().disable().authorizeRequests().anyRequest().authenticated().accessDecisionManager(accessDecisionManager()).and().formLogin().permitAll().and().logout().permitAll()
.deleteCookies("JSESSIONID").logoutSuccessUrl("/login");
// @formatter: on
}
diff --git a/spring-thymeleaf-3/src/test/java/com/baeldung/thymeleaf/currencies/CurrenciesControllerIntegrationTest.java b/spring-thymeleaf-3/src/test/java/com/baeldung/thymeleaf/currencies/CurrenciesControllerIntegrationTest.java
index 02bf8a9ee0..c1e3cf7458 100644
--- a/spring-thymeleaf-3/src/test/java/com/baeldung/thymeleaf/currencies/CurrenciesControllerIntegrationTest.java
+++ b/spring-thymeleaf-3/src/test/java/com/baeldung/thymeleaf/currencies/CurrenciesControllerIntegrationTest.java
@@ -27,7 +27,7 @@ public class CurrenciesControllerIntegrationTest {
.header("Accept-Language", "es-ES")
.param("amount", "10032.5"))
.andExpect(status().isOk())
- .andExpect(content().string(containsString("10.032,50 €")));
+ .andExpect(content().string(containsString("10.032,50")));
}
@Test
@@ -42,10 +42,10 @@ public class CurrenciesControllerIntegrationTest {
@Test
public void whenCallCurrencyWithRomanianLocaleWithArrays_ThenReturnLocaleCurrencies() throws Exception {
mockMvc.perform(MockMvcRequestBuilders.get("/currency")
- .header("Accept-Language", "ro-RO")
+ .header("Accept-Language", "en-GB")
.param("amountList", "10", "20", "30"))
.andExpect(status().isOk())
- .andExpect(content().string(containsString("10,00 RON, 20,00 RON, 30,00 RON")));
+ .andExpect(content().string(containsString("£10.00, £20.00, £30.00")));
}
@Test
diff --git a/testing-modules/testing-libraries/src/test/java/com/baeldung/mutation/PalindromeUnitTest.java b/testing-modules/testing-libraries/src/test/java/com/baeldung/mutation/PalindromeUnitTest.java
index cb4830a6fb..207077158e 100644
--- a/testing-modules/testing-libraries/src/test/java/com/baeldung/mutation/PalindromeUnitTest.java
+++ b/testing-modules/testing-libraries/src/test/java/com/baeldung/mutation/PalindromeUnitTest.java
@@ -11,13 +11,13 @@ public class PalindromeUnitTest {
@Test
public void whenEmptyString_thanAccept() {
Palindrome palindromeTester = new Palindrome();
- assertTrue(palindromeTester.isPalindrome("noon"));
+ assertTrue(palindromeTester.isPalindrome(""));
}
@Test
- public void whenPalindrom_thanAccept() {
- Palindrome palindromeTester = new Palindrome();
- assertTrue(palindromeTester.isPalindrome("noon"));
+ public void whenPalindrom_thanAccept() {
+ Palindrome palindromeTester = new Palindrome();
+ assertTrue(palindromeTester.isPalindrome("noon"));
}
@Test
diff --git a/testing-modules/testng/pom.xml b/testing-modules/testng/pom.xml
index 601b152144..c4a1284b0e 100644
--- a/testing-modules/testng/pom.xml
+++ b/testing-modules/testng/pom.xml
@@ -42,7 +42,7 @@
- 6.10
+ 7.1.0
\ No newline at end of file