diff --git a/README.md b/README.md index 4cad075cc3..5307efa008 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +**UPDATE**: The price of "Learn Spring Security OAuth" will permanently change on the 11th of December, along with the upcoming OAuth2 material: http://bit.ly/github-lss The Courses ============================== diff --git a/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/mergesortedarrays/SortedArrays.java b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/mergesortedarrays/SortedArrays.java new file mode 100644 index 0000000000..5d1c4af650 --- /dev/null +++ b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/mergesortedarrays/SortedArrays.java @@ -0,0 +1,33 @@ +package com.baeldung.algorithms.mergesortedarrays; + +public class SortedArrays { + + public static int[] merge(int[] foo, int[] bar) { + + int fooLength = foo.length; + int barLength = bar.length; + + int[] merged = new int[fooLength + barLength]; + + int fooPosition, barPosition, mergedPosition; + fooPosition = barPosition = mergedPosition = 0; + + while (fooPosition < fooLength && barPosition < barLength) { + if (foo[fooPosition] < bar[barPosition]) { + merged[mergedPosition++] = foo[fooPosition++]; + } else { + merged[mergedPosition++] = bar[barPosition++]; + } + } + + while (fooPosition < fooLength) { + merged[mergedPosition++] = foo[fooPosition++]; + } + + while (barPosition < barLength) { + merged[mergedPosition++] = bar[barPosition++]; + } + + return merged; + } +} diff --git a/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/mergesortedarrays/SortedArraysUnitTest.java b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/mergesortedarrays/SortedArraysUnitTest.java new file mode 100644 index 0000000000..76eeb7b116 --- /dev/null +++ b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/mergesortedarrays/SortedArraysUnitTest.java @@ -0,0 +1,29 @@ +package com.baeldung.algorithms.mergesortedarrays; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import org.junit.jupiter.api.Test; + +import com.baeldung.algorithms.mergesortedarrays.SortedArrays; + +public class SortedArraysUnitTest { + + @Test + public void givenTwoSortedArrays_whenMerged_thenReturnMergedSortedArray() { + + int[] foo = { 3, 7 }; + int[] bar = { 4, 8, 11 }; + int[] merged = { 3, 4, 7, 8, 11 }; + + assertArrayEquals(merged, SortedArrays.merge(foo, bar)); + } + + @Test + public void givenTwoSortedArraysWithDuplicates_whenMerged_thenReturnMergedSortedArray() { + + int[] foo = { 3, 3, 7 }; + int[] bar = { 4, 8, 8, 11 }; + int[] merged = { 3, 3, 4, 7, 8, 8, 11 }; + + assertArrayEquals(merged, SortedArrays.merge(foo, bar)); + } +} diff --git a/aws/README.md b/aws/README.md index 9e4ca8b699..fcb9735878 100644 --- a/aws/README.md +++ b/aws/README.md @@ -1,6 +1,6 @@ ## AWS -This module contains articles about AWS +This module contains articles about Amazon Web Services (AWS) ### Relevant articles diff --git a/core-java-modules/core-java-concurrency-advanced-2/README.md b/core-java-modules/core-java-concurrency-advanced-2/README.md index 988ada9e4a..0e3d25689f 100644 --- a/core-java-modules/core-java-concurrency-advanced-2/README.md +++ b/core-java-modules/core-java-concurrency-advanced-2/README.md @@ -1,5 +1,3 @@ -========= - ## Core Java Concurrency Advanced Examples This module contains articles about advanced topics about multithreading with core Java. diff --git a/core-java-modules/core-java-concurrency-basic-2/README.md b/core-java-modules/core-java-concurrency-basic-2/README.md index e72725b7cb..e3f7a94e14 100644 --- a/core-java-modules/core-java-concurrency-basic-2/README.md +++ b/core-java-modules/core-java-concurrency-basic-2/README.md @@ -1,6 +1,6 @@ -========= +## Core Java Concurrency Basic -## Core Java Concurrency Basic 2 Examples +This module contains articles about basic Java concurrency ### Relevant Articles: - [How to Delay Code Execution in Java](https://www.baeldung.com/java-delay-code-execution) @@ -8,3 +8,4 @@ - [Difference Between Wait and Sleep in Java](https://www.baeldung.com/java-wait-and-sleep) - [Guide to the Synchronized Keyword in Java](https://www.baeldung.com/java-synchronized) - [Life Cycle of a Thread in Java](https://www.baeldung.com/java-thread-lifecycle) +- [[<-- Prev]](/core-java-modules/core-java-concurrency-basic) \ No newline at end of file diff --git a/java-dates/src/main/java/com/baeldung/datetime/UseDateTimeFormatter.java b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/datetime/UseDateTimeFormatter.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/datetime/UseDateTimeFormatter.java rename to core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/datetime/UseDateTimeFormatter.java diff --git a/java-dates/src/main/java/com/baeldung/datetime/UseOffsetDateTime.java b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/datetime/UseOffsetDateTime.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/datetime/UseOffsetDateTime.java rename to core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/datetime/UseOffsetDateTime.java diff --git a/java-dates/src/test/java/com/baeldung/datetime/UseDateTimeFormatterUnitTest.java b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UseDateTimeFormatterUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/datetime/UseDateTimeFormatterUnitTest.java rename to core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UseDateTimeFormatterUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/datetime/UseOffsetDateTimeUnitTest.java b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UseOffsetDateTimeUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/datetime/UseOffsetDateTimeUnitTest.java rename to core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UseOffsetDateTimeUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/datetime/UseToInstantUnitTest.java b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UseToInstantUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/datetime/UseToInstantUnitTest.java rename to core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UseToInstantUnitTest.java diff --git a/core-java-modules/core-java-exceptions/README.md b/core-java-modules/core-java-exceptions/README.md index 63a3eb19a1..b7222540e9 100644 --- a/core-java-modules/core-java-exceptions/README.md +++ b/core-java-modules/core-java-exceptions/README.md @@ -17,3 +17,4 @@ This module contains articles about core java exceptions - [Common Java Exceptions](https://www.baeldung.com/java-common-exceptions) - [How to Find an Exception’s Root Cause in Java](https://www.baeldung.com/java-exception-root-cause) - [Is It a Bad Practice to Catch Throwable?](https://www.baeldung.com/java-catch-throwable-bad-practice) +- [[Next -->]](/core-java-modules/core-java-exceptions-2) \ No newline at end of file diff --git a/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/file/FileClassUnitTest.java b/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/file/FileClassUnitTest.java index 57e12560bb..a4317af372 100644 --- a/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/file/FileClassUnitTest.java +++ b/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/file/FileClassUnitTest.java @@ -156,10 +156,16 @@ public class FileClassUnitTest { private static File makeDir(String name) { File directory = new File(name); - directory.mkdir(); - if (directory.isDirectory()) { + + // If the directory already exists, make sure we create it 'from scratch', i.e. all the files inside are deleted first + if (directory.exists()) { + removeDir(directory); + } + + if (directory.mkdir()) { return directory; } + throw new RuntimeException("'" + name + "' not made!"); } diff --git a/core-java-modules/core-java-lang-math/src/test/java/com/baeldung/overflow/OverflowUnitTest.java b/core-java-modules/core-java-lang-math/src/test/java/com/baeldung/overflow/OverflowUnitTest.java new file mode 100644 index 0000000000..b570592c7e --- /dev/null +++ b/core-java-modules/core-java-lang-math/src/test/java/com/baeldung/overflow/OverflowUnitTest.java @@ -0,0 +1,22 @@ +package com.baeldung.overflow; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class OverflowUnitTest { + + @Test + public void positive_and_negative_zero_are_not_always_equal() { + + double a = +0f; + double b = -0f; + + assertTrue(a == b); + + assertTrue(1/a == Double.POSITIVE_INFINITY); + assertTrue(1/b == Double.NEGATIVE_INFINITY); + + assertTrue(1/a != 1/b); + } +} diff --git a/data-structures/src/main/java/com/baeldung/printbinarytree/BinaryTreeModel.java b/data-structures/src/main/java/com/baeldung/printbinarytree/BinaryTreeModel.java new file mode 100644 index 0000000000..94796bf997 --- /dev/null +++ b/data-structures/src/main/java/com/baeldung/printbinarytree/BinaryTreeModel.java @@ -0,0 +1,37 @@ +package com.baeldung.printbinarytree; + +public class BinaryTreeModel { + + private Object value; + private BinaryTreeModel left; + private BinaryTreeModel right; + + public BinaryTreeModel(Object value) { + this.value = value; + } + + public Object getValue() { + return value; + } + + public void setValue(Object value) { + this.value = value; + } + + public BinaryTreeModel getLeft() { + return left; + } + + public void setLeft(BinaryTreeModel left) { + this.left = left; + } + + public BinaryTreeModel getRight() { + return right; + } + + public void setRight(BinaryTreeModel right) { + this.right = right; + } + +} \ No newline at end of file diff --git a/data-structures/src/main/java/com/baeldung/printbinarytree/BinaryTreePrinter.java b/data-structures/src/main/java/com/baeldung/printbinarytree/BinaryTreePrinter.java new file mode 100644 index 0000000000..0ec844d7b6 --- /dev/null +++ b/data-structures/src/main/java/com/baeldung/printbinarytree/BinaryTreePrinter.java @@ -0,0 +1,63 @@ +package com.baeldung.printbinarytree; + +import java.io.PrintStream; + +public class BinaryTreePrinter { + + private BinaryTreeModel tree; + + public BinaryTreePrinter(BinaryTreeModel tree) { + this.tree = tree; + } + + private String traversePreOrder(BinaryTreeModel root) { + + if (root == null) { + return ""; + } + + StringBuilder sb = new StringBuilder(); + sb.append(root.getValue()); + + String pointerRight = "└──"; + String pointerLeft = (root.getRight() != null) ? "├──" : "└──"; + + traverseNodes(sb, "", pointerLeft, root.getLeft(), root.getRight() != null); + traverseNodes(sb, "", pointerRight, root.getRight(), false); + + return sb.toString(); + } + + private void traverseNodes(StringBuilder sb, String padding, String pointer, BinaryTreeModel node, + boolean hasRightSibling) { + + if (node != null) { + + sb.append("\n"); + sb.append(padding); + sb.append(pointer); + sb.append(node.getValue()); + + StringBuilder paddingBuilder = new StringBuilder(padding); + if (hasRightSibling) { + paddingBuilder.append("│ "); + } else { + paddingBuilder.append(" "); + } + + String paddingForBoth = paddingBuilder.toString(); + String pointerRight = "└──"; + String pointerLeft = (node.getRight() != null) ? "├──" : "└──"; + + traverseNodes(sb, paddingForBoth, pointerLeft, node.getLeft(), node.getRight() != null); + traverseNodes(sb, paddingForBoth, pointerRight, node.getRight(), false); + + } + + } + + public void print(PrintStream os) { + os.print(traversePreOrder(tree)); + } + +} \ No newline at end of file diff --git a/data-structures/src/test/java/com/baeldung/printbinarytree/PrintingBinaryTreeModelUnitTest.java b/data-structures/src/test/java/com/baeldung/printbinarytree/PrintingBinaryTreeModelUnitTest.java new file mode 100644 index 0000000000..5c250730f9 --- /dev/null +++ b/data-structures/src/test/java/com/baeldung/printbinarytree/PrintingBinaryTreeModelUnitTest.java @@ -0,0 +1,178 @@ +package com.baeldung.printbinarytree; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.ByteArrayOutputStream; +import java.io.OutputStream; +import java.io.PrintStream; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import com.baeldung.printbinarytree.BinaryTreeModel; +import com.baeldung.printbinarytree.BinaryTreePrinter; + +public class PrintingBinaryTreeModelUnitTest { + + private BinaryTreeModel balanced; + private BinaryTreeModel leftSkewed; + private BinaryTreeModel rightSkewed; + + private OutputStream output; + + @Before + public void setup() { + balanced = createBalancedTree(); + leftSkewed = createLeftUnbalancedTree(); + rightSkewed = createRightUnbalancedTree(); + + output = new ByteArrayOutputStream(); + System.setOut(new PrintStream(output)); + } + + @After + public void tearDown() { + System.setOut(System.out); + } + + private BinaryTreeModel createBalancedTree() { + + BinaryTreeModel root = new BinaryTreeModel("root"); + + BinaryTreeModel node1 = new BinaryTreeModel("node1"); + BinaryTreeModel node2 = new BinaryTreeModel("node2"); + root.setLeft(node1); + root.setRight(node2); + + BinaryTreeModel node3 = new BinaryTreeModel("node3"); + BinaryTreeModel node4 = new BinaryTreeModel("node4"); + node1.setLeft(node3); + node1.setRight(node4); + + node2.setLeft(new BinaryTreeModel("node5")); + node2.setRight(new BinaryTreeModel("node6")); + + BinaryTreeModel node7 = new BinaryTreeModel("node7"); + node3.setLeft(node7); + node7.setLeft(new BinaryTreeModel("node8")); + node7.setRight(new BinaryTreeModel("node9")); + + return root; + } + + private BinaryTreeModel createLeftUnbalancedTree() { + + BinaryTreeModel root = new BinaryTreeModel("root"); + + BinaryTreeModel node1 = new BinaryTreeModel("node1"); + root.setLeft(node1); + root.setRight(new BinaryTreeModel("node2")); + + BinaryTreeModel node3 = new BinaryTreeModel("node3"); + node1.setLeft(node3); + + BinaryTreeModel node4 = new BinaryTreeModel("node4"); + node3.setLeft(node4); + + BinaryTreeModel node5 = new BinaryTreeModel("node5"); + node4.setLeft(node5); + + BinaryTreeModel node6 = new BinaryTreeModel("node6"); + node5.setLeft(node6); + + BinaryTreeModel node7 = new BinaryTreeModel("node7"); + node6.setLeft(node7); + + node7.setLeft(new BinaryTreeModel("node8")); + + return root; + } + + private BinaryTreeModel createRightUnbalancedTree() { + + BinaryTreeModel root = new BinaryTreeModel("root"); + + BinaryTreeModel node2 = new BinaryTreeModel("node2"); + root.setLeft(new BinaryTreeModel("node1")); + root.setRight(node2); + + BinaryTreeModel node3 = new BinaryTreeModel("node3"); + node2.setRight(node3); + + BinaryTreeModel node4 = new BinaryTreeModel("node4"); + node3.setRight(node4); + + BinaryTreeModel node5 = new BinaryTreeModel("node5"); + node4.setRight(node5); + + BinaryTreeModel node6 = new BinaryTreeModel("node6"); + node5.setRight(node6); + + BinaryTreeModel node7 = new BinaryTreeModel("node7"); + node6.setRight(node7); + + node7.setRight(new BinaryTreeModel("node8")); + + return root; + } + + @Test + public void givenBinaryTreeModelBalanced_whenPrintWithBinaryTreePrinter_thenProduceCorrectOutput() { + + StringBuilder expected = new StringBuilder(); + expected.append("root").append("\n"); + expected.append("├──node1").append("\n"); + expected.append("│ ├──node3").append("\n"); + expected.append("│ │ └──node7").append("\n"); + expected.append("│ │ ├──node8").append("\n"); + expected.append("│ │ └──node9").append("\n"); + expected.append("│ └──node4").append("\n"); + expected.append("└──node2").append("\n"); + expected.append(" ├──node5").append("\n"); + expected.append(" └──node6"); + + new BinaryTreePrinter(balanced).print(System.out); + + assertEquals(expected.toString(), output.toString()); + } + + @Test + public void givenBinaryTreeModelLeftUnbalanced_whenPrintWithBinaryTreePrinter_thenProduceCorrectOutput() { + + StringBuilder expected = new StringBuilder(); + expected.append("root").append("\n"); + expected.append("├──node1").append("\n"); + expected.append("│ └──node3").append("\n"); + expected.append("│ └──node4").append("\n"); + expected.append("│ └──node5").append("\n"); + expected.append("│ └──node6").append("\n"); + expected.append("│ └──node7").append("\n"); + expected.append("│ └──node8").append("\n"); + expected.append("└──node2"); + + new BinaryTreePrinter(leftSkewed).print(System.out); + + assertEquals(expected.toString(), output.toString()); + } + + @Test + public void givenBinaryTreeModelRightUnbalanced_whenPrintWithBinaryTreePrinter_thenProduceCorrectOutput() { + + StringBuilder expected = new StringBuilder(); + expected.append("root").append("\n"); + expected.append("├──node1").append("\n"); + expected.append("└──node2").append("\n"); + expected.append(" └──node3").append("\n"); + expected.append(" └──node4").append("\n"); + expected.append(" └──node5").append("\n"); + expected.append(" └──node6").append("\n"); + expected.append(" └──node7").append("\n"); + expected.append(" └──node8"); + + new BinaryTreePrinter(rightSkewed).print(System.out); + + assertEquals(expected.toString(), output.toString()); + } + +} diff --git a/gson/src/main/java/org/baeldung/gson/entities/ActorGson.java b/gson/src/main/java/com/baeldung/gson/entities/ActorGson.java similarity index 97% rename from gson/src/main/java/org/baeldung/gson/entities/ActorGson.java rename to gson/src/main/java/com/baeldung/gson/entities/ActorGson.java index 92468683bf..a68dba2436 100644 --- a/gson/src/main/java/org/baeldung/gson/entities/ActorGson.java +++ b/gson/src/main/java/com/baeldung/gson/entities/ActorGson.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.entities; +package com.baeldung.gson.entities; import java.text.DateFormat; import java.text.SimpleDateFormat; diff --git a/gson/src/main/java/org/baeldung/gson/entities/Animal.java b/gson/src/main/java/com/baeldung/gson/entities/Animal.java similarity index 65% rename from gson/src/main/java/org/baeldung/gson/entities/Animal.java rename to gson/src/main/java/com/baeldung/gson/entities/Animal.java index 2eec5f8704..6c0f4a6e4e 100644 --- a/gson/src/main/java/org/baeldung/gson/entities/Animal.java +++ b/gson/src/main/java/com/baeldung/gson/entities/Animal.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.entities; +package com.baeldung.gson.entities; public abstract class Animal { public String type = "Animal"; diff --git a/gson/src/main/java/org/baeldung/gson/entities/Cow.java b/gson/src/main/java/com/baeldung/gson/entities/Cow.java similarity index 88% rename from gson/src/main/java/org/baeldung/gson/entities/Cow.java rename to gson/src/main/java/com/baeldung/gson/entities/Cow.java index 020bcd5860..5bd8d23f44 100644 --- a/gson/src/main/java/org/baeldung/gson/entities/Cow.java +++ b/gson/src/main/java/com/baeldung/gson/entities/Cow.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.entities; +package com.baeldung.gson.entities; public class Cow extends Animal { private String breed; diff --git a/gson/src/main/java/org/baeldung/gson/entities/Dog.java b/gson/src/main/java/com/baeldung/gson/entities/Dog.java similarity index 88% rename from gson/src/main/java/org/baeldung/gson/entities/Dog.java rename to gson/src/main/java/com/baeldung/gson/entities/Dog.java index 042d73adcf..ac55573866 100644 --- a/gson/src/main/java/org/baeldung/gson/entities/Dog.java +++ b/gson/src/main/java/com/baeldung/gson/entities/Dog.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.entities; +package com.baeldung.gson.entities; public class Dog extends Animal { private String petName; diff --git a/gson/src/main/java/org/baeldung/gson/entities/Employee.java b/gson/src/main/java/com/baeldung/gson/entities/Employee.java similarity index 94% rename from gson/src/main/java/org/baeldung/gson/entities/Employee.java rename to gson/src/main/java/com/baeldung/gson/entities/Employee.java index cedcd6572e..ecc4571dcc 100644 --- a/gson/src/main/java/org/baeldung/gson/entities/Employee.java +++ b/gson/src/main/java/com/baeldung/gson/entities/Employee.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.entities; +package com.baeldung.gson.entities; public class Employee { private int id; diff --git a/gson/src/main/java/org/baeldung/gson/entities/Movie.java b/gson/src/main/java/com/baeldung/gson/entities/Movie.java similarity index 96% rename from gson/src/main/java/org/baeldung/gson/entities/Movie.java rename to gson/src/main/java/com/baeldung/gson/entities/Movie.java index ee688f228d..ebc4cff137 100644 --- a/gson/src/main/java/org/baeldung/gson/entities/Movie.java +++ b/gson/src/main/java/com/baeldung/gson/entities/Movie.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.entities; +package com.baeldung.gson.entities; import java.util.List; diff --git a/gson/src/main/java/org/baeldung/gson/entities/MovieWithNullValue.java b/gson/src/main/java/com/baeldung/gson/entities/MovieWithNullValue.java similarity index 96% rename from gson/src/main/java/org/baeldung/gson/entities/MovieWithNullValue.java rename to gson/src/main/java/com/baeldung/gson/entities/MovieWithNullValue.java index fe62d51ffb..381d7cb83b 100644 --- a/gson/src/main/java/org/baeldung/gson/entities/MovieWithNullValue.java +++ b/gson/src/main/java/com/baeldung/gson/entities/MovieWithNullValue.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.entities; +package com.baeldung.gson.entities; import com.google.gson.annotations.Expose; diff --git a/gson/src/main/java/org/baeldung/gson/entities/MyClass.java b/gson/src/main/java/com/baeldung/gson/entities/MyClass.java similarity index 96% rename from gson/src/main/java/org/baeldung/gson/entities/MyClass.java rename to gson/src/main/java/com/baeldung/gson/entities/MyClass.java index 4e717e72c3..66a1887414 100644 --- a/gson/src/main/java/org/baeldung/gson/entities/MyClass.java +++ b/gson/src/main/java/com/baeldung/gson/entities/MyClass.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.entities; +package com.baeldung.gson.entities; import java.util.Objects; diff --git a/gson/src/main/java/org/baeldung/gson/entities/User.java b/gson/src/main/java/com/baeldung/gson/entities/User.java similarity index 84% rename from gson/src/main/java/org/baeldung/gson/entities/User.java rename to gson/src/main/java/com/baeldung/gson/entities/User.java index b413f3300e..d821ef5552 100644 --- a/gson/src/main/java/org/baeldung/gson/entities/User.java +++ b/gson/src/main/java/com/baeldung/gson/entities/User.java @@ -1,19 +1,19 @@ -package org.baeldung.gson.entities; - -public class User { - - private int id; - private String name; - private transient String nationality; - - public User(int id, String name, String nationality) { - this.id = id; - this.name = name; - this.nationality = nationality; - } - - public User(int id, String name) { - this(id, name, null); - } - -} +package com.baeldung.gson.entities; + +public class User { + + private int id; + private String name; + private transient String nationality; + + public User(int id, String name, String nationality) { + this.id = id; + this.name = name; + this.nationality = nationality; + } + + public User(int id, String name) { + this(id, name, null); + } + +} diff --git a/gson/src/main/java/org/baeldung/gson/entities/Weather.java b/gson/src/main/java/com/baeldung/gson/entities/Weather.java similarity index 95% rename from gson/src/main/java/org/baeldung/gson/entities/Weather.java rename to gson/src/main/java/com/baeldung/gson/entities/Weather.java index 383e9ef41c..b68ec4c6d4 100644 --- a/gson/src/main/java/org/baeldung/gson/entities/Weather.java +++ b/gson/src/main/java/com/baeldung/gson/entities/Weather.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.entities; +package com.baeldung.gson.entities; import com.google.gson.annotations.SerializedName; diff --git a/gson/src/main/java/org/baeldung/gson/primitives/models/BooleanExample.java b/gson/src/main/java/com/baeldung/gson/primitives/models/BooleanExample.java similarity index 75% rename from gson/src/main/java/org/baeldung/gson/primitives/models/BooleanExample.java rename to gson/src/main/java/com/baeldung/gson/primitives/models/BooleanExample.java index 1fe87650de..1f05fc6119 100644 --- a/gson/src/main/java/org/baeldung/gson/primitives/models/BooleanExample.java +++ b/gson/src/main/java/com/baeldung/gson/primitives/models/BooleanExample.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.primitives.models; +package com.baeldung.gson.primitives.models; public class BooleanExample { public boolean value; diff --git a/gson/src/main/java/org/baeldung/gson/primitives/models/ByteExample.java b/gson/src/main/java/com/baeldung/gson/primitives/models/ByteExample.java similarity index 75% rename from gson/src/main/java/org/baeldung/gson/primitives/models/ByteExample.java rename to gson/src/main/java/com/baeldung/gson/primitives/models/ByteExample.java index 2e1c68ee51..6ec4e42ea3 100644 --- a/gson/src/main/java/org/baeldung/gson/primitives/models/ByteExample.java +++ b/gson/src/main/java/com/baeldung/gson/primitives/models/ByteExample.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.primitives.models; +package com.baeldung.gson.primitives.models; public class ByteExample { public byte value = (byte) 1; diff --git a/gson/src/main/java/org/baeldung/gson/primitives/models/CharExample.java b/gson/src/main/java/com/baeldung/gson/primitives/models/CharExample.java similarity index 74% rename from gson/src/main/java/org/baeldung/gson/primitives/models/CharExample.java rename to gson/src/main/java/com/baeldung/gson/primitives/models/CharExample.java index ccac913f23..69d1a95fcd 100644 --- a/gson/src/main/java/org/baeldung/gson/primitives/models/CharExample.java +++ b/gson/src/main/java/com/baeldung/gson/primitives/models/CharExample.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.primitives.models; +package com.baeldung.gson.primitives.models; public class CharExample { public char value; diff --git a/gson/src/main/java/org/baeldung/gson/primitives/models/DoubleExample.java b/gson/src/main/java/com/baeldung/gson/primitives/models/DoubleExample.java similarity index 75% rename from gson/src/main/java/org/baeldung/gson/primitives/models/DoubleExample.java rename to gson/src/main/java/com/baeldung/gson/primitives/models/DoubleExample.java index 5022b6a11e..7c9db2bd50 100644 --- a/gson/src/main/java/org/baeldung/gson/primitives/models/DoubleExample.java +++ b/gson/src/main/java/com/baeldung/gson/primitives/models/DoubleExample.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.primitives.models; +package com.baeldung.gson.primitives.models; public class DoubleExample { public double value; diff --git a/gson/src/main/java/org/baeldung/gson/primitives/models/FloatExample.java b/gson/src/main/java/com/baeldung/gson/primitives/models/FloatExample.java similarity index 74% rename from gson/src/main/java/org/baeldung/gson/primitives/models/FloatExample.java rename to gson/src/main/java/com/baeldung/gson/primitives/models/FloatExample.java index 00a97f68fc..86c0c4802c 100644 --- a/gson/src/main/java/org/baeldung/gson/primitives/models/FloatExample.java +++ b/gson/src/main/java/com/baeldung/gson/primitives/models/FloatExample.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.primitives.models; +package com.baeldung.gson.primitives.models; public class FloatExample { public float value; diff --git a/gson/src/main/java/org/baeldung/gson/primitives/models/InfinityValuesExample.java b/gson/src/main/java/com/baeldung/gson/primitives/models/InfinityValuesExample.java similarity index 70% rename from gson/src/main/java/org/baeldung/gson/primitives/models/InfinityValuesExample.java rename to gson/src/main/java/com/baeldung/gson/primitives/models/InfinityValuesExample.java index 163b0a3d95..90f10c0751 100644 --- a/gson/src/main/java/org/baeldung/gson/primitives/models/InfinityValuesExample.java +++ b/gson/src/main/java/com/baeldung/gson/primitives/models/InfinityValuesExample.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.primitives.models; +package com.baeldung.gson.primitives.models; public class InfinityValuesExample { public float negativeInfinity; diff --git a/gson/src/main/java/org/baeldung/gson/primitives/models/LongExample.java b/gson/src/main/java/com/baeldung/gson/primitives/models/LongExample.java similarity index 75% rename from gson/src/main/java/org/baeldung/gson/primitives/models/LongExample.java rename to gson/src/main/java/com/baeldung/gson/primitives/models/LongExample.java index e709650789..021de1d06d 100644 --- a/gson/src/main/java/org/baeldung/gson/primitives/models/LongExample.java +++ b/gson/src/main/java/com/baeldung/gson/primitives/models/LongExample.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.primitives.models; +package com.baeldung.gson.primitives.models; public class LongExample { public long value = 1; diff --git a/gson/src/main/java/org/baeldung/gson/primitives/models/PrimitiveBundle.java b/gson/src/main/java/com/baeldung/gson/primitives/models/PrimitiveBundle.java similarity index 93% rename from gson/src/main/java/org/baeldung/gson/primitives/models/PrimitiveBundle.java rename to gson/src/main/java/com/baeldung/gson/primitives/models/PrimitiveBundle.java index ad7309a2f7..10134110f3 100644 --- a/gson/src/main/java/org/baeldung/gson/primitives/models/PrimitiveBundle.java +++ b/gson/src/main/java/com/baeldung/gson/primitives/models/PrimitiveBundle.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.primitives.models; +package com.baeldung.gson.primitives.models; public class PrimitiveBundle { public byte byteValue; diff --git a/gson/src/main/java/org/baeldung/gson/primitives/models/PrimitiveBundleInitialized.java b/gson/src/main/java/com/baeldung/gson/primitives/models/PrimitiveBundleInitialized.java similarity index 92% rename from gson/src/main/java/org/baeldung/gson/primitives/models/PrimitiveBundleInitialized.java rename to gson/src/main/java/com/baeldung/gson/primitives/models/PrimitiveBundleInitialized.java index 2780f7fd18..c6eb6ca267 100644 --- a/gson/src/main/java/org/baeldung/gson/primitives/models/PrimitiveBundleInitialized.java +++ b/gson/src/main/java/com/baeldung/gson/primitives/models/PrimitiveBundleInitialized.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.primitives.models; +package com.baeldung.gson.primitives.models; public class PrimitiveBundleInitialized { // @formatter:off diff --git a/gson/src/main/java/org/baeldung/gson/serialization/ActorGsonDeserializer.java b/gson/src/main/java/com/baeldung/gson/serialization/ActorGsonDeserializer.java similarity index 94% rename from gson/src/main/java/org/baeldung/gson/serialization/ActorGsonDeserializer.java rename to gson/src/main/java/com/baeldung/gson/serialization/ActorGsonDeserializer.java index 016e3ba1e2..34c9f83888 100644 --- a/gson/src/main/java/org/baeldung/gson/serialization/ActorGsonDeserializer.java +++ b/gson/src/main/java/com/baeldung/gson/serialization/ActorGsonDeserializer.java @@ -1,11 +1,11 @@ -package org.baeldung.gson.serialization; +package com.baeldung.gson.serialization; import java.lang.reflect.Type; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; -import org.baeldung.gson.entities.ActorGson; +import com.baeldung.gson.entities.ActorGson; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; diff --git a/gson/src/main/java/org/baeldung/gson/serialization/ActorGsonSerializer.java b/gson/src/main/java/com/baeldung/gson/serialization/ActorGsonSerializer.java similarity index 93% rename from gson/src/main/java/org/baeldung/gson/serialization/ActorGsonSerializer.java rename to gson/src/main/java/com/baeldung/gson/serialization/ActorGsonSerializer.java index 8f2cd10f5a..4ca653f76b 100644 --- a/gson/src/main/java/org/baeldung/gson/serialization/ActorGsonSerializer.java +++ b/gson/src/main/java/com/baeldung/gson/serialization/ActorGsonSerializer.java @@ -1,10 +1,10 @@ -package org.baeldung.gson.serialization; +package com.baeldung.gson.serialization; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; -import org.baeldung.gson.entities.ActorGson; +import com.baeldung.gson.entities.ActorGson; import java.lang.reflect.Type; import java.text.SimpleDateFormat; diff --git a/gson/src/main/java/org/baeldung/gson/serialization/AnimalDeserializer.java b/gson/src/main/java/com/baeldung/gson/serialization/AnimalDeserializer.java similarity index 93% rename from gson/src/main/java/org/baeldung/gson/serialization/AnimalDeserializer.java rename to gson/src/main/java/com/baeldung/gson/serialization/AnimalDeserializer.java index 9dcef0e10b..6c72ddb0da 100644 --- a/gson/src/main/java/org/baeldung/gson/serialization/AnimalDeserializer.java +++ b/gson/src/main/java/com/baeldung/gson/serialization/AnimalDeserializer.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serialization; +package com.baeldung.gson.serialization; import com.google.gson.Gson; import com.google.gson.JsonDeserializationContext; @@ -8,7 +8,7 @@ import com.google.gson.JsonObject; import java.lang.reflect.Type; import java.util.HashMap; import java.util.Map; -import org.baeldung.gson.entities.Animal; +import com.baeldung.gson.entities.Animal; public class AnimalDeserializer implements JsonDeserializer { private String animalTypeElementName; diff --git a/gson/src/main/java/org/baeldung/gson/serialization/MapDeserializer.java b/gson/src/main/java/com/baeldung/gson/serialization/MapDeserializer.java similarity index 94% rename from gson/src/main/java/org/baeldung/gson/serialization/MapDeserializer.java rename to gson/src/main/java/com/baeldung/gson/serialization/MapDeserializer.java index cdeb2e23c8..1954986547 100644 --- a/gson/src/main/java/org/baeldung/gson/serialization/MapDeserializer.java +++ b/gson/src/main/java/com/baeldung/gson/serialization/MapDeserializer.java @@ -1,12 +1,11 @@ -package org.baeldung.gson.serialization; +package com.baeldung.gson.serialization; import java.lang.reflect.Type; import java.math.BigDecimal; -import java.util.HashMap; import java.util.Map; import java.util.stream.Collectors; -import org.baeldung.gson.entities.Employee; +import com.baeldung.gson.entities.Employee; import com.google.gson.*; diff --git a/gson/src/main/java/org/baeldung/gson/serialization/StringDateMapDeserializer.java b/gson/src/main/java/com/baeldung/gson/serialization/StringDateMapDeserializer.java similarity index 97% rename from gson/src/main/java/org/baeldung/gson/serialization/StringDateMapDeserializer.java rename to gson/src/main/java/com/baeldung/gson/serialization/StringDateMapDeserializer.java index f18bdbc84f..fa9d7d2240 100644 --- a/gson/src/main/java/org/baeldung/gson/serialization/StringDateMapDeserializer.java +++ b/gson/src/main/java/com/baeldung/gson/serialization/StringDateMapDeserializer.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serialization; +package com.baeldung.gson.serialization; import java.lang.reflect.Type; import java.text.ParseException; diff --git a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/Exclude.java b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/Exclude.java similarity index 82% rename from gson/src/main/java/org/baeldung/gson/serializationwithexclusions/Exclude.java rename to gson/src/main/java/com/baeldung/gson/serializationwithexclusions/Exclude.java index 429cb9d1b5..d3067e3482 100644 --- a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/Exclude.java +++ b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/Exclude.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serializationwithexclusions; +package com.baeldung.gson.serializationwithexclusions; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MyClass.java b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MyClass.java similarity index 79% rename from gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MyClass.java rename to gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MyClass.java index cc6c498458..8919792721 100644 --- a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MyClass.java +++ b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MyClass.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serializationwithexclusions; +package com.baeldung.gson.serializationwithexclusions; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MyClassWithAnnotatedFields.java b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MyClassWithAnnotatedFields.java similarity index 85% rename from gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MyClassWithAnnotatedFields.java rename to gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MyClassWithAnnotatedFields.java index 5d41f8a224..4c38df1eac 100644 --- a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MyClassWithAnnotatedFields.java +++ b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MyClassWithAnnotatedFields.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serializationwithexclusions; +package com.baeldung.gson.serializationwithexclusions; import com.google.gson.annotations.Expose; diff --git a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MyClassWithCustomAnnotatedFields.java b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MyClassWithCustomAnnotatedFields.java similarity index 83% rename from gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MyClassWithCustomAnnotatedFields.java rename to gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MyClassWithCustomAnnotatedFields.java index ace3583013..85871be03d 100644 --- a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MyClassWithCustomAnnotatedFields.java +++ b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MyClassWithCustomAnnotatedFields.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serializationwithexclusions; +package com.baeldung.gson.serializationwithexclusions; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MyClassWithTransientFields.java b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MyClassWithTransientFields.java similarity index 82% rename from gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MyClassWithTransientFields.java rename to gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MyClassWithTransientFields.java index 5e781a6287..dfb9d4bd6e 100644 --- a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MyClassWithTransientFields.java +++ b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MyClassWithTransientFields.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serializationwithexclusions; +package com.baeldung.gson.serializationwithexclusions; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MySubClass.java b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MySubClass.java similarity index 78% rename from gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MySubClass.java rename to gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MySubClass.java index 5adac0697e..6b8a287020 100644 --- a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MySubClass.java +++ b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MySubClass.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serializationwithexclusions; +package com.baeldung.gson.serializationwithexclusions; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MySubClassWithAnnotatedFields.java b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MySubClassWithAnnotatedFields.java similarity index 83% rename from gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MySubClassWithAnnotatedFields.java rename to gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MySubClassWithAnnotatedFields.java index a0f7b5d277..0c94e8f2cc 100644 --- a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MySubClassWithAnnotatedFields.java +++ b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MySubClassWithAnnotatedFields.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serializationwithexclusions; +package com.baeldung.gson.serializationwithexclusions; import com.google.gson.annotations.Expose; diff --git a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MySubClassWithCustomAnnotatedFields.java b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MySubClassWithCustomAnnotatedFields.java similarity index 81% rename from gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MySubClassWithCustomAnnotatedFields.java rename to gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MySubClassWithCustomAnnotatedFields.java index f6aa4651b3..0bd9a149cb 100644 --- a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MySubClassWithCustomAnnotatedFields.java +++ b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MySubClassWithCustomAnnotatedFields.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serializationwithexclusions; +package com.baeldung.gson.serializationwithexclusions; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MySubClassWithTransientFields.java b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MySubClassWithTransientFields.java similarity index 80% rename from gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MySubClassWithTransientFields.java rename to gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MySubClassWithTransientFields.java index d4e31b0bc8..817d2ee557 100644 --- a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MySubClassWithTransientFields.java +++ b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MySubClassWithTransientFields.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serializationwithexclusions; +package com.baeldung.gson.serializationwithexclusions; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/gson/src/test/java/org/baeldung/gson/advance/GsonAdvanceUnitTest.java b/gson/src/test/java/com/baeldung/gson/advance/GsonAdvanceUnitTest.java similarity index 94% rename from gson/src/test/java/org/baeldung/gson/advance/GsonAdvanceUnitTest.java rename to gson/src/test/java/com/baeldung/gson/advance/GsonAdvanceUnitTest.java index 5b787f1956..d4adb6e406 100644 --- a/gson/src/test/java/org/baeldung/gson/advance/GsonAdvanceUnitTest.java +++ b/gson/src/test/java/com/baeldung/gson/advance/GsonAdvanceUnitTest.java @@ -1,8 +1,9 @@ -package org.baeldung.gson.advance; +package com.baeldung.gson.advance; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import com.baeldung.gson.entities.Dog; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; @@ -10,11 +11,10 @@ import java.lang.reflect.Type; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.baeldung.gson.entities.Animal; -import org.baeldung.gson.entities.Cow; -import org.baeldung.gson.entities.Dog; -import org.baeldung.gson.entities.MyClass; -import org.baeldung.gson.serialization.AnimalDeserializer; +import com.baeldung.gson.entities.Animal; +import com.baeldung.gson.entities.Cow; +import com.baeldung.gson.entities.MyClass; +import com.baeldung.gson.serialization.AnimalDeserializer; import org.junit.Test; public class GsonAdvanceUnitTest { diff --git a/gson/src/test/java/org/baeldung/gson/advance/RuntimeTypeAdapterFactory.java b/gson/src/test/java/com/baeldung/gson/advance/RuntimeTypeAdapterFactory.java similarity index 99% rename from gson/src/test/java/org/baeldung/gson/advance/RuntimeTypeAdapterFactory.java rename to gson/src/test/java/com/baeldung/gson/advance/RuntimeTypeAdapterFactory.java index 739dd889c7..aab3f5f3f1 100644 --- a/gson/src/test/java/org/baeldung/gson/advance/RuntimeTypeAdapterFactory.java +++ b/gson/src/test/java/com/baeldung/gson/advance/RuntimeTypeAdapterFactory.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.advance; +package com.baeldung.gson.advance; /* * Copyright (C) 2011 Google Inc. diff --git a/gson/src/test/java/org/baeldung/gson/conversion/JsonObjectConversionsUnitTest.java b/gson/src/test/java/com/baeldung/gson/conversion/JsonObjectConversionsUnitTest.java similarity index 96% rename from gson/src/test/java/org/baeldung/gson/conversion/JsonObjectConversionsUnitTest.java rename to gson/src/test/java/com/baeldung/gson/conversion/JsonObjectConversionsUnitTest.java index 847ec1b85d..9f07617969 100644 --- a/gson/src/test/java/org/baeldung/gson/conversion/JsonObjectConversionsUnitTest.java +++ b/gson/src/test/java/com/baeldung/gson/conversion/JsonObjectConversionsUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.conversion; +package com.baeldung.gson.conversion; import com.google.gson.*; import org.junit.Assert; diff --git a/gson/src/test/java/org/baeldung/gson/deserialization/Foo.java b/gson/src/test/java/com/baeldung/gson/deserialization/Foo.java similarity index 97% rename from gson/src/test/java/org/baeldung/gson/deserialization/Foo.java rename to gson/src/test/java/com/baeldung/gson/deserialization/Foo.java index 84f8aaef13..e556786020 100644 --- a/gson/src/test/java/org/baeldung/gson/deserialization/Foo.java +++ b/gson/src/test/java/com/baeldung/gson/deserialization/Foo.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.deserialization; +package com.baeldung.gson.deserialization; public class Foo { public int intValue; diff --git a/gson/src/test/java/org/baeldung/gson/deserialization/FooDeserializer.java b/gson/src/test/java/com/baeldung/gson/deserialization/FooDeserializer.java similarity index 95% rename from gson/src/test/java/org/baeldung/gson/deserialization/FooDeserializer.java rename to gson/src/test/java/com/baeldung/gson/deserialization/FooDeserializer.java index 17c1dfae19..1ccb3f7de9 100644 --- a/gson/src/test/java/org/baeldung/gson/deserialization/FooDeserializer.java +++ b/gson/src/test/java/com/baeldung/gson/deserialization/FooDeserializer.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.deserialization; +package com.baeldung.gson.deserialization; import java.lang.reflect.Type; diff --git a/gson/src/test/java/org/baeldung/gson/deserialization/FooDeserializerFromJsonWithDifferentFields.java b/gson/src/test/java/com/baeldung/gson/deserialization/FooDeserializerFromJsonWithDifferentFields.java similarity index 94% rename from gson/src/test/java/org/baeldung/gson/deserialization/FooDeserializerFromJsonWithDifferentFields.java rename to gson/src/test/java/com/baeldung/gson/deserialization/FooDeserializerFromJsonWithDifferentFields.java index d4eaa39ac5..289f71820c 100644 --- a/gson/src/test/java/org/baeldung/gson/deserialization/FooDeserializerFromJsonWithDifferentFields.java +++ b/gson/src/test/java/com/baeldung/gson/deserialization/FooDeserializerFromJsonWithDifferentFields.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.deserialization; +package com.baeldung.gson.deserialization; import java.lang.reflect.Type; diff --git a/gson/src/test/java/org/baeldung/gson/deserialization/FooInstanceCreator.java b/gson/src/test/java/com/baeldung/gson/deserialization/FooInstanceCreator.java similarity index 84% rename from gson/src/test/java/org/baeldung/gson/deserialization/FooInstanceCreator.java rename to gson/src/test/java/com/baeldung/gson/deserialization/FooInstanceCreator.java index 4df3986ec3..e3ebc09874 100644 --- a/gson/src/test/java/org/baeldung/gson/deserialization/FooInstanceCreator.java +++ b/gson/src/test/java/com/baeldung/gson/deserialization/FooInstanceCreator.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.deserialization; +package com.baeldung.gson.deserialization; import java.lang.reflect.Type; diff --git a/gson/src/test/java/org/baeldung/gson/deserialization/FooWithInner.java b/gson/src/test/java/com/baeldung/gson/deserialization/FooWithInner.java similarity index 92% rename from gson/src/test/java/org/baeldung/gson/deserialization/FooWithInner.java rename to gson/src/test/java/com/baeldung/gson/deserialization/FooWithInner.java index 705e534e77..ddad97b4ab 100644 --- a/gson/src/test/java/org/baeldung/gson/deserialization/FooWithInner.java +++ b/gson/src/test/java/com/baeldung/gson/deserialization/FooWithInner.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.deserialization; +package com.baeldung.gson.deserialization; public class FooWithInner { public int intValue; diff --git a/gson/src/test/java/org/baeldung/gson/deserialization/GenericFoo.java b/gson/src/test/java/com/baeldung/gson/deserialization/GenericFoo.java similarity index 85% rename from gson/src/test/java/org/baeldung/gson/deserialization/GenericFoo.java rename to gson/src/test/java/com/baeldung/gson/deserialization/GenericFoo.java index 954cf007cf..9a81d5ae7a 100644 --- a/gson/src/test/java/org/baeldung/gson/deserialization/GenericFoo.java +++ b/gson/src/test/java/com/baeldung/gson/deserialization/GenericFoo.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.deserialization; +package com.baeldung.gson.deserialization; public class GenericFoo { diff --git a/gson/src/test/java/org/baeldung/gson/deserialization/GsonAlternateUnitTest.java b/gson/src/test/java/com/baeldung/gson/deserialization/GsonAlternateUnitTest.java similarity index 92% rename from gson/src/test/java/org/baeldung/gson/deserialization/GsonAlternateUnitTest.java rename to gson/src/test/java/com/baeldung/gson/deserialization/GsonAlternateUnitTest.java index f3a5d24e3e..c49a1ea568 100644 --- a/gson/src/test/java/org/baeldung/gson/deserialization/GsonAlternateUnitTest.java +++ b/gson/src/test/java/com/baeldung/gson/deserialization/GsonAlternateUnitTest.java @@ -1,8 +1,8 @@ -package org.baeldung.gson.deserialization; +package com.baeldung.gson.deserialization; import static org.junit.Assert.assertEquals; -import org.baeldung.gson.entities.Weather; +import com.baeldung.gson.entities.Weather; import org.junit.Test; import com.google.gson.Gson; diff --git a/gson/src/test/java/org/baeldung/gson/deserialization/GsonDeserializeUnitTest.java b/gson/src/test/java/com/baeldung/gson/deserialization/GsonDeserializeUnitTest.java similarity index 90% rename from gson/src/test/java/org/baeldung/gson/deserialization/GsonDeserializeUnitTest.java rename to gson/src/test/java/com/baeldung/gson/deserialization/GsonDeserializeUnitTest.java index 40e8524744..73e76967b9 100644 --- a/gson/src/test/java/org/baeldung/gson/deserialization/GsonDeserializeUnitTest.java +++ b/gson/src/test/java/com/baeldung/gson/deserialization/GsonDeserializeUnitTest.java @@ -1,10 +1,10 @@ -package org.baeldung.gson.deserialization; +package com.baeldung.gson.deserialization; import java.text.ParseException; -import org.baeldung.gson.entities.ActorGson; -import org.baeldung.gson.entities.Movie; -import org.baeldung.gson.serialization.ActorGsonDeserializer; +import com.baeldung.gson.entities.Movie; +import com.baeldung.gson.serialization.ActorGsonDeserializer; +import com.baeldung.gson.entities.ActorGson; import org.junit.Assert; import org.junit.Test; diff --git a/gson/src/test/java/org/baeldung/gson/deserialization/MapDeserializationUnitTest.java b/gson/src/test/java/com/baeldung/gson/deserialization/MapDeserializationUnitTest.java similarity index 95% rename from gson/src/test/java/org/baeldung/gson/deserialization/MapDeserializationUnitTest.java rename to gson/src/test/java/com/baeldung/gson/deserialization/MapDeserializationUnitTest.java index a5ae4194e8..77c934283a 100644 --- a/gson/src/test/java/org/baeldung/gson/deserialization/MapDeserializationUnitTest.java +++ b/gson/src/test/java/com/baeldung/gson/deserialization/MapDeserializationUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.deserialization; +package com.baeldung.gson.deserialization; import java.lang.reflect.Type; import java.text.ParseException; @@ -6,9 +6,9 @@ import java.util.Date; import java.util.Map; import org.apache.commons.lang3.time.DateUtils; -import org.baeldung.gson.entities.Employee; -import org.baeldung.gson.serialization.MapDeserializer; -import org.baeldung.gson.serialization.StringDateMapDeserializer; +import com.baeldung.gson.entities.Employee; +import com.baeldung.gson.serialization.MapDeserializer; +import com.baeldung.gson.serialization.StringDateMapDeserializer; import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; diff --git a/gson/src/test/java/org/baeldung/gson/deserialization/test/GsonDeserializationUnitTest.java b/gson/src/test/java/com/baeldung/gson/deserialization/test/GsonDeserializationUnitTest.java similarity index 93% rename from gson/src/test/java/org/baeldung/gson/deserialization/test/GsonDeserializationUnitTest.java rename to gson/src/test/java/com/baeldung/gson/deserialization/test/GsonDeserializationUnitTest.java index 784bb45a6a..adc046ed8e 100644 --- a/gson/src/test/java/org/baeldung/gson/deserialization/test/GsonDeserializationUnitTest.java +++ b/gson/src/test/java/com/baeldung/gson/deserialization/test/GsonDeserializationUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.deserialization.test; +package com.baeldung.gson.deserialization.test; import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.Matchers.instanceOf; @@ -10,11 +10,11 @@ import java.lang.reflect.Type; import java.util.ArrayList; import java.util.Collection; -import org.baeldung.gson.deserialization.Foo; -import org.baeldung.gson.deserialization.FooDeserializerFromJsonWithDifferentFields; -import org.baeldung.gson.deserialization.FooInstanceCreator; -import org.baeldung.gson.deserialization.FooWithInner; -import org.baeldung.gson.deserialization.GenericFoo; +import com.baeldung.gson.deserialization.Foo; +import com.baeldung.gson.deserialization.FooDeserializerFromJsonWithDifferentFields; +import com.baeldung.gson.deserialization.FooInstanceCreator; +import com.baeldung.gson.deserialization.FooWithInner; +import com.baeldung.gson.deserialization.GenericFoo; import org.junit.Test; import com.google.common.collect.Lists; diff --git a/gson/src/test/java/org/baeldung/gson/primitives/PrimitiveValuesUnitTest.java b/gson/src/test/java/com/baeldung/gson/primitives/PrimitiveValuesUnitTest.java similarity index 99% rename from gson/src/test/java/org/baeldung/gson/primitives/PrimitiveValuesUnitTest.java rename to gson/src/test/java/com/baeldung/gson/primitives/PrimitiveValuesUnitTest.java index 7d249bc55c..e1241fa92a 100644 --- a/gson/src/test/java/org/baeldung/gson/primitives/PrimitiveValuesUnitTest.java +++ b/gson/src/test/java/com/baeldung/gson/primitives/PrimitiveValuesUnitTest.java @@ -1,7 +1,7 @@ -package org.baeldung.gson.primitives; +package com.baeldung.gson.primitives; +import com.baeldung.gson.primitives.models.*; import com.google.gson.*; -import org.baeldung.gson.primitives.models.*; import org.junit.Test; import java.lang.reflect.Type; diff --git a/gson/src/test/java/org/baeldung/gson/serialization/DifferentNameSerializer.java b/gson/src/test/java/com/baeldung/gson/serialization/DifferentNameSerializer.java similarity index 94% rename from gson/src/test/java/org/baeldung/gson/serialization/DifferentNameSerializer.java rename to gson/src/test/java/com/baeldung/gson/serialization/DifferentNameSerializer.java index 9cef1da37b..b82f90f476 100644 --- a/gson/src/test/java/org/baeldung/gson/serialization/DifferentNameSerializer.java +++ b/gson/src/test/java/com/baeldung/gson/serialization/DifferentNameSerializer.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serialization; +package com.baeldung.gson.serialization; import java.lang.reflect.Type; diff --git a/gson/src/test/java/org/baeldung/gson/serialization/GsonSerializeUnitTest.java b/gson/src/test/java/com/baeldung/gson/serialization/GsonSerializeUnitTest.java similarity index 92% rename from gson/src/test/java/org/baeldung/gson/serialization/GsonSerializeUnitTest.java rename to gson/src/test/java/com/baeldung/gson/serialization/GsonSerializeUnitTest.java index 4392ea1631..d5051060c4 100644 --- a/gson/src/test/java/org/baeldung/gson/serialization/GsonSerializeUnitTest.java +++ b/gson/src/test/java/com/baeldung/gson/serialization/GsonSerializeUnitTest.java @@ -1,11 +1,11 @@ -package org.baeldung.gson.serialization; +package com.baeldung.gson.serialization; +import com.baeldung.gson.entities.Movie; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonParser; -import org.baeldung.gson.entities.ActorGson; -import org.baeldung.gson.entities.Movie; -import org.baeldung.gson.entities.MovieWithNullValue; +import com.baeldung.gson.entities.ActorGson; +import com.baeldung.gson.entities.MovieWithNullValue; import org.junit.Assert; import org.junit.Test; diff --git a/gson/src/test/java/org/baeldung/gson/serialization/IgnoringFieldsNotMatchingCriteriaSerializer.java b/gson/src/test/java/com/baeldung/gson/serialization/IgnoringFieldsNotMatchingCriteriaSerializer.java similarity index 95% rename from gson/src/test/java/org/baeldung/gson/serialization/IgnoringFieldsNotMatchingCriteriaSerializer.java rename to gson/src/test/java/com/baeldung/gson/serialization/IgnoringFieldsNotMatchingCriteriaSerializer.java index 769a4d33a7..554d63b29b 100644 --- a/gson/src/test/java/org/baeldung/gson/serialization/IgnoringFieldsNotMatchingCriteriaSerializer.java +++ b/gson/src/test/java/com/baeldung/gson/serialization/IgnoringFieldsNotMatchingCriteriaSerializer.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serialization; +package com.baeldung.gson.serialization; import com.google.gson.JsonElement; import com.google.gson.JsonObject; diff --git a/gson/src/test/java/org/baeldung/gson/serialization/IgnoringFieldsSerializer.java b/gson/src/test/java/com/baeldung/gson/serialization/IgnoringFieldsSerializer.java similarity index 93% rename from gson/src/test/java/org/baeldung/gson/serialization/IgnoringFieldsSerializer.java rename to gson/src/test/java/com/baeldung/gson/serialization/IgnoringFieldsSerializer.java index bd1928cb18..7f251894a0 100644 --- a/gson/src/test/java/org/baeldung/gson/serialization/IgnoringFieldsSerializer.java +++ b/gson/src/test/java/com/baeldung/gson/serialization/IgnoringFieldsSerializer.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serialization; +package com.baeldung.gson.serialization; import java.lang.reflect.Type; diff --git a/gson/src/test/java/org/baeldung/gson/serialization/SourceClass.java b/gson/src/test/java/com/baeldung/gson/serialization/SourceClass.java similarity index 96% rename from gson/src/test/java/org/baeldung/gson/serialization/SourceClass.java rename to gson/src/test/java/com/baeldung/gson/serialization/SourceClass.java index 02de2636c2..181f1134b5 100644 --- a/gson/src/test/java/org/baeldung/gson/serialization/SourceClass.java +++ b/gson/src/test/java/com/baeldung/gson/serialization/SourceClass.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serialization; +package com.baeldung.gson.serialization; public class SourceClass { private int intValue; diff --git a/gson/src/test/java/org/baeldung/gson/serialization/test/GsonSerializationUnitTest.java b/gson/src/test/java/com/baeldung/gson/serialization/test/GsonSerializationUnitTest.java similarity index 91% rename from gson/src/test/java/org/baeldung/gson/serialization/test/GsonSerializationUnitTest.java rename to gson/src/test/java/com/baeldung/gson/serialization/test/GsonSerializationUnitTest.java index 6806c470b9..4780b8a6bf 100644 --- a/gson/src/test/java/org/baeldung/gson/serialization/test/GsonSerializationUnitTest.java +++ b/gson/src/test/java/com/baeldung/gson/serialization/test/GsonSerializationUnitTest.java @@ -1,18 +1,16 @@ -package org.baeldung.gson.serialization.test; +package com.baeldung.gson.serialization.test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.lang.reflect.Type; -import java.util.Calendar; import java.util.Collection; import java.util.Date; -import java.util.GregorianCalendar; -import org.baeldung.gson.serialization.DifferentNameSerializer; -import org.baeldung.gson.serialization.IgnoringFieldsNotMatchingCriteriaSerializer; -import org.baeldung.gson.serialization.IgnoringFieldsSerializer; -import org.baeldung.gson.serialization.SourceClass; +import com.baeldung.gson.serialization.DifferentNameSerializer; +import com.baeldung.gson.serialization.IgnoringFieldsNotMatchingCriteriaSerializer; +import com.baeldung.gson.serialization.IgnoringFieldsSerializer; +import com.baeldung.gson.serialization.SourceClass; import org.joda.time.DateTime; import org.junit.Test; diff --git a/gson/src/test/java/org/baeldung/gson/serialization/test/JsonFileUnitTest.java b/gson/src/test/java/com/baeldung/gson/serialization/test/JsonFileUnitTest.java similarity index 88% rename from gson/src/test/java/org/baeldung/gson/serialization/test/JsonFileUnitTest.java rename to gson/src/test/java/com/baeldung/gson/serialization/test/JsonFileUnitTest.java index f6a8de080c..8e58435520 100644 --- a/gson/src/test/java/org/baeldung/gson/serialization/test/JsonFileUnitTest.java +++ b/gson/src/test/java/com/baeldung/gson/serialization/test/JsonFileUnitTest.java @@ -1,43 +1,43 @@ -package org.baeldung.gson.serialization.test; - -import java.io.FileWriter; -import java.io.IOException; -import java.io.Writer; -import java.nio.file.Files; -import java.nio.file.Paths; - -import org.baeldung.gson.entities.User; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import org.junit.runners.Parameterized.Parameter; -import org.junit.runners.Parameterized.Parameters; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; - -@RunWith(Parameterized.class) -public class JsonFileUnitTest { - - @Parameter - public Object object; - - @Parameters - public static Object[] data() { - return new Object[] { 123.45, new User(1, "Tom", "American") }; - } - - @Test - public void givenProperData_whenStoredInFile_shouldSaveJsonSuccessfully() { - String filePath = "target/output.json"; - try (Writer writer = new FileWriter(filePath)) { - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - gson.toJson(object, writer); - Assert.assertTrue(Files.exists(Paths.get(filePath))); - } catch (IOException e) { - e.printStackTrace(); - } - } - -} +package com.baeldung.gson.serialization.test; + +import java.io.FileWriter; +import java.io.IOException; +import java.io.Writer; +import java.nio.file.Files; +import java.nio.file.Paths; + +import com.baeldung.gson.entities.User; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameter; +import org.junit.runners.Parameterized.Parameters; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +@RunWith(Parameterized.class) +public class JsonFileUnitTest { + + @Parameter + public Object object; + + @Parameters + public static Object[] data() { + return new Object[] { 123.45, new User(1, "Tom", "American") }; + } + + @Test + public void givenProperData_whenStoredInFile_shouldSaveJsonSuccessfully() { + String filePath = "target/output.json"; + try (Writer writer = new FileWriter(filePath)) { + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + gson.toJson(object, writer); + Assert.assertTrue(Files.exists(Paths.get(filePath))); + } catch (IOException e) { + e.printStackTrace(); + } + } + +} diff --git a/gson/src/test/java/org/baeldung/gson/serializationwithexclusions/SerializationWithExclusionsUnitTest.java b/gson/src/test/java/com/baeldung/gson/serializationwithexclusions/SerializationWithExclusionsUnitTest.java similarity index 98% rename from gson/src/test/java/org/baeldung/gson/serializationwithexclusions/SerializationWithExclusionsUnitTest.java rename to gson/src/test/java/com/baeldung/gson/serializationwithexclusions/SerializationWithExclusionsUnitTest.java index 632d06946b..d677f0b271 100644 --- a/gson/src/test/java/org/baeldung/gson/serializationwithexclusions/SerializationWithExclusionsUnitTest.java +++ b/gson/src/test/java/com/baeldung/gson/serializationwithexclusions/SerializationWithExclusionsUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serializationwithexclusions; +package com.baeldung.gson.serializationwithexclusions; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/guava/src/main/java/org/baeldung/guava/CustomEvent.java b/guava/src/main/java/com/baeldung/guava/CustomEvent.java similarity index 90% rename from guava/src/main/java/org/baeldung/guava/CustomEvent.java rename to guava/src/main/java/com/baeldung/guava/CustomEvent.java index 8534d7da1c..a154790374 100644 --- a/guava/src/main/java/org/baeldung/guava/CustomEvent.java +++ b/guava/src/main/java/com/baeldung/guava/CustomEvent.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; public class CustomEvent { private String action; diff --git a/guava/src/main/java/org/baeldung/guava/EventListener.java b/guava/src/main/java/com/baeldung/guava/EventListener.java similarity index 97% rename from guava/src/main/java/org/baeldung/guava/EventListener.java rename to guava/src/main/java/com/baeldung/guava/EventListener.java index 60beebeea5..7bcfbcb8e9 100644 --- a/guava/src/main/java/org/baeldung/guava/EventListener.java +++ b/guava/src/main/java/com/baeldung/guava/EventListener.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import com.google.common.eventbus.DeadEvent; import com.google.common.eventbus.Subscribe; diff --git a/guava/src/main/java/org/baeldung/guava/memoizer/CostlySupplier.java b/guava/src/main/java/com/baeldung/guava/memoizer/CostlySupplier.java similarity index 89% rename from guava/src/main/java/org/baeldung/guava/memoizer/CostlySupplier.java rename to guava/src/main/java/com/baeldung/guava/memoizer/CostlySupplier.java index 63b3fbd438..9a929a15bd 100644 --- a/guava/src/main/java/org/baeldung/guava/memoizer/CostlySupplier.java +++ b/guava/src/main/java/com/baeldung/guava/memoizer/CostlySupplier.java @@ -1,4 +1,4 @@ -package org.baeldung.guava.memoizer; +package com.baeldung.guava.memoizer; import java.math.BigInteger; import java.util.Random; diff --git a/guava/src/main/java/org/baeldung/guava/memoizer/Factorial.java b/guava/src/main/java/com/baeldung/guava/memoizer/Factorial.java similarity index 93% rename from guava/src/main/java/org/baeldung/guava/memoizer/Factorial.java rename to guava/src/main/java/com/baeldung/guava/memoizer/Factorial.java index 74fcbdcc14..6497979682 100644 --- a/guava/src/main/java/org/baeldung/guava/memoizer/Factorial.java +++ b/guava/src/main/java/com/baeldung/guava/memoizer/Factorial.java @@ -1,4 +1,4 @@ -package org.baeldung.guava.memoizer; +package com.baeldung.guava.memoizer; import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; diff --git a/guava/src/main/java/org/baeldung/guava/memoizer/FibonacciSequence.java b/guava/src/main/java/com/baeldung/guava/memoizer/FibonacciSequence.java similarity index 90% rename from guava/src/main/java/org/baeldung/guava/memoizer/FibonacciSequence.java rename to guava/src/main/java/com/baeldung/guava/memoizer/FibonacciSequence.java index 0c70f08c23..d0462fb001 100644 --- a/guava/src/main/java/org/baeldung/guava/memoizer/FibonacciSequence.java +++ b/guava/src/main/java/com/baeldung/guava/memoizer/FibonacciSequence.java @@ -1,11 +1,10 @@ -package org.baeldung.guava.memoizer; +package com.baeldung.guava.memoizer; import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; import com.google.common.cache.LoadingCache; import java.math.BigInteger; -import java.util.concurrent.TimeUnit; public class FibonacciSequence { diff --git a/guava/src/test/java/org/baeldung/guava/BloomFilterUnitTest.java b/guava/src/test/java/com/baeldung/guava/BloomFilterUnitTest.java similarity index 98% rename from guava/src/test/java/org/baeldung/guava/BloomFilterUnitTest.java rename to guava/src/test/java/com/baeldung/guava/BloomFilterUnitTest.java index ff3031a0cb..c11bf27256 100644 --- a/guava/src/test/java/org/baeldung/guava/BloomFilterUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/BloomFilterUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import com.google.common.hash.BloomFilter; diff --git a/guava/src/test/java/org/baeldung/guava/GuavaBigIntegerMathUnitTest.java b/guava/src/test/java/com/baeldung/guava/GuavaBigIntegerMathUnitTest.java similarity index 99% rename from guava/src/test/java/org/baeldung/guava/GuavaBigIntegerMathUnitTest.java rename to guava/src/test/java/com/baeldung/guava/GuavaBigIntegerMathUnitTest.java index f5afe20fc2..cca42a688f 100644 --- a/guava/src/test/java/org/baeldung/guava/GuavaBigIntegerMathUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/GuavaBigIntegerMathUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; diff --git a/guava/src/test/java/org/baeldung/guava/GuavaCacheLoaderUnitTest.java b/guava/src/test/java/com/baeldung/guava/GuavaCacheLoaderUnitTest.java similarity index 98% rename from guava/src/test/java/org/baeldung/guava/GuavaCacheLoaderUnitTest.java rename to guava/src/test/java/com/baeldung/guava/GuavaCacheLoaderUnitTest.java index e27171bb84..bf9747ec18 100644 --- a/guava/src/test/java/org/baeldung/guava/GuavaCacheLoaderUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/GuavaCacheLoaderUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; diff --git a/guava/src/test/java/org/baeldung/guava/GuavaCacheUnitTest.java b/guava/src/test/java/com/baeldung/guava/GuavaCacheUnitTest.java similarity index 99% rename from guava/src/test/java/org/baeldung/guava/GuavaCacheUnitTest.java rename to guava/src/test/java/com/baeldung/guava/GuavaCacheUnitTest.java index 49ce6b1a09..8aa56c7c52 100644 --- a/guava/src/test/java/org/baeldung/guava/GuavaCacheUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/GuavaCacheUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; diff --git a/guava/src/test/java/org/baeldung/guava/GuavaDoubleMathUnitTest.java b/guava/src/test/java/com/baeldung/guava/GuavaDoubleMathUnitTest.java similarity index 99% rename from guava/src/test/java/org/baeldung/guava/GuavaDoubleMathUnitTest.java rename to guava/src/test/java/com/baeldung/guava/GuavaDoubleMathUnitTest.java index b39770e2e7..9c78fb36fa 100644 --- a/guava/src/test/java/org/baeldung/guava/GuavaDoubleMathUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/GuavaDoubleMathUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import static org.junit.Assert.*; diff --git a/guava/src/test/java/org/baeldung/guava/GuavaEventBusUnitTest.java b/guava/src/test/java/com/baeldung/guava/GuavaEventBusUnitTest.java similarity index 97% rename from guava/src/test/java/org/baeldung/guava/GuavaEventBusUnitTest.java rename to guava/src/test/java/com/baeldung/guava/GuavaEventBusUnitTest.java index 1bc62af300..bb9d26fcce 100644 --- a/guava/src/test/java/org/baeldung/guava/GuavaEventBusUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/GuavaEventBusUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import com.google.common.eventbus.EventBus; import org.junit.After; diff --git a/guava/src/test/java/org/baeldung/guava/GuavaFunctionalExamplesUnitTest.java b/guava/src/test/java/com/baeldung/guava/GuavaFunctionalExamplesUnitTest.java similarity index 99% rename from guava/src/test/java/org/baeldung/guava/GuavaFunctionalExamplesUnitTest.java rename to guava/src/test/java/com/baeldung/guava/GuavaFunctionalExamplesUnitTest.java index c09ae696b3..b54a7c951a 100644 --- a/guava/src/test/java/org/baeldung/guava/GuavaFunctionalExamplesUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/GuavaFunctionalExamplesUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.equalTo; diff --git a/guava/src/test/java/org/baeldung/guava/GuavaIntMathUnitTest.java b/guava/src/test/java/com/baeldung/guava/GuavaIntMathUnitTest.java similarity index 99% rename from guava/src/test/java/org/baeldung/guava/GuavaIntMathUnitTest.java rename to guava/src/test/java/com/baeldung/guava/GuavaIntMathUnitTest.java index 9270212929..547f423396 100644 --- a/guava/src/test/java/org/baeldung/guava/GuavaIntMathUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/GuavaIntMathUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import static org.junit.Assert.*; diff --git a/guava/src/test/java/org/baeldung/guava/GuavaLongMathUnitTest.java b/guava/src/test/java/com/baeldung/guava/GuavaLongMathUnitTest.java similarity index 99% rename from guava/src/test/java/org/baeldung/guava/GuavaLongMathUnitTest.java rename to guava/src/test/java/com/baeldung/guava/GuavaLongMathUnitTest.java index 680f405149..33c28d4594 100644 --- a/guava/src/test/java/org/baeldung/guava/GuavaLongMathUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/GuavaLongMathUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import static org.junit.Assert.*; diff --git a/guava/src/test/java/org/baeldung/guava/GuavaMathUnitTest.java b/guava/src/test/java/com/baeldung/guava/GuavaMathUnitTest.java similarity index 99% rename from guava/src/test/java/org/baeldung/guava/GuavaMathUnitTest.java rename to guava/src/test/java/com/baeldung/guava/GuavaMathUnitTest.java index 1e1f806628..fce0fec13b 100644 --- a/guava/src/test/java/org/baeldung/guava/GuavaMathUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/GuavaMathUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import static org.hamcrest.core.IsEqual.equalTo; import static org.junit.Assert.*; diff --git a/guava/src/test/java/org/baeldung/guava/GuavaMemoizerUnitTest.java b/guava/src/test/java/com/baeldung/guava/GuavaMemoizerUnitTest.java similarity index 94% rename from guava/src/test/java/org/baeldung/guava/GuavaMemoizerUnitTest.java rename to guava/src/test/java/com/baeldung/guava/GuavaMemoizerUnitTest.java index 8c37ecf07c..9bafb7ad3f 100644 --- a/guava/src/test/java/org/baeldung/guava/GuavaMemoizerUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/GuavaMemoizerUnitTest.java @@ -1,9 +1,9 @@ -package org.baeldung.guava; +package com.baeldung.guava; import com.google.common.base.Suppliers; -import org.baeldung.guava.memoizer.CostlySupplier; -import org.baeldung.guava.memoizer.Factorial; -import org.baeldung.guava.memoizer.FibonacciSequence; +import com.baeldung.guava.memoizer.CostlySupplier; +import com.baeldung.guava.memoizer.Factorial; +import com.baeldung.guava.memoizer.FibonacciSequence; import org.junit.Test; import java.math.BigInteger; diff --git a/guava/src/test/java/org/baeldung/guava/GuavaPreConditionsUnitTest.java b/guava/src/test/java/com/baeldung/guava/GuavaPreConditionsUnitTest.java similarity index 99% rename from guava/src/test/java/org/baeldung/guava/GuavaPreConditionsUnitTest.java rename to guava/src/test/java/com/baeldung/guava/GuavaPreConditionsUnitTest.java index 6bf9e5c7a2..fe3be9abf0 100644 --- a/guava/src/test/java/org/baeldung/guava/GuavaPreConditionsUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/GuavaPreConditionsUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import static org.assertj.core.api.Assertions.assertThatThrownBy; import java.util.Arrays; diff --git a/guava/src/test/java/org/baeldung/guava/GuavaReflectionUtilsUnitTest.java b/guava/src/test/java/com/baeldung/guava/GuavaReflectionUtilsUnitTest.java similarity index 99% rename from guava/src/test/java/org/baeldung/guava/GuavaReflectionUtilsUnitTest.java rename to guava/src/test/java/com/baeldung/guava/GuavaReflectionUtilsUnitTest.java index f2d1c08ae9..36df241711 100644 --- a/guava/src/test/java/org/baeldung/guava/GuavaReflectionUtilsUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/GuavaReflectionUtilsUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import com.google.common.collect.Lists; diff --git a/guava/src/test/java/org/baeldung/guava/RateLimiterLongRunningUnitTest.java b/guava/src/test/java/com/baeldung/guava/RateLimiterLongRunningUnitTest.java similarity index 98% rename from guava/src/test/java/org/baeldung/guava/RateLimiterLongRunningUnitTest.java rename to guava/src/test/java/com/baeldung/guava/RateLimiterLongRunningUnitTest.java index 914de01a6d..7372e9f6e9 100644 --- a/guava/src/test/java/org/baeldung/guava/RateLimiterLongRunningUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/RateLimiterLongRunningUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import com.google.common.util.concurrent.RateLimiter; diff --git a/httpclient/src/test/java/org/baeldung/httpclient/HttpAsyncClientLiveTest.java b/httpclient/src/test/java/com/baeldung/httpclient/HttpAsyncClientLiveTest.java similarity index 99% rename from httpclient/src/test/java/org/baeldung/httpclient/HttpAsyncClientLiveTest.java rename to httpclient/src/test/java/com/baeldung/httpclient/HttpAsyncClientLiveTest.java index 47a587885e..082c282306 100644 --- a/httpclient/src/test/java/org/baeldung/httpclient/HttpAsyncClientLiveTest.java +++ b/httpclient/src/test/java/com/baeldung/httpclient/HttpAsyncClientLiveTest.java @@ -1,4 +1,4 @@ -package org.baeldung.httpclient; +package com.baeldung.httpclient; import static org.hamcrest.Matchers.equalTo; import static org.junit.Assert.assertThat; diff --git a/httpclient/src/test/java/org/baeldung/httpclient/HttpClientMultipartLiveTest.java b/httpclient/src/test/java/com/baeldung/httpclient/HttpClientMultipartLiveTest.java similarity index 98% rename from httpclient/src/test/java/org/baeldung/httpclient/HttpClientMultipartLiveTest.java rename to httpclient/src/test/java/com/baeldung/httpclient/HttpClientMultipartLiveTest.java index 1752c27286..7576e49034 100644 --- a/httpclient/src/test/java/org/baeldung/httpclient/HttpClientMultipartLiveTest.java +++ b/httpclient/src/test/java/com/baeldung/httpclient/HttpClientMultipartLiveTest.java @@ -1,4 +1,4 @@ -package org.baeldung.httpclient; +package com.baeldung.httpclient; import org.apache.http.HttpEntity; import org.apache.http.HttpStatus; @@ -38,7 +38,7 @@ public class HttpClientMultipartLiveTest { private static final String TEXTFILENAME = "temp.txt"; private static final String IMAGEFILENAME = "image.jpg"; private static final String ZIPFILENAME = "zipFile.zip"; - private static final Logger LOGGER = Logger.getLogger("org.baeldung.httpclient.HttpClientMultipartLiveTest"); + private static final Logger LOGGER = Logger.getLogger("com.baeldung.httpclient.HttpClientMultipartLiveTest"); private CloseableHttpClient client; private HttpPost post; private BufferedReader rd; diff --git a/httpclient/src/test/java/org/baeldung/httpclient/HttpClientRedirectLiveTest.java b/httpclient/src/test/java/com/baeldung/httpclient/HttpClientRedirectLiveTest.java similarity index 99% rename from httpclient/src/test/java/org/baeldung/httpclient/HttpClientRedirectLiveTest.java rename to httpclient/src/test/java/com/baeldung/httpclient/HttpClientRedirectLiveTest.java index a501367a6b..9a03ab02a5 100644 --- a/httpclient/src/test/java/org/baeldung/httpclient/HttpClientRedirectLiveTest.java +++ b/httpclient/src/test/java/com/baeldung/httpclient/HttpClientRedirectLiveTest.java @@ -1,4 +1,4 @@ -package org.baeldung.httpclient; +package com.baeldung.httpclient; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; diff --git a/httpclient/src/test/java/org/baeldung/httpclient/ResponseUtil.java b/httpclient/src/test/java/com/baeldung/httpclient/ResponseUtil.java similarity index 94% rename from httpclient/src/test/java/org/baeldung/httpclient/ResponseUtil.java rename to httpclient/src/test/java/com/baeldung/httpclient/ResponseUtil.java index fd38b95cbe..e9ea08a723 100644 --- a/httpclient/src/test/java/org/baeldung/httpclient/ResponseUtil.java +++ b/httpclient/src/test/java/com/baeldung/httpclient/ResponseUtil.java @@ -1,4 +1,4 @@ -package org.baeldung.httpclient; +package com.baeldung.httpclient; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; diff --git a/httpclient/src/test/java/org/baeldung/httpclient/advancedconfig/HttpClientAdvancedConfigurationIntegrationTest.java b/httpclient/src/test/java/com/baeldung/httpclient/advancedconfig/HttpClientAdvancedConfigurationIntegrationTest.java similarity index 99% rename from httpclient/src/test/java/org/baeldung/httpclient/advancedconfig/HttpClientAdvancedConfigurationIntegrationTest.java rename to httpclient/src/test/java/com/baeldung/httpclient/advancedconfig/HttpClientAdvancedConfigurationIntegrationTest.java index 77d5a298c1..2235d0e9d0 100644 --- a/httpclient/src/test/java/org/baeldung/httpclient/advancedconfig/HttpClientAdvancedConfigurationIntegrationTest.java +++ b/httpclient/src/test/java/com/baeldung/httpclient/advancedconfig/HttpClientAdvancedConfigurationIntegrationTest.java @@ -1,4 +1,4 @@ -package org.baeldung.httpclient.advancedconfig; +package com.baeldung.httpclient.advancedconfig; import com.github.tomakehurst.wiremock.junit.WireMockRule; diff --git a/httpclient/src/test/java/org/baeldung/httpclient/base/HttpClientBasicPostLiveTest.java b/httpclient/src/test/java/com/baeldung/httpclient/base/HttpClientBasicPostLiveTest.java similarity index 95% rename from httpclient/src/test/java/org/baeldung/httpclient/base/HttpClientBasicPostLiveTest.java rename to httpclient/src/test/java/com/baeldung/httpclient/base/HttpClientBasicPostLiveTest.java index fe275be082..9d4573084b 100644 --- a/httpclient/src/test/java/org/baeldung/httpclient/base/HttpClientBasicPostLiveTest.java +++ b/httpclient/src/test/java/com/baeldung/httpclient/base/HttpClientBasicPostLiveTest.java @@ -1,5 +1,6 @@ -package org.baeldung.httpclient.base; +package com.baeldung.httpclient.base; +import com.baeldung.httpclient.ResponseUtil; import org.apache.http.auth.AuthenticationException; import org.apache.http.auth.UsernamePasswordCredentials; import org.apache.http.client.methods.CloseableHttpResponse; @@ -8,7 +9,6 @@ import org.apache.http.entity.StringEntity; import org.apache.http.impl.auth.BasicScheme; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; -import org.baeldung.httpclient.ResponseUtil; import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/httpclient/src/test/java/org/baeldung/httpclient/base/HttpClientLiveTest.java b/httpclient/src/test/java/com/baeldung/httpclient/base/HttpClientLiveTest.java similarity index 97% rename from httpclient/src/test/java/org/baeldung/httpclient/base/HttpClientLiveTest.java rename to httpclient/src/test/java/com/baeldung/httpclient/base/HttpClientLiveTest.java index 78097227e7..ef12c37412 100644 --- a/httpclient/src/test/java/org/baeldung/httpclient/base/HttpClientLiveTest.java +++ b/httpclient/src/test/java/com/baeldung/httpclient/base/HttpClientLiveTest.java @@ -1,5 +1,6 @@ -package org.baeldung.httpclient.base; +package com.baeldung.httpclient.base; +import com.baeldung.httpclient.ResponseUtil; import org.apache.http.Header; import org.apache.http.HttpEntity; import org.apache.http.HttpHeaders; @@ -11,7 +12,6 @@ import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.impl.client.HttpClients; import org.apache.http.impl.conn.BasicHttpClientConnectionManager; -import org.baeldung.httpclient.ResponseUtil; import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/httpclient/src/test/java/org/baeldung/httpclient/base/HttpClientSandboxLiveTest.java b/httpclient/src/test/java/com/baeldung/httpclient/base/HttpClientSandboxLiveTest.java similarity index 94% rename from httpclient/src/test/java/org/baeldung/httpclient/base/HttpClientSandboxLiveTest.java rename to httpclient/src/test/java/com/baeldung/httpclient/base/HttpClientSandboxLiveTest.java index d945d075f2..c667ae36f6 100644 --- a/httpclient/src/test/java/org/baeldung/httpclient/base/HttpClientSandboxLiveTest.java +++ b/httpclient/src/test/java/com/baeldung/httpclient/base/HttpClientSandboxLiveTest.java @@ -1,5 +1,6 @@ -package org.baeldung.httpclient.base; +package com.baeldung.httpclient.base; +import com.baeldung.httpclient.ResponseUtil; import org.apache.http.auth.AuthScope; import org.apache.http.auth.UsernamePasswordCredentials; import org.apache.http.client.CredentialsProvider; @@ -8,7 +9,6 @@ import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.BasicCredentialsProvider; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; -import org.baeldung.httpclient.ResponseUtil; import org.junit.Test; import java.io.IOException; diff --git a/httpclient/src/test/java/org/baeldung/httpclient/conn/HttpClientConnectionManagementLiveTest.java b/httpclient/src/test/java/com/baeldung/httpclient/conn/HttpClientConnectionManagementLiveTest.java similarity index 99% rename from httpclient/src/test/java/org/baeldung/httpclient/conn/HttpClientConnectionManagementLiveTest.java rename to httpclient/src/test/java/com/baeldung/httpclient/conn/HttpClientConnectionManagementLiveTest.java index cf945098db..823b506113 100644 --- a/httpclient/src/test/java/org/baeldung/httpclient/conn/HttpClientConnectionManagementLiveTest.java +++ b/httpclient/src/test/java/com/baeldung/httpclient/conn/HttpClientConnectionManagementLiveTest.java @@ -1,4 +1,4 @@ -package org.baeldung.httpclient.conn; +package com.baeldung.httpclient.conn; import org.apache.http.HeaderElement; import org.apache.http.HeaderElementIterator; diff --git a/httpclient/src/test/java/org/baeldung/httpclient/conn/IdleConnectionMonitorThread.java b/httpclient/src/test/java/com/baeldung/httpclient/conn/IdleConnectionMonitorThread.java similarity index 96% rename from httpclient/src/test/java/org/baeldung/httpclient/conn/IdleConnectionMonitorThread.java rename to httpclient/src/test/java/com/baeldung/httpclient/conn/IdleConnectionMonitorThread.java index ffe4155a78..f1d7cbc427 100644 --- a/httpclient/src/test/java/org/baeldung/httpclient/conn/IdleConnectionMonitorThread.java +++ b/httpclient/src/test/java/com/baeldung/httpclient/conn/IdleConnectionMonitorThread.java @@ -1,4 +1,4 @@ -package org.baeldung.httpclient.conn; +package com.baeldung.httpclient.conn; import java.util.concurrent.TimeUnit; diff --git a/httpclient/src/test/java/org/baeldung/httpclient/conn/MultiHttpClientConnThread.java b/httpclient/src/test/java/com/baeldung/httpclient/conn/MultiHttpClientConnThread.java similarity index 98% rename from httpclient/src/test/java/org/baeldung/httpclient/conn/MultiHttpClientConnThread.java rename to httpclient/src/test/java/com/baeldung/httpclient/conn/MultiHttpClientConnThread.java index 3794943f02..acadd1f240 100644 --- a/httpclient/src/test/java/org/baeldung/httpclient/conn/MultiHttpClientConnThread.java +++ b/httpclient/src/test/java/com/baeldung/httpclient/conn/MultiHttpClientConnThread.java @@ -1,4 +1,4 @@ -package org.baeldung.httpclient.conn; +package com.baeldung.httpclient.conn; import java.io.IOException; diff --git a/httpclient/src/test/java/org/baeldung/httpclient/conn/TesterVersion_MultiHttpClientConnThread.java b/httpclient/src/test/java/com/baeldung/httpclient/conn/TesterVersion_MultiHttpClientConnThread.java similarity index 97% rename from httpclient/src/test/java/org/baeldung/httpclient/conn/TesterVersion_MultiHttpClientConnThread.java rename to httpclient/src/test/java/com/baeldung/httpclient/conn/TesterVersion_MultiHttpClientConnThread.java index 9cc6480e74..a50858672e 100644 --- a/httpclient/src/test/java/org/baeldung/httpclient/conn/TesterVersion_MultiHttpClientConnThread.java +++ b/httpclient/src/test/java/com/baeldung/httpclient/conn/TesterVersion_MultiHttpClientConnThread.java @@ -1,4 +1,4 @@ -package org.baeldung.httpclient.conn; +package com.baeldung.httpclient.conn; import java.io.IOException; diff --git a/httpclient/src/test/java/org/baeldung/httpclient/rare/HttpClientUnshortenLiveTest.java b/httpclient/src/test/java/com/baeldung/httpclient/rare/HttpClientUnshortenLiveTest.java similarity index 99% rename from httpclient/src/test/java/org/baeldung/httpclient/rare/HttpClientUnshortenLiveTest.java rename to httpclient/src/test/java/com/baeldung/httpclient/rare/HttpClientUnshortenLiveTest.java index 8fc79baed9..efa7953ba8 100644 --- a/httpclient/src/test/java/org/baeldung/httpclient/rare/HttpClientUnshortenLiveTest.java +++ b/httpclient/src/test/java/com/baeldung/httpclient/rare/HttpClientUnshortenLiveTest.java @@ -1,4 +1,4 @@ -package org.baeldung.httpclient.rare; +package com.baeldung.httpclient.rare; import com.google.common.base.Preconditions; import com.google.common.collect.Lists; diff --git a/java-rmi/README.md b/java-rmi/README.md index 244f986639..6d2d144cdf 100644 --- a/java-rmi/README.md +++ b/java-rmi/README.md @@ -1,6 +1,6 @@ ## Java RMI -This module contains articles about RMI (Remote Method Invocation) in Java. +This module contains articles about Remote Method Invocation (RMI) in Java. ### Relevant articles diff --git a/java-spi/README.md b/java-spi/README.md index 2ccef98a10..35567ab4dc 100644 --- a/java-spi/README.md +++ b/java-spi/README.md @@ -1,6 +1,6 @@ ## Java SPI -This module contains articles about the SPI (Service Provider Interface) in Java. +This module contains articles about the Service Provider Interface (SPI) in Java. ### Relevant Articles: diff --git a/libraries-http/src/test/java/com/baeldung/okhttp/OkHttpPostingLiveTest.java b/libraries-http/src/test/java/com/baeldung/okhttp/post/OkHttpPostingLiveTest.java similarity index 63% rename from libraries-http/src/test/java/com/baeldung/okhttp/OkHttpPostingLiveTest.java rename to libraries-http/src/test/java/com/baeldung/okhttp/post/OkHttpPostingLiveTest.java index 19e689c093..94ab344060 100644 --- a/libraries-http/src/test/java/com/baeldung/okhttp/OkHttpPostingLiveTest.java +++ b/libraries-http/src/test/java/com/baeldung/okhttp/post/OkHttpPostingLiveTest.java @@ -1,88 +1,122 @@ -package com.baeldung.okhttp; - -import static com.baeldung.client.Consts.APPLICATION_PORT; -import static org.hamcrest.Matchers.equalTo; -import static org.junit.Assert.assertThat; - -import java.io.File; -import java.io.IOException; - -import okhttp3.Call; -import okhttp3.Credentials; -import okhttp3.FormBody; -import okhttp3.MediaType; -import okhttp3.MultipartBody; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; - -import org.junit.Before; -import org.junit.Test; - -/** - * Execute spring-rest module before running this live test - */ -public class OkHttpPostingLiveTest { - - private static final String BASE_URL = "http://localhost:" + APPLICATION_PORT + "/spring-rest"; - private static final String URL_SECURED_BY_BASIC_AUTHENTICATION = "http://browserspy.dk/password-ok.php"; - - OkHttpClient client; - - @Before - public void init() { - - client = new OkHttpClient(); - } - - @Test - public void whenSendPostRequest_thenCorrect() throws IOException { - final RequestBody formBody = new FormBody.Builder().add("username", "test").add("password", "test").build(); - - final Request request = new Request.Builder().url(BASE_URL + "/users").post(formBody).build(); - - final Call call = client.newCall(request); - final Response response = call.execute(); - - assertThat(response.code(), equalTo(200)); - } - - @Test - public void whenSendPostRequestWithAuthorization_thenCorrect() throws IOException { - final String postBody = "test post"; - - final Request request = new Request.Builder().url(URL_SECURED_BY_BASIC_AUTHENTICATION).addHeader("Authorization", Credentials.basic("test", "test")).post(RequestBody.create(MediaType.parse("text/x-markdown; charset=utf-8"), "test post")).build(); - - final Call call = client.newCall(request); - final Response response = call.execute(); - - assertThat(response.code(), equalTo(200)); - } - - @Test - public void whenPostJson_thenCorrect() throws IOException { - final String json = "{\"id\":1,\"name\":\"John\"}"; - - final RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), "{\"id\":1,\"name\":\"John\"}"); - final Request request = new Request.Builder().url(BASE_URL + "/users/detail").post(body).build(); - - final Call call = client.newCall(request); - final Response response = call.execute(); - - assertThat(response.code(), equalTo(200)); - } - - @Test - public void whenSendMultipartRequest_thenCorrect() throws IOException { - final RequestBody requestBody = new MultipartBody.Builder().setType(MultipartBody.FORM).addFormDataPart("username", "test").addFormDataPart("password", "test") - .addFormDataPart("file", "file.txt", RequestBody.create(MediaType.parse("application/octet-stream"), new File("src/test/resources/test.txt"))).build(); - - final Request request = new Request.Builder().url(BASE_URL + "/users/multipart").post(requestBody).build(); - - final Call call = client.newCall(request); - final Response response = call.execute(); - - assertThat(response.code(), equalTo(200)); - } -} +package com.baeldung.okhttp.post; + +import static com.baeldung.client.Consts.APPLICATION_PORT; +import static org.hamcrest.Matchers.equalTo; +import static org.junit.Assert.assertThat; + +import java.io.File; +import java.io.IOException; + +import okhttp3.Call; +import okhttp3.Credentials; +import okhttp3.FormBody; +import okhttp3.MediaType; +import okhttp3.MultipartBody; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; + +import org.junit.Before; +import org.junit.Test; + +/** + * Execute spring-rest module before running this live test + */ +public class OkHttpPostingLiveTest { + + private static final String BASE_URL = "http://localhost:" + APPLICATION_PORT + "/spring-rest"; + private static final String URL_SECURED_BY_BASIC_AUTHENTICATION = "http://browserspy.dk/password-ok.php"; + + OkHttpClient client; + + @Before + public void init() { + + client = new OkHttpClient(); + } + + @Test + public void whenSendPostRequest_thenCorrect() throws IOException { + final RequestBody formBody = new FormBody.Builder() + .add("username", "test") + .add("password", "test") + .build(); + + final Request request = new Request.Builder() + .url(BASE_URL + "/users") + .post(formBody) + .build(); + + final Call call = client.newCall(request); + final Response response = call.execute(); + + assertThat(response.code(), equalTo(200)); + } + + @Test + public void whenSendPostRequestWithAuthorization_thenCorrect() throws IOException { + final String postBody = "test post"; + + final Request request = new Request.Builder() + .url(URL_SECURED_BY_BASIC_AUTHENTICATION) + .addHeader("Authorization", Credentials.basic("test", "test")) + .post(RequestBody.create(MediaType.parse("text/x-markdown"), "test post")) + .build(); + + final Call call = client.newCall(request); + final Response response = call.execute(); + + assertThat(response.code(), equalTo(200)); + } + + @Test + public void whenPostJson_thenCorrect() throws IOException { + final String json = "{\"id\":1,\"name\":\"John\"}"; + + final RequestBody body = RequestBody.create(MediaType.parse("application/json"), "{\"id\":1,\"name\":\"John\"}"); + final Request request = new Request.Builder().url(BASE_URL + "/users/detail").post(body).build(); + + final Call call = client.newCall(request); + final Response response = call.execute(); + + assertThat(response.code(), equalTo(200)); + } + + @Test + public void whenPostJsonWithoutCharset_thenCharsetIsUtf8() throws IOException { + final String json = "{\"id\":1,\"name\":\"John\"}"; + + final RequestBody body = RequestBody.create( + MediaType.parse("application/json"), json); + + String charset = body.contentType().charset().displayName(); + + assertThat(charset, equalTo("UTF-8")); + } + + @Test + public void whenPostJsonWithUtf16Charset_thenCharsetIsUtf16() throws IOException { + final String json = "{\"id\":1,\"name\":\"John\"}"; + + final RequestBody body = RequestBody.create( + MediaType.parse("application/json; charset=utf-16"), json); + + String charset = body.contentType().charset().displayName(); + + assertThat(charset, equalTo("UTF-16")); + } + + @Test + public void whenSendMultipartRequest_thenCorrect() throws IOException { + final RequestBody requestBody = new MultipartBody.Builder().setType(MultipartBody.FORM).addFormDataPart("username", "test").addFormDataPart("password", "test") + .addFormDataPart("file", "file.txt", RequestBody.create(MediaType.parse("application/octet-stream"), new File("src/test/resources/test.txt"))).build(); + + final Request request = new Request.Builder().url(BASE_URL + "/users/multipart").post(requestBody).build(); + + final Call call = client.newCall(request); + final Response response = call.execute(); + + assertThat(response.code(), equalTo(200)); + } +} diff --git a/persistence-modules/hibernate5-2/README.md b/persistence-modules/hibernate5-2/README.md index 75d50cd0b4..0b6be27410 100644 --- a/persistence-modules/hibernate5-2/README.md +++ b/persistence-modules/hibernate5-2/README.md @@ -1,3 +1,8 @@ +## Hibernate 5 + +This module contains articles about Hibernate 5. + ### Relevant Articles: - [Hibernate Error “Not all named parameters have been set”](https://www.baeldung.com/hibernate-error-named-parameters-not-set) - [FetchMode in Spring Data JPA](https://www.baeldung.com/spring-data-jpa-fetchmode) +- [[<-- Prev]](/hibernate5) \ No newline at end of file diff --git a/persistence-modules/hibernate5-2/pom.xml b/persistence-modules/hibernate5-2/pom.xml index 16f6c10a7a..dfee4bb81e 100644 --- a/persistence-modules/hibernate5-2/pom.xml +++ b/persistence-modules/hibernate5-2/pom.xml @@ -21,6 +21,32 @@ hibernate-core 5.4.7.Final + + org.springframework.boot + spring-boot-starter-web + ${spring-boot.version} + + + org.springframework.boot + spring-boot-starter-thymeleaf + ${spring-boot.version} + + + org.springframework.boot + spring-boot-starter-data-jpa + ${spring-boot.version} + + + com.zaxxer + HikariCP + + + + + org.springframework.boot + spring-boot-starter-test + ${spring-boot.version} + com.h2database @@ -37,6 +63,7 @@ true + 2.1.7.RELEASE diff --git a/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/persistencecontext/PersistenceContextDemoApplication.java b/persistence-modules/hibernate5-2/src/main/java/com/baeldung/persistencecontext/PersistenceContextDemoApplication.java similarity index 100% rename from persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/persistencecontext/PersistenceContextDemoApplication.java rename to persistence-modules/hibernate5-2/src/main/java/com/baeldung/persistencecontext/PersistenceContextDemoApplication.java diff --git a/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/persistencecontext/entity/User.java b/persistence-modules/hibernate5-2/src/main/java/com/baeldung/persistencecontext/entity/User.java similarity index 100% rename from persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/persistencecontext/entity/User.java rename to persistence-modules/hibernate5-2/src/main/java/com/baeldung/persistencecontext/entity/User.java diff --git a/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/persistencecontext/service/ExtendedPersistenceContextUserService.java b/persistence-modules/hibernate5-2/src/main/java/com/baeldung/persistencecontext/service/ExtendedPersistenceContextUserService.java similarity index 100% rename from persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/persistencecontext/service/ExtendedPersistenceContextUserService.java rename to persistence-modules/hibernate5-2/src/main/java/com/baeldung/persistencecontext/service/ExtendedPersistenceContextUserService.java diff --git a/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/persistencecontext/service/TransctionPersistenceContextUserService.java b/persistence-modules/hibernate5-2/src/main/java/com/baeldung/persistencecontext/service/TransctionPersistenceContextUserService.java similarity index 100% rename from persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/persistencecontext/service/TransctionPersistenceContextUserService.java rename to persistence-modules/hibernate5-2/src/main/java/com/baeldung/persistencecontext/service/TransctionPersistenceContextUserService.java diff --git a/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/persistencecontext/PersistenceContextIntegrationTest.java b/persistence-modules/hibernate5-2/src/test/java/com/baeldung/persistencecontext/PersistenceContextIntegrationTest.java similarity index 100% rename from persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/persistencecontext/PersistenceContextIntegrationTest.java rename to persistence-modules/hibernate5-2/src/test/java/com/baeldung/persistencecontext/PersistenceContextIntegrationTest.java diff --git a/persistence-modules/hibernate5/README.md b/persistence-modules/hibernate5/README.md index a8e2eae38b..d1bfe897f6 100644 --- a/persistence-modules/hibernate5/README.md +++ b/persistence-modules/hibernate5/README.md @@ -38,3 +38,4 @@ This module contains articles about Hibernate 5. - [Hibernate Query Plan Cache](https://www.baeldung.com/hibernate-query-plan-cache) - [TransactionRequiredException Error](https://www.baeldung.com/jpa-transaction-required-exception) - [Enabling Transaction Locks in Spring Data JPA](https://www.baeldung.com/java-jpa-transaction-locks) +- [[Next -->]](/hibernate5-2) \ No newline at end of file diff --git a/persistence-modules/spring-boot-persistence-h2/README.md b/persistence-modules/spring-boot-persistence-h2/README.md index 377b7c8939..a0f9c67a33 100644 --- a/persistence-modules/spring-boot-persistence-h2/README.md +++ b/persistence-modules/spring-boot-persistence-h2/README.md @@ -1,3 +1,4 @@ ### Relevant Articles: - [Access the Same In-Memory H2 Database in Multiple Spring Boot Applications](https://www.baeldung.com/spring-boot-access-h2-database-multiple-apps) -- [Spring Boot With H2 Database](https://www.baeldung.com/spring-boot-h2-database) \ No newline at end of file +- [Spring Boot With H2 Database](https://www.baeldung.com/spring-boot-h2-database) +- [Hibernate @NotNull vs @Column(nullable = false)](https://www.baeldung.com/hibernate-notnull-vs-nullable) \ No newline at end of file diff --git a/persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/notnull/NotNullVsNullableApplication.java b/persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/notnull/NotNullVsNullableApplication.java new file mode 100644 index 0000000000..5e8d69e3a1 --- /dev/null +++ b/persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/notnull/NotNullVsNullableApplication.java @@ -0,0 +1,12 @@ +package com.baeldung.h2db.notnull; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class NotNullVsNullableApplication { + + public static void main(String... args) { + SpringApplication.run(NotNullVsNullableApplication.class, args); + } +} diff --git a/persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/springboot/daos/ItemRepository.java b/persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/notnull/daos/ItemRepository.java similarity index 64% rename from persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/springboot/daos/ItemRepository.java rename to persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/notnull/daos/ItemRepository.java index 3007f56208..c1efc96d71 100644 --- a/persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/springboot/daos/ItemRepository.java +++ b/persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/notnull/daos/ItemRepository.java @@ -1,6 +1,6 @@ -package com.baeldung.h2db.springboot.daos; +package com.baeldung.h2db.notnull.daos; -import com.baeldung.h2db.springboot.models.Item; +import com.baeldung.h2db.notnull.models.Item; import org.springframework.data.repository.CrudRepository; import java.math.BigDecimal; diff --git a/persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/springboot/models/Item.java b/persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/notnull/models/Item.java similarity index 87% rename from persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/springboot/models/Item.java rename to persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/notnull/models/Item.java index a5c5b0d3cb..d2c4015b86 100644 --- a/persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/springboot/models/Item.java +++ b/persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/notnull/models/Item.java @@ -1,4 +1,4 @@ -package com.baeldung.h2db.springboot.models; +package com.baeldung.h2db.notnull.models; import javax.persistence.Entity; import javax.persistence.GeneratedValue; diff --git a/persistence-modules/spring-boot-persistence-h2/src/test/java/com/baeldung/ItemIntegrationTest.java b/persistence-modules/spring-boot-persistence-h2/src/test/java/com/baeldung/h2db/notnull/ItemIntegrationTest.java similarity index 75% rename from persistence-modules/spring-boot-persistence-h2/src/test/java/com/baeldung/ItemIntegrationTest.java rename to persistence-modules/spring-boot-persistence-h2/src/test/java/com/baeldung/h2db/notnull/ItemIntegrationTest.java index 839dd87b7e..0e2e5e3319 100644 --- a/persistence-modules/spring-boot-persistence-h2/src/test/java/com/baeldung/ItemIntegrationTest.java +++ b/persistence-modules/spring-boot-persistence-h2/src/test/java/com/baeldung/h2db/notnull/ItemIntegrationTest.java @@ -1,8 +1,7 @@ -package com.baeldung; +package com.baeldung.h2db.notnull; -import com.baeldung.h2db.springboot.SpringBootH2Application; -import com.baeldung.h2db.springboot.daos.ItemRepository; -import com.baeldung.h2db.springboot.models.Item; +import com.baeldung.h2db.notnull.daos.ItemRepository; +import com.baeldung.h2db.notnull.models.Item; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -14,7 +13,7 @@ import javax.validation.ConstraintViolationException; import static org.assertj.core.api.Assertions.assertThatThrownBy; @RunWith(SpringRunner.class) -@SpringBootTest(classes = SpringBootH2Application.class) +@SpringBootTest(classes = NotNullVsNullableApplication.class) public class ItemIntegrationTest { @Autowired diff --git a/podman/Dockerfile b/podman/Dockerfile new file mode 100644 index 0000000000..8eee766e42 --- /dev/null +++ b/podman/Dockerfile @@ -0,0 +1,4 @@ +FROM centos:latest +RUN yum -y install httpd +CMD ["/usr/sbin/httpd", "-D", "FOREGROUND"] +EXPOSE 80 diff --git a/pom.xml b/pom.xml index a9d66d0546..80ceaf5ca0 100644 --- a/pom.xml +++ b/pom.xml @@ -511,7 +511,6 @@ java-collections-maps java-collections-maps-2 java-jdi - java-lite java-math @@ -630,7 +629,7 @@ spring-boot-performance spring-boot-properties - spring-security-kerberos + spring-security-modules/spring-security-kerberos oauth2-framework-impl spring-boot-nashorn @@ -817,29 +816,28 @@ spring-resttemplate spring-roo spring-scheduling - spring-security-acl - spring-security-angular/server - spring-security-cache-control - - spring-security-core - spring-security-mvc-boot - spring-security-mvc-custom - spring-security-mvc-digest-auth - spring-security-mvc-jsonview - spring-security-mvc-ldap - spring-security-mvc-login - spring-security-mvc-persisted-remember-me - spring-security-mvc - spring-security-mvc-socket - spring-security-openid + spring-security-modules/spring-security-acl + spring-security-modules/spring-security-angular/server + spring-security-modules/spring-security-cache-control + spring-security-modules/spring-security-core + spring-security-modules/spring-security-mvc + spring-security-modules/spring-security-mvc-boot + spring-security-modules/spring-security-mvc-custom + spring-security-modules/spring-security-mvc-digest-auth + spring-security-modules/spring-security-mvc-jsonview + spring-security-modules/spring-security-mvc-ldap + spring-security-modules/spring-security-mvc-login + spring-security-modules/spring-security-mvc-persisted-remember-me + spring-security-modules/spring-security-mvc-socket + spring-security-modules/spring-security-openid - spring-security-rest - spring-security-rest-basic-auth - spring-security-rest-custom - spring-security-sso - spring-security-stormpath - spring-security-thymeleaf - spring-security-x509 + spring-security-modules/spring-security-rest + spring-security-modules/spring-security-rest-basic-auth + spring-security-modules/spring-security-rest-custom + spring-security-modules/spring-security-sso + spring-security-modules/spring-security-stormpath + spring-security-modules/spring-security-thymeleaf + spring-security-modules/spring-security-x509 spring-session spring-shell spring-sleuth @@ -881,7 +879,7 @@ tensorflow-java spring-boot-flowable - spring-security-kerberos + spring-security-modules/spring-security-kerberos spring-boot-nashorn java-blockchain @@ -1151,7 +1149,6 @@ java-collections-maps java-collections-maps-2 java-jdi - java-ee-8-security-api java-lite java-math @@ -1424,27 +1421,27 @@ spring-roo spring-scheduling - spring-security-acl - spring-security-angular/server - spring-security-cache-control - spring-security-core - spring-security-mvc-boot - spring-security-mvc-custom - spring-security-mvc-digest-auth - spring-security-mvc-ldap - spring-security-mvc-login - spring-security-mvc-persisted-remember-me - spring-security-mvc - spring-security-mvc-socket - spring-security-openid + spring-security-modules/spring-security-acl + spring-security-modules/spring-security-angular/server + spring-security-modules/spring-security-cache-control + spring-security-modules/spring-security-core + spring-security-modules/spring-security-mvc + spring-security-modules/spring-security-mvc-boot + spring-security-modules/spring-security-mvc-custom + spring-security-modules/spring-security-mvc-digest-auth + spring-security-modules/spring-security-mvc-ldap + spring-security-modules/spring-security-mvc-login + spring-security-modules/spring-security-mvc-persisted-remember-me + spring-security-modules/spring-security-mvc-socket + spring-security-modules/spring-security-openid - spring-security-rest - spring-security-rest-basic-auth - spring-security-rest-custom - spring-security-sso - spring-security-stormpath - spring-security-thymeleaf - spring-security-x509 + spring-security-modules/spring-security-rest + spring-security-modules/spring-security-rest-basic-auth + spring-security-modules/spring-security-rest-custom + spring-security-modules/spring-security-sso + spring-security-modules/spring-security-stormpath + spring-security-modules/spring-security-thymeleaf + spring-security-modules/spring-security-x509 spring-session spring-shell spring-sleuth diff --git a/spring-5-reactive-security/pom.xml b/spring-5-reactive-security/pom.xml index 2024cb5138..2f4a31241b 100644 --- a/spring-5-reactive-security/pom.xml +++ b/spring-5-reactive-security/pom.xml @@ -128,6 +128,7 @@ 1.0 4.1 3.1.6.RELEASE + 2.2.1.RELEASE diff --git a/spring-5-reactive-security/src/main/java/com/baeldung/reactive/authresolver/AuthResolverApplication.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/authresolver/AuthResolverApplication.java new file mode 100644 index 0000000000..bad5768c20 --- /dev/null +++ b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/authresolver/AuthResolverApplication.java @@ -0,0 +1,15 @@ +package com.baeldung.reactive.authresolver; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.web.reactive.config.EnableWebFlux; + +@EnableWebFlux +@SpringBootApplication +public class AuthResolverApplication { + + public static void main(String[] args) { + SpringApplication.run(AuthResolverApplication.class, args); + } + +} diff --git a/spring-5-reactive-security/src/main/java/com/baeldung/reactive/authresolver/AuthResolverController.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/authresolver/AuthResolverController.java new file mode 100644 index 0000000000..1d70ded5e4 --- /dev/null +++ b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/authresolver/AuthResolverController.java @@ -0,0 +1,25 @@ +package com.baeldung.reactive.authresolver; + +import java.security.Principal; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; +import reactor.core.publisher.Mono; + +@RestController +public class AuthResolverController { + + @GetMapping("/customer/welcome") + public Mono sayWelcomeToCustomer(Mono principal) { + return principal + .map(Principal::getName) + .map(name -> String.format("Welcome to our site, %s!", name)); + } + + @GetMapping("/employee/welcome") + public Mono sayWelcomeToEmployee(Mono principal) { + return principal + .map(Principal::getName) + .map(name -> String.format("Welcome to our company, %s!", name)); + } + +} diff --git a/spring-5-reactive-security/src/main/java/com/baeldung/reactive/authresolver/CustomWebSecurityConfig.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/authresolver/CustomWebSecurityConfig.java new file mode 100644 index 0000000000..d07a991089 --- /dev/null +++ b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/authresolver/CustomWebSecurityConfig.java @@ -0,0 +1,96 @@ +package com.baeldung.reactive.authresolver; + +import java.util.Collections; +import org.springframework.context.annotation.Bean; +import org.springframework.http.server.reactive.ServerHttpRequest; +import org.springframework.security.authentication.ReactiveAuthenticationManager; +import org.springframework.security.authentication.ReactiveAuthenticationManagerResolver; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.config.annotation.method.configuration.EnableReactiveMethodSecurity; +import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity; +import org.springframework.security.config.web.server.SecurityWebFiltersOrder; +import org.springframework.security.config.web.server.ServerHttpSecurity; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.security.web.server.SecurityWebFilterChain; +import org.springframework.security.web.server.authentication.AuthenticationWebFilter; +import reactor.core.publisher.Mono; + +@EnableWebFluxSecurity +@EnableReactiveMethodSecurity +public class CustomWebSecurityConfig { + + @Bean + public SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http) { + return http + .authorizeExchange() + .pathMatchers("/**") + .authenticated() + .and() + .httpBasic() + .disable() + .addFilterAfter(authenticationWebFilter(), SecurityWebFiltersOrder.REACTOR_CONTEXT) + .build(); + } + + public AuthenticationWebFilter authenticationWebFilter() { + return new AuthenticationWebFilter(resolver()); + } + + public ReactiveAuthenticationManagerResolver resolver() { + return request -> { + if (request + .getPath() + .subPath(0) + .value() + .startsWith("/employee")) { + return Mono.just(employeesAuthenticationManager()); + } + return Mono.just(customersAuthenticationManager()); + }; + } + + public ReactiveAuthenticationManager customersAuthenticationManager() { + return authentication -> customer(authentication) + .switchIfEmpty(Mono.error(new UsernameNotFoundException(authentication + .getPrincipal() + .toString()))) + .map(b -> new UsernamePasswordAuthenticationToken(authentication.getPrincipal(), + authentication.getCredentials(), + Collections.singletonList(new SimpleGrantedAuthority("ROLE_USER")) + ) + ); + } + + public ReactiveAuthenticationManager employeesAuthenticationManager() { + return authentication -> employee(authentication) + .switchIfEmpty(Mono.error(new UsernameNotFoundException(authentication + .getPrincipal() + .toString()))) + .map( + b -> new UsernamePasswordAuthenticationToken(authentication.getPrincipal(), + authentication.getCredentials(), + Collections.singletonList(new SimpleGrantedAuthority("ROLE_USER")) + ) + ); + } + + public Mono customer(Authentication authentication) { + return Mono.justOrEmpty(authentication + .getPrincipal() + .toString() + .startsWith("customer") ? authentication + .getPrincipal() + .toString() : null); + } + + public Mono employee(Authentication authentication) { + return Mono.justOrEmpty(authentication + .getPrincipal() + .toString() + .startsWith("employee") ? authentication + .getPrincipal() + .toString() : null); + } +} diff --git a/spring-5-reactive-security/src/test/java/com/baeldung/reactive/authresolver/AuthResolverIntegrationTest.java b/spring-5-reactive-security/src/test/java/com/baeldung/reactive/authresolver/AuthResolverIntegrationTest.java new file mode 100644 index 0000000000..691243b3ea --- /dev/null +++ b/spring-5-reactive-security/src/test/java/com/baeldung/reactive/authresolver/AuthResolverIntegrationTest.java @@ -0,0 +1,63 @@ +package com.baeldung.reactive.authresolver; + +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.MethodSorters; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.reactive.server.WebTestClient; +import org.springframework.util.Base64Utils; + +@RunWith(SpringRunner.class) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = AuthResolverApplication.class) +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class AuthResolverIntegrationTest { + @Autowired + private WebTestClient testClient; + + @Test + public void givenCustomerCredential_whenWelcomeCustomer_thenExpectOk() { + testClient + .get() + .uri("/customer/welcome") + .header("Authorization", "Basic " + Base64Utils.encodeToString("customer1:pass1".getBytes())) + .exchange() + .expectStatus() + .isOk(); + } + + @Test + public void givenEmployeeCredential_whenWelcomeCustomer_thenExpect401Status() { + testClient + .get() + .uri("/customer/welcome") + .header("Authorization", "Basic " + Base64Utils.encodeToString("employee1:pass1".getBytes())) + .exchange() + .expectStatus() + .isUnauthorized(); + } + + @Test + public void givenEmployeeCredential_whenWelcomeEmployee_thenExpectOk() { + testClient + .get() + .uri("/employee/welcome") + .header("Authorization", "Basic " + Base64Utils.encodeToString("employee1:pass1".getBytes())) + .exchange() + .expectStatus() + .isOk(); + } + + @Test + public void givenCustomerCredential_whenWelcomeEmployee_thenExpect401Status() { + testClient + .get() + .uri("/employee/welcome") + .header("Authorization", "Basic " + Base64Utils.encodeToString("customer1:pass1".getBytes())) + .exchange() + .expectStatus() + .isUnauthorized(); + } +} diff --git a/spring-5-security/pom.xml b/spring-5-security/pom.xml index c486d5346b..3fd31c8bc5 100644 --- a/spring-5-security/pom.xml +++ b/spring-5-security/pom.xml @@ -60,5 +60,8 @@ + + 2.2.1.RELEASE + diff --git a/spring-5-security/src/main/java/com/baeldung/authresolver/AuthResolverApplication.java b/spring-5-security/src/main/java/com/baeldung/authresolver/AuthResolverApplication.java new file mode 100644 index 0000000000..96ee674b15 --- /dev/null +++ b/spring-5-security/src/main/java/com/baeldung/authresolver/AuthResolverApplication.java @@ -0,0 +1,11 @@ +package com.baeldung.authresolver; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class AuthResolverApplication { + public static void main(String[] args) { + SpringApplication.run(AuthResolverApplication.class, args); + } +} diff --git a/spring-5-security/src/main/java/com/baeldung/authresolver/AuthResolverController.java b/spring-5-security/src/main/java/com/baeldung/authresolver/AuthResolverController.java new file mode 100644 index 0000000000..7dc6900b5a --- /dev/null +++ b/spring-5-security/src/main/java/com/baeldung/authresolver/AuthResolverController.java @@ -0,0 +1,18 @@ +package com.baeldung.authresolver; + +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class AuthResolverController { + @GetMapping("/customer/welcome") + public String sayWelcomeToCustomer(Authentication authentication) { + return String.format("Welcome to our site, %s!", authentication.getPrincipal()); + } + + @GetMapping("/employee/welcome") + public String sayWelcomeToEmployee(Authentication authentication) { + return String.format("Welcome to our company, %s!", authentication.getPrincipal()); + } +} diff --git a/spring-5-security/src/main/java/com/baeldung/authresolver/CustomWebSecurityConfigurer.java b/spring-5-security/src/main/java/com/baeldung/authresolver/CustomWebSecurityConfigurer.java new file mode 100644 index 0000000000..33ef692173 --- /dev/null +++ b/spring-5-security/src/main/java/com/baeldung/authresolver/CustomWebSecurityConfigurer.java @@ -0,0 +1,96 @@ +package com.baeldung.authresolver; + +import java.util.Collections; +import javax.servlet.http.HttpServletRequest; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.authentication.AuthenticationManagerResolver; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.security.web.authentication.AuthenticationConverter; +import org.springframework.security.web.authentication.AuthenticationFilter; +import org.springframework.security.web.authentication.www.BasicAuthenticationConverter; +import org.springframework.security.web.authentication.www.BasicAuthenticationFilter; + +@Configuration +public class CustomWebSecurityConfigurer extends WebSecurityConfigurerAdapter { + + public AuthenticationConverter authenticationConverter() { + return new BasicAuthenticationConverter(); + } + + public AuthenticationManagerResolver resolver() { + return request -> { + if (request + .getPathInfo() + .startsWith("/employee")) { + return employeesAuthenticationManager(); + } + return customersAuthenticationManager(); + }; + } + + public AuthenticationManager customersAuthenticationManager() { + return authentication -> { + if (isCustomer(authentication)) { + return new UsernamePasswordAuthenticationToken( + authentication.getPrincipal(), + authentication.getCredentials(), + Collections.singletonList(new SimpleGrantedAuthority("ROLE_USER")) + ); + } + throw new UsernameNotFoundException(authentication + .getPrincipal() + .toString()); + }; + } + + private boolean isCustomer(Authentication authentication) { + return (authentication + .getPrincipal() + .toString() + .startsWith("customer")); + } + + private boolean isEmployee(Authentication authentication) { + return (authentication + .getPrincipal() + .toString() + .startsWith("employee")); + } + + private AuthenticationFilter authenticationFilter() { + AuthenticationFilter filter = new AuthenticationFilter( + resolver(), authenticationConverter()); + filter.setSuccessHandler((request, response, auth) -> {}); + return filter; + } + + private AuthenticationManager employeesAuthenticationManager() { + return authentication -> { + if (isEmployee(authentication)) { + return new UsernamePasswordAuthenticationToken( + authentication.getPrincipal(), + authentication.getCredentials(), + Collections.singletonList(new SimpleGrantedAuthority("ROLE_USER")) + ); + } + throw new UsernameNotFoundException(authentication + .getPrincipal() + .toString()); + }; + } + + @Override + protected void configure(HttpSecurity http) { + http.addFilterBefore( + authenticationFilter(), + BasicAuthenticationFilter.class + ); + } + +} diff --git a/spring-5-security/src/test/java/com/baeldung/authresolver/AuthResolverIntegrationTest.java b/spring-5-security/src/test/java/com/baeldung/authresolver/AuthResolverIntegrationTest.java new file mode 100644 index 0000000000..c87f8c1a3a --- /dev/null +++ b/spring-5-security/src/test/java/com/baeldung/authresolver/AuthResolverIntegrationTest.java @@ -0,0 +1,82 @@ +package com.baeldung.authresolver; + +import org.junit.Before; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.MethodSorters; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.security.web.FilterChainProxy; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.springframework.util.Base64Utils; +import org.springframework.web.context.WebApplicationContext; + +import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@RunWith(SpringRunner.class) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = AuthResolverApplication.class) +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class AuthResolverIntegrationTest { + + @Autowired + private FilterChainProxy springSecurityFilterChain; + + @Autowired + private WebApplicationContext wac; + + private MockMvc mockMvc; + + @Before + public void setup() { + this.mockMvc = MockMvcBuilders + .webAppContextSetup(wac) + .apply(springSecurity(springSecurityFilterChain)) + .build(); + } + + @Test + public void givenCustomerCredential_whenWelcomeCustomer_thenExpectOk() throws Exception { + this.mockMvc + .perform(get("/customer/welcome") + .header( + "Authorization", String.format("Basic %s", Base64Utils.encodeToString("customer1:pass1".getBytes())) + ) + ) + .andExpect(status().is2xxSuccessful()); + } + + @Test + public void givenEmployeeCredential_whenWelcomeCustomer_thenExpect401Status() throws Exception { + this.mockMvc + .perform(get("/customer/welcome") + .header( + "Authorization", "Basic " + Base64Utils.encodeToString("employee1:pass1".getBytes())) + ) + .andExpect(status().isUnauthorized()); + } + + @Test + public void givenEmployeeCredential_whenWelcomeEmployee_thenExpectOk() throws Exception { + this.mockMvc + .perform(get("/employee/welcome") + .header( + "Authorization", "Basic " + Base64Utils.encodeToString("employee1:pass1".getBytes())) + ) + .andExpect(status().is2xxSuccessful()); + } + + @Test + public void givenCustomerCredential_whenWelcomeEmployee_thenExpect401Status() throws Exception { + this.mockMvc + .perform(get("/employee/welcome") + .header( + "Authorization", "Basic " + Base64Utils.encodeToString("customer1:pass1".getBytes())) + ) + .andExpect(status().isUnauthorized()); + } +} diff --git a/spring-all/README.md b/spring-all/README.md index 2b9f61c76d..d71b8569cf 100644 --- a/spring-all/README.md +++ b/spring-all/README.md @@ -1,3 +1,7 @@ +## Spring All + +This module contains articles about Spring + ### Relevant Articles: - [The @Scheduled Annotation in Spring](https://www.baeldung.com/spring-scheduled-tasks) diff --git a/spring-core-2/README.md b/spring-core-2/README.md index 027c049163..0ed303162d 100644 --- a/spring-core-2/README.md +++ b/spring-core-2/README.md @@ -17,4 +17,4 @@ This module contains articles about core Spring functionality - [Using @Autowired in Abstract Classes](https://www.baeldung.com/spring-autowired-abstract-class) - [Guide to the Spring BeanFactory](https://www.baeldung.com/spring-beanfactory) - [Read HttpServletRequest Multiple Times](https://www.baeldung.com/spring-reading-httpservletrequest-multiple-times) -- More articles: [[<-- prev]](/spring-core) \ No newline at end of file +- More articles: [[<-- prev]](/spring-core)[[next -->]](/spring-core-3) \ No newline at end of file diff --git a/spring-core-3/README.md b/spring-core-3/README.md index 1c5d911402..ae2d33c196 100644 --- a/spring-core-3/README.md +++ b/spring-core-3/README.md @@ -1,3 +1,7 @@ +## Spring Core + +This module contains articles about core Spring functionality + ## Relevant Articles: - [Understanding getBean() in Spring](https://www.baeldung.com/spring-getbean) diff --git a/spring-mvc-basics-2/README.md b/spring-mvc-basics-2/README.md index 7c88b1f2ff..4a5ea24283 100644 --- a/spring-mvc-basics-2/README.md +++ b/spring-mvc-basics-2/README.md @@ -1,6 +1,7 @@ -========= +## Spring MVC Basics -## Spring MVC Basics with Java Configuration Example Project +This module contains articles about the basics of Spring MVC. Articles about more specific areas of Spring MVC have +their own module. ### The Course The "REST With Spring" Classes: http://bit.ly/restwithspring @@ -10,3 +11,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [The Spring @Controller and @RestController Annotations](http://www.baeldung.com/spring-controller-vs-restcontroller) - [Model, ModelMap, and ModelView in Spring MVC](http://www.baeldung.com/spring-mvc-model-model-map-model-view) - [Spring Web Contexts](http://www.baeldung.com/spring-web-contexts) +- [[<-- Prev]](/spring-mvc-basics) \ No newline at end of file diff --git a/spring-mvc-basics/README.md b/spring-mvc-basics/README.md index 0855015e70..a995c89a07 100644 --- a/spring-mvc-basics/README.md +++ b/spring-mvc-basics/README.md @@ -17,3 +17,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Using Spring @ResponseStatus to Set HTTP Status Code](https://www.baeldung.com/spring-response-status) - [Spring MVC and the @ModelAttribute Annotation](https://www.baeldung.com/spring-mvc-and-the-modelattribute-annotation) - [The HttpMediaTypeNotAcceptableException in Spring MVC](https://www.baeldung.com/spring-httpmediatypenotacceptable) +- [[Next -->]](/spring-mvc-basics-2) \ No newline at end of file diff --git a/spring-security-acl/README.md b/spring-security-modules/spring-security-acl/README.md similarity index 100% rename from spring-security-acl/README.md rename to spring-security-modules/spring-security-acl/README.md diff --git a/spring-security-acl/pom.xml b/spring-security-modules/spring-security-acl/pom.xml similarity index 97% rename from spring-security-acl/pom.xml rename to spring-security-modules/spring-security-acl/pom.xml index 8962c137a8..3c613f9d92 100644 --- a/spring-security-acl/pom.xml +++ b/spring-security-modules/spring-security-acl/pom.xml @@ -12,7 +12,7 @@ com.baeldung parent-boot-1 0.0.1-SNAPSHOT - ../parent-boot-1 + ../../parent-boot-1 diff --git a/spring-security-acl/src/main/java/org/baeldung/acl/Application.java b/spring-security-modules/spring-security-acl/src/main/java/org/baeldung/acl/Application.java similarity index 100% rename from spring-security-acl/src/main/java/org/baeldung/acl/Application.java rename to spring-security-modules/spring-security-acl/src/main/java/org/baeldung/acl/Application.java diff --git a/spring-security-acl/src/main/java/org/baeldung/acl/config/ACLContext.java b/spring-security-modules/spring-security-acl/src/main/java/org/baeldung/acl/config/ACLContext.java similarity index 100% rename from spring-security-acl/src/main/java/org/baeldung/acl/config/ACLContext.java rename to spring-security-modules/spring-security-acl/src/main/java/org/baeldung/acl/config/ACLContext.java diff --git a/spring-security-acl/src/main/java/org/baeldung/acl/config/AclMethodSecurityConfiguration.java b/spring-security-modules/spring-security-acl/src/main/java/org/baeldung/acl/config/AclMethodSecurityConfiguration.java similarity index 100% rename from spring-security-acl/src/main/java/org/baeldung/acl/config/AclMethodSecurityConfiguration.java rename to spring-security-modules/spring-security-acl/src/main/java/org/baeldung/acl/config/AclMethodSecurityConfiguration.java diff --git a/spring-security-acl/src/main/java/org/baeldung/acl/config/JPAPersistenceConfig.java b/spring-security-modules/spring-security-acl/src/main/java/org/baeldung/acl/config/JPAPersistenceConfig.java similarity index 100% rename from spring-security-acl/src/main/java/org/baeldung/acl/config/JPAPersistenceConfig.java rename to spring-security-modules/spring-security-acl/src/main/java/org/baeldung/acl/config/JPAPersistenceConfig.java diff --git a/spring-security-acl/src/main/java/org/baeldung/acl/persistence/dao/NoticeMessageRepository.java b/spring-security-modules/spring-security-acl/src/main/java/org/baeldung/acl/persistence/dao/NoticeMessageRepository.java similarity index 100% rename from spring-security-acl/src/main/java/org/baeldung/acl/persistence/dao/NoticeMessageRepository.java rename to spring-security-modules/spring-security-acl/src/main/java/org/baeldung/acl/persistence/dao/NoticeMessageRepository.java diff --git a/spring-security-acl/src/main/java/org/baeldung/acl/persistence/entity/NoticeMessage.java b/spring-security-modules/spring-security-acl/src/main/java/org/baeldung/acl/persistence/entity/NoticeMessage.java similarity index 100% rename from spring-security-acl/src/main/java/org/baeldung/acl/persistence/entity/NoticeMessage.java rename to spring-security-modules/spring-security-acl/src/main/java/org/baeldung/acl/persistence/entity/NoticeMessage.java diff --git a/spring-security-acl/src/main/resources/acl-data.sql b/spring-security-modules/spring-security-acl/src/main/resources/acl-data.sql similarity index 100% rename from spring-security-acl/src/main/resources/acl-data.sql rename to spring-security-modules/spring-security-acl/src/main/resources/acl-data.sql diff --git a/spring-security-acl/src/main/resources/acl-schema.sql b/spring-security-modules/spring-security-acl/src/main/resources/acl-schema.sql similarity index 100% rename from spring-security-acl/src/main/resources/acl-schema.sql rename to spring-security-modules/spring-security-acl/src/main/resources/acl-schema.sql diff --git a/spring-security-acl/src/main/resources/logback.xml b/spring-security-modules/spring-security-acl/src/main/resources/logback.xml similarity index 100% rename from spring-security-acl/src/main/resources/logback.xml rename to spring-security-modules/spring-security-acl/src/main/resources/logback.xml diff --git a/spring-security-acl/src/main/resources/org.baeldung.acl.datasource.properties b/spring-security-modules/spring-security-acl/src/main/resources/org.baeldung.acl.datasource.properties similarity index 100% rename from spring-security-acl/src/main/resources/org.baeldung.acl.datasource.properties rename to spring-security-modules/spring-security-acl/src/main/resources/org.baeldung.acl.datasource.properties diff --git a/spring-security-acl/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-acl/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-acl/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-acl/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-acl/src/test/java/org/baeldung/acl/SpringACLIntegrationTest.java b/spring-security-modules/spring-security-acl/src/test/java/org/baeldung/acl/SpringACLIntegrationTest.java similarity index 100% rename from spring-security-acl/src/test/java/org/baeldung/acl/SpringACLIntegrationTest.java rename to spring-security-modules/spring-security-acl/src/test/java/org/baeldung/acl/SpringACLIntegrationTest.java diff --git a/spring-security-angular/README.md b/spring-security-modules/spring-security-angular/README.md similarity index 100% rename from spring-security-angular/README.md rename to spring-security-modules/spring-security-angular/README.md diff --git a/spring-security-angular/client/anguarjs/app.js b/spring-security-modules/spring-security-angular/client/anguarjs/app.js similarity index 100% rename from spring-security-angular/client/anguarjs/app.js rename to spring-security-modules/spring-security-angular/client/anguarjs/app.js diff --git a/spring-security-angular/client/anguarjs/home/home.controller.js b/spring-security-modules/spring-security-angular/client/anguarjs/home/home.controller.js similarity index 100% rename from spring-security-angular/client/anguarjs/home/home.controller.js rename to spring-security-modules/spring-security-angular/client/anguarjs/home/home.controller.js diff --git a/spring-security-angular/client/anguarjs/home/home.view.html b/spring-security-modules/spring-security-angular/client/anguarjs/home/home.view.html similarity index 100% rename from spring-security-angular/client/anguarjs/home/home.view.html rename to spring-security-modules/spring-security-angular/client/anguarjs/home/home.view.html diff --git a/spring-security-angular/client/anguarjs/index.html b/spring-security-modules/spring-security-angular/client/anguarjs/index.html similarity index 100% rename from spring-security-angular/client/anguarjs/index.html rename to spring-security-modules/spring-security-angular/client/anguarjs/index.html diff --git a/spring-security-angular/client/anguarjs/login/login.controller.js b/spring-security-modules/spring-security-angular/client/anguarjs/login/login.controller.js similarity index 100% rename from spring-security-angular/client/anguarjs/login/login.controller.js rename to spring-security-modules/spring-security-angular/client/anguarjs/login/login.controller.js diff --git a/spring-security-angular/client/anguarjs/login/login.view.html b/spring-security-modules/spring-security-angular/client/anguarjs/login/login.view.html similarity index 100% rename from spring-security-angular/client/anguarjs/login/login.view.html rename to spring-security-modules/spring-security-angular/client/anguarjs/login/login.view.html diff --git a/spring-security-angular/client/angular2/app.css b/spring-security-modules/spring-security-angular/client/angular2/app.css similarity index 100% rename from spring-security-angular/client/angular2/app.css rename to spring-security-modules/spring-security-angular/client/angular2/app.css diff --git a/spring-security-angular/client/angular2/app/app.component.html b/spring-security-modules/spring-security-angular/client/angular2/app/app.component.html similarity index 100% rename from spring-security-angular/client/angular2/app/app.component.html rename to spring-security-modules/spring-security-angular/client/angular2/app/app.component.html diff --git a/spring-security-angular/client/angular2/app/app.component.ts b/spring-security-modules/spring-security-angular/client/angular2/app/app.component.ts similarity index 100% rename from spring-security-angular/client/angular2/app/app.component.ts rename to spring-security-modules/spring-security-angular/client/angular2/app/app.component.ts diff --git a/spring-security-angular/client/angular2/app/app.module.ts b/spring-security-modules/spring-security-angular/client/angular2/app/app.module.ts similarity index 100% rename from spring-security-angular/client/angular2/app/app.module.ts rename to spring-security-modules/spring-security-angular/client/angular2/app/app.module.ts diff --git a/spring-security-angular/client/angular2/app/app.routing.ts b/spring-security-modules/spring-security-angular/client/angular2/app/app.routing.ts similarity index 100% rename from spring-security-angular/client/angular2/app/app.routing.ts rename to spring-security-modules/spring-security-angular/client/angular2/app/app.routing.ts diff --git a/spring-security-angular/client/angular2/app/home/home.component.html b/spring-security-modules/spring-security-angular/client/angular2/app/home/home.component.html similarity index 100% rename from spring-security-angular/client/angular2/app/home/home.component.html rename to spring-security-modules/spring-security-angular/client/angular2/app/home/home.component.html diff --git a/spring-security-angular/client/angular2/app/home/home.component.ts b/spring-security-modules/spring-security-angular/client/angular2/app/home/home.component.ts similarity index 100% rename from spring-security-angular/client/angular2/app/home/home.component.ts rename to spring-security-modules/spring-security-angular/client/angular2/app/home/home.component.ts diff --git a/spring-security-angular/client/angular2/app/login/login.component.html b/spring-security-modules/spring-security-angular/client/angular2/app/login/login.component.html similarity index 100% rename from spring-security-angular/client/angular2/app/login/login.component.html rename to spring-security-modules/spring-security-angular/client/angular2/app/login/login.component.html diff --git a/spring-security-angular/client/angular2/app/login/login.component.ts b/spring-security-modules/spring-security-angular/client/angular2/app/login/login.component.ts similarity index 100% rename from spring-security-angular/client/angular2/app/login/login.component.ts rename to spring-security-modules/spring-security-angular/client/angular2/app/login/login.component.ts diff --git a/spring-security-angular/client/angular2/app/main.ts b/spring-security-modules/spring-security-angular/client/angular2/app/main.ts similarity index 100% rename from spring-security-angular/client/angular2/app/main.ts rename to spring-security-modules/spring-security-angular/client/angular2/app/main.ts diff --git a/spring-security-angular/client/angular2/index.html b/spring-security-modules/spring-security-angular/client/angular2/index.html similarity index 100% rename from spring-security-angular/client/angular2/index.html rename to spring-security-modules/spring-security-angular/client/angular2/index.html diff --git a/spring-security-angular/client/angular2/package.json b/spring-security-modules/spring-security-angular/client/angular2/package.json similarity index 100% rename from spring-security-angular/client/angular2/package.json rename to spring-security-modules/spring-security-angular/client/angular2/package.json diff --git a/spring-security-angular/client/angular2/systemjs.config.js b/spring-security-modules/spring-security-angular/client/angular2/systemjs.config.js similarity index 100% rename from spring-security-angular/client/angular2/systemjs.config.js rename to spring-security-modules/spring-security-angular/client/angular2/systemjs.config.js diff --git a/spring-security-angular/client/angular2/tsconfig.json b/spring-security-modules/spring-security-angular/client/angular2/tsconfig.json similarity index 100% rename from spring-security-angular/client/angular2/tsconfig.json rename to spring-security-modules/spring-security-angular/client/angular2/tsconfig.json diff --git a/spring-security-angular/client/angular4/.angular-cli.json b/spring-security-modules/spring-security-angular/client/angular4/.angular-cli.json similarity index 95% rename from spring-security-angular/client/angular4/.angular-cli.json rename to spring-security-modules/spring-security-angular/client/angular4/.angular-cli.json index 967934b2f7..34274db4eb 100644 --- a/spring-security-angular/client/angular4/.angular-cli.json +++ b/spring-security-modules/spring-security-angular/client/angular4/.angular-cli.json @@ -1,65 +1,65 @@ -{ - "$schema": "./node_modules/@angular/cli/lib/config/schema.json", - "project": { - "name": "angular-crud" - }, - "apps": [ - { - "root": "src", - "outDir": "dist", - "assets": [ - "assets", - "favicon.ico" - ], - "index": "index.html", - "main": "main.ts", - "polyfills": "polyfills.ts", - "test": "test.ts", - "tsconfig": "tsconfig.app.json", - "testTsconfig": "tsconfig.spec.json", - "prefix": "app", - "styles": [ - "../node_modules/bootstrap/dist/css/bootstrap.min.css", - "styles.css", - "../node_modules/font-awesome/css/font-awesome.min.css" - ], - "scripts": [ - "../node_modules/jquery/dist/jquery.js", - "../node_modules/bootstrap/dist/js/bootstrap.js" - ], - "environmentSource": "environments/environment.ts", - "environments": { - "dev": "environments/environment.ts", - "prod": "environments/environment.prod.ts" - } - } - ], - "e2e": { - "protractor": { - "config": "./protractor.conf.js" - } - }, - "lint": [ - { - "project": "src/tsconfig.app.json", - "exclude": "**/node_modules/**" - }, - { - "project": "src/tsconfig.spec.json", - "exclude": "**/node_modules/**" - }, - { - "project": "e2e/tsconfig.e2e.json", - "exclude": "**/node_modules/**" - } - ], - "test": { - "karma": { - "config": "./karma.conf.js" - } - }, - "defaults": { - "styleExt": "css", - "component": {} - } +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "project": { + "name": "angular-crud" + }, + "apps": [ + { + "root": "src", + "outDir": "dist", + "assets": [ + "assets", + "favicon.ico" + ], + "index": "index.html", + "main": "main.ts", + "polyfills": "polyfills.ts", + "test": "test.ts", + "tsconfig": "tsconfig.app.json", + "testTsconfig": "tsconfig.spec.json", + "prefix": "app", + "styles": [ + "../node_modules/bootstrap/dist/css/bootstrap.min.css", + "styles.css", + "../node_modules/font-awesome/css/font-awesome.min.css" + ], + "scripts": [ + "../node_modules/jquery/dist/jquery.js", + "../node_modules/bootstrap/dist/js/bootstrap.js" + ], + "environmentSource": "environments/environment.ts", + "environments": { + "dev": "environments/environment.ts", + "prod": "environments/environment.prod.ts" + } + } + ], + "e2e": { + "protractor": { + "config": "./protractor.conf.js" + } + }, + "lint": [ + { + "project": "src/tsconfig.app.json", + "exclude": "**/node_modules/**" + }, + { + "project": "src/tsconfig.spec.json", + "exclude": "**/node_modules/**" + }, + { + "project": "e2e/tsconfig.e2e.json", + "exclude": "**/node_modules/**" + } + ], + "test": { + "karma": { + "config": "./karma.conf.js" + } + }, + "defaults": { + "styleExt": "css", + "component": {} + } } \ No newline at end of file diff --git a/spring-security-angular/client/angular4/package.json b/spring-security-modules/spring-security-angular/client/angular4/package.json similarity index 100% rename from spring-security-angular/client/angular4/package.json rename to spring-security-modules/spring-security-angular/client/angular4/package.json diff --git a/spring-security-angular/client/angular4/src/app/app.component.html b/spring-security-modules/spring-security-angular/client/angular4/src/app/app.component.html similarity index 100% rename from spring-security-angular/client/angular4/src/app/app.component.html rename to spring-security-modules/spring-security-angular/client/angular4/src/app/app.component.html diff --git a/spring-security-angular/client/angular4/src/app/app.component.ts b/spring-security-modules/spring-security-angular/client/angular4/src/app/app.component.ts similarity index 100% rename from spring-security-angular/client/angular4/src/app/app.component.ts rename to spring-security-modules/spring-security-angular/client/angular4/src/app/app.component.ts diff --git a/spring-security-angular/client/angular4/src/app/app.module.ts b/spring-security-modules/spring-security-angular/client/angular4/src/app/app.module.ts similarity index 100% rename from spring-security-angular/client/angular4/src/app/app.module.ts rename to spring-security-modules/spring-security-angular/client/angular4/src/app/app.module.ts diff --git a/spring-security-angular/client/angular4/src/app/app.routing.ts b/spring-security-modules/spring-security-angular/client/angular4/src/app/app.routing.ts similarity index 100% rename from spring-security-angular/client/angular4/src/app/app.routing.ts rename to spring-security-modules/spring-security-angular/client/angular4/src/app/app.routing.ts diff --git a/spring-security-angular/client/angular4/src/app/home/home.component.html b/spring-security-modules/spring-security-angular/client/angular4/src/app/home/home.component.html similarity index 100% rename from spring-security-angular/client/angular4/src/app/home/home.component.html rename to spring-security-modules/spring-security-angular/client/angular4/src/app/home/home.component.html diff --git a/spring-security-angular/client/angular4/src/app/home/home.component.ts b/spring-security-modules/spring-security-angular/client/angular4/src/app/home/home.component.ts similarity index 100% rename from spring-security-angular/client/angular4/src/app/home/home.component.ts rename to spring-security-modules/spring-security-angular/client/angular4/src/app/home/home.component.ts diff --git a/spring-security-angular/client/angular4/src/app/login/login.component.html b/spring-security-modules/spring-security-angular/client/angular4/src/app/login/login.component.html similarity index 100% rename from spring-security-angular/client/angular4/src/app/login/login.component.html rename to spring-security-modules/spring-security-angular/client/angular4/src/app/login/login.component.html diff --git a/spring-security-angular/client/angular4/src/app/login/login.component.ts b/spring-security-modules/spring-security-angular/client/angular4/src/app/login/login.component.ts similarity index 100% rename from spring-security-angular/client/angular4/src/app/login/login.component.ts rename to spring-security-modules/spring-security-angular/client/angular4/src/app/login/login.component.ts diff --git a/spring-security-angular/client/angular4/src/index.html b/spring-security-modules/spring-security-angular/client/angular4/src/index.html similarity index 100% rename from spring-security-angular/client/angular4/src/index.html rename to spring-security-modules/spring-security-angular/client/angular4/src/index.html diff --git a/spring-security-angular/client/angular4/src/main.ts b/spring-security-modules/spring-security-angular/client/angular4/src/main.ts similarity index 100% rename from spring-security-angular/client/angular4/src/main.ts rename to spring-security-modules/spring-security-angular/client/angular4/src/main.ts diff --git a/spring-security-angular/client/angular6/src/polyfills.ts b/spring-security-modules/spring-security-angular/client/angular4/src/polyfills.ts similarity index 97% rename from spring-security-angular/client/angular6/src/polyfills.ts rename to spring-security-modules/spring-security-angular/client/angular4/src/polyfills.ts index a4984ced57..ec50a75aeb 100644 --- a/spring-security-angular/client/angular6/src/polyfills.ts +++ b/spring-security-modules/spring-security-angular/client/angular4/src/polyfills.ts @@ -1,68 +1,68 @@ -/** - * This file includes polyfills needed by Angular and is loaded before the app. - * You can add your own extra polyfills to this file. - * - * This file is divided into 2 sections: - * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. - * 2. Application imports. Files imported after ZoneJS that should be loaded before your main - * file. - * - * The current setup is for so-called "evergreen" browsers; the last versions of browsers that - * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), - * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. - * - * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html - */ - -/*************************************************************************************************** - * BROWSER POLYFILLS - */ - -/** IE9, IE10 and IE11 requires all of the following polyfills. **/ -// import 'core-js/es6/symbol'; -// import 'core-js/es6/object'; -// import 'core-js/es6/function'; -// import 'core-js/es6/parse-int'; -// import 'core-js/es6/parse-float'; -// import 'core-js/es6/number'; -// import 'core-js/es6/math'; -// import 'core-js/es6/string'; -// import 'core-js/es6/date'; -// import 'core-js/es6/array'; -// import 'core-js/es6/regexp'; -// import 'core-js/es6/map'; -// import 'core-js/es6/weak-map'; -// import 'core-js/es6/set'; -/** IE10 and IE11 requires the following for NgClass support on SVG elements */ -// import 'classlist.js'; // Run `npm install --save classlist.js`. -/** Evergreen browsers require these. **/ -import 'core-js/es6/reflect'; -import 'core-js/es7/reflect'; - - -/** - * Required to support Web Animations `@angular/animation`. - * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation - **/ -// import 'web-animations-js'; // Run `npm install --save web-animations-js`. - - -/*************************************************************************************************** - * Zone JS is required by Angular itself. - */ -import 'zone.js/dist/zone'; // Included with Angular CLI. - - -/*************************************************************************************************** - * APPLICATION IMPORTS - */ - -/** - * Date, currency, decimal and percent pipes. - * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 - */ -// import 'intl'; // Run `npm install --save intl`. -/** - * Need to import at least one locale-data with intl. - */ +/** + * This file includes polyfills needed by Angular and is loaded before the app. + * You can add your own extra polyfills to this file. + * + * This file is divided into 2 sections: + * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. + * 2. Application imports. Files imported after ZoneJS that should be loaded before your main + * file. + * + * The current setup is for so-called "evergreen" browsers; the last versions of browsers that + * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), + * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. + * + * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html + */ + +/*************************************************************************************************** + * BROWSER POLYFILLS + */ + +/** IE9, IE10 and IE11 requires all of the following polyfills. **/ +// import 'core-js/es6/symbol'; +// import 'core-js/es6/object'; +// import 'core-js/es6/function'; +// import 'core-js/es6/parse-int'; +// import 'core-js/es6/parse-float'; +// import 'core-js/es6/number'; +// import 'core-js/es6/math'; +// import 'core-js/es6/string'; +// import 'core-js/es6/date'; +// import 'core-js/es6/array'; +// import 'core-js/es6/regexp'; +// import 'core-js/es6/map'; +// import 'core-js/es6/weak-map'; +// import 'core-js/es6/set'; +/** IE10 and IE11 requires the following for NgClass support on SVG elements */ +// import 'classlist.js'; // Run `npm install --save classlist.js`. +/** Evergreen browsers require these. **/ +import 'core-js/es6/reflect'; +import 'core-js/es7/reflect'; + + +/** + * Required to support Web Animations `@angular/animation`. + * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation + **/ +// import 'web-animations-js'; // Run `npm install --save web-animations-js`. + + +/*************************************************************************************************** + * Zone JS is required by Angular itself. + */ +import 'zone.js/dist/zone'; // Included with Angular CLI. + + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ + +/** + * Date, currency, decimal and percent pipes. + * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 + */ +// import 'intl'; // Run `npm install --save intl`. +/** + * Need to import at least one locale-data with intl. + */ // import 'intl/locale-data/jsonp/en'; \ No newline at end of file diff --git a/spring-security-angular/client/angular4/src/styles.css b/spring-security-modules/spring-security-angular/client/angular4/src/styles.css similarity index 100% rename from spring-security-angular/client/angular4/src/styles.css rename to spring-security-modules/spring-security-angular/client/angular4/src/styles.css diff --git a/spring-security-angular/client/angular4/src/tsconfig.app.json b/spring-security-modules/spring-security-angular/client/angular4/src/tsconfig.app.json similarity index 100% rename from spring-security-angular/client/angular4/src/tsconfig.app.json rename to spring-security-modules/spring-security-angular/client/angular4/src/tsconfig.app.json diff --git a/spring-security-angular/client/angular4/tsconfig.json b/spring-security-modules/spring-security-angular/client/angular4/tsconfig.json similarity index 100% rename from spring-security-angular/client/angular4/tsconfig.json rename to spring-security-modules/spring-security-angular/client/angular4/tsconfig.json diff --git a/spring-security-angular/client/angular4/tslint.json b/spring-security-modules/spring-security-angular/client/angular4/tslint.json similarity index 100% rename from spring-security-angular/client/angular4/tslint.json rename to spring-security-modules/spring-security-angular/client/angular4/tslint.json diff --git a/spring-security-angular/client/angular5/.angular-cli.json b/spring-security-modules/spring-security-angular/client/angular5/.angular-cli.json similarity index 100% rename from spring-security-angular/client/angular5/.angular-cli.json rename to spring-security-modules/spring-security-angular/client/angular5/.angular-cli.json diff --git a/spring-security-angular/client/angular5/package.json b/spring-security-modules/spring-security-angular/client/angular5/package.json similarity index 100% rename from spring-security-angular/client/angular5/package.json rename to spring-security-modules/spring-security-angular/client/angular5/package.json diff --git a/spring-security-angular/client/angular5/src/app/app.component.html b/spring-security-modules/spring-security-angular/client/angular5/src/app/app.component.html similarity index 100% rename from spring-security-angular/client/angular5/src/app/app.component.html rename to spring-security-modules/spring-security-angular/client/angular5/src/app/app.component.html diff --git a/spring-security-angular/client/angular5/src/app/app.component.ts b/spring-security-modules/spring-security-angular/client/angular5/src/app/app.component.ts similarity index 100% rename from spring-security-angular/client/angular5/src/app/app.component.ts rename to spring-security-modules/spring-security-angular/client/angular5/src/app/app.component.ts diff --git a/spring-security-angular/client/angular5/src/app/app.module.ts b/spring-security-modules/spring-security-angular/client/angular5/src/app/app.module.ts similarity index 100% rename from spring-security-angular/client/angular5/src/app/app.module.ts rename to spring-security-modules/spring-security-angular/client/angular5/src/app/app.module.ts diff --git a/spring-security-angular/client/angular5/src/app/app.routing.ts b/spring-security-modules/spring-security-angular/client/angular5/src/app/app.routing.ts similarity index 100% rename from spring-security-angular/client/angular5/src/app/app.routing.ts rename to spring-security-modules/spring-security-angular/client/angular5/src/app/app.routing.ts diff --git a/spring-security-angular/client/angular5/src/app/home/home.component.html b/spring-security-modules/spring-security-angular/client/angular5/src/app/home/home.component.html similarity index 100% rename from spring-security-angular/client/angular5/src/app/home/home.component.html rename to spring-security-modules/spring-security-angular/client/angular5/src/app/home/home.component.html diff --git a/spring-security-angular/client/angular5/src/app/home/home.component.ts b/spring-security-modules/spring-security-angular/client/angular5/src/app/home/home.component.ts similarity index 100% rename from spring-security-angular/client/angular5/src/app/home/home.component.ts rename to spring-security-modules/spring-security-angular/client/angular5/src/app/home/home.component.ts diff --git a/spring-security-angular/client/angular5/src/app/login/login.component.html b/spring-security-modules/spring-security-angular/client/angular5/src/app/login/login.component.html similarity index 100% rename from spring-security-angular/client/angular5/src/app/login/login.component.html rename to spring-security-modules/spring-security-angular/client/angular5/src/app/login/login.component.html diff --git a/spring-security-angular/client/angular5/src/app/login/login.component.ts b/spring-security-modules/spring-security-angular/client/angular5/src/app/login/login.component.ts similarity index 100% rename from spring-security-angular/client/angular5/src/app/login/login.component.ts rename to spring-security-modules/spring-security-angular/client/angular5/src/app/login/login.component.ts diff --git a/spring-security-angular/client/angular5/src/index.html b/spring-security-modules/spring-security-angular/client/angular5/src/index.html similarity index 100% rename from spring-security-angular/client/angular5/src/index.html rename to spring-security-modules/spring-security-angular/client/angular5/src/index.html diff --git a/spring-security-angular/client/angular5/src/main.ts b/spring-security-modules/spring-security-angular/client/angular5/src/main.ts similarity index 100% rename from spring-security-angular/client/angular5/src/main.ts rename to spring-security-modules/spring-security-angular/client/angular5/src/main.ts diff --git a/spring-security-angular/client/angular4/src/polyfills.ts b/spring-security-modules/spring-security-angular/client/angular5/src/polyfills.ts similarity index 97% rename from spring-security-angular/client/angular4/src/polyfills.ts rename to spring-security-modules/spring-security-angular/client/angular5/src/polyfills.ts index a4984ced57..ec50a75aeb 100644 --- a/spring-security-angular/client/angular4/src/polyfills.ts +++ b/spring-security-modules/spring-security-angular/client/angular5/src/polyfills.ts @@ -1,68 +1,68 @@ -/** - * This file includes polyfills needed by Angular and is loaded before the app. - * You can add your own extra polyfills to this file. - * - * This file is divided into 2 sections: - * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. - * 2. Application imports. Files imported after ZoneJS that should be loaded before your main - * file. - * - * The current setup is for so-called "evergreen" browsers; the last versions of browsers that - * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), - * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. - * - * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html - */ - -/*************************************************************************************************** - * BROWSER POLYFILLS - */ - -/** IE9, IE10 and IE11 requires all of the following polyfills. **/ -// import 'core-js/es6/symbol'; -// import 'core-js/es6/object'; -// import 'core-js/es6/function'; -// import 'core-js/es6/parse-int'; -// import 'core-js/es6/parse-float'; -// import 'core-js/es6/number'; -// import 'core-js/es6/math'; -// import 'core-js/es6/string'; -// import 'core-js/es6/date'; -// import 'core-js/es6/array'; -// import 'core-js/es6/regexp'; -// import 'core-js/es6/map'; -// import 'core-js/es6/weak-map'; -// import 'core-js/es6/set'; -/** IE10 and IE11 requires the following for NgClass support on SVG elements */ -// import 'classlist.js'; // Run `npm install --save classlist.js`. -/** Evergreen browsers require these. **/ -import 'core-js/es6/reflect'; -import 'core-js/es7/reflect'; - - -/** - * Required to support Web Animations `@angular/animation`. - * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation - **/ -// import 'web-animations-js'; // Run `npm install --save web-animations-js`. - - -/*************************************************************************************************** - * Zone JS is required by Angular itself. - */ -import 'zone.js/dist/zone'; // Included with Angular CLI. - - -/*************************************************************************************************** - * APPLICATION IMPORTS - */ - -/** - * Date, currency, decimal and percent pipes. - * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 - */ -// import 'intl'; // Run `npm install --save intl`. -/** - * Need to import at least one locale-data with intl. - */ +/** + * This file includes polyfills needed by Angular and is loaded before the app. + * You can add your own extra polyfills to this file. + * + * This file is divided into 2 sections: + * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. + * 2. Application imports. Files imported after ZoneJS that should be loaded before your main + * file. + * + * The current setup is for so-called "evergreen" browsers; the last versions of browsers that + * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), + * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. + * + * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html + */ + +/*************************************************************************************************** + * BROWSER POLYFILLS + */ + +/** IE9, IE10 and IE11 requires all of the following polyfills. **/ +// import 'core-js/es6/symbol'; +// import 'core-js/es6/object'; +// import 'core-js/es6/function'; +// import 'core-js/es6/parse-int'; +// import 'core-js/es6/parse-float'; +// import 'core-js/es6/number'; +// import 'core-js/es6/math'; +// import 'core-js/es6/string'; +// import 'core-js/es6/date'; +// import 'core-js/es6/array'; +// import 'core-js/es6/regexp'; +// import 'core-js/es6/map'; +// import 'core-js/es6/weak-map'; +// import 'core-js/es6/set'; +/** IE10 and IE11 requires the following for NgClass support on SVG elements */ +// import 'classlist.js'; // Run `npm install --save classlist.js`. +/** Evergreen browsers require these. **/ +import 'core-js/es6/reflect'; +import 'core-js/es7/reflect'; + + +/** + * Required to support Web Animations `@angular/animation`. + * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation + **/ +// import 'web-animations-js'; // Run `npm install --save web-animations-js`. + + +/*************************************************************************************************** + * Zone JS is required by Angular itself. + */ +import 'zone.js/dist/zone'; // Included with Angular CLI. + + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ + +/** + * Date, currency, decimal and percent pipes. + * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 + */ +// import 'intl'; // Run `npm install --save intl`. +/** + * Need to import at least one locale-data with intl. + */ // import 'intl/locale-data/jsonp/en'; \ No newline at end of file diff --git a/spring-security-angular/client/angular5/src/styles.css b/spring-security-modules/spring-security-angular/client/angular5/src/styles.css similarity index 100% rename from spring-security-angular/client/angular5/src/styles.css rename to spring-security-modules/spring-security-angular/client/angular5/src/styles.css diff --git a/spring-security-angular/client/angular5/src/tsconfig.app.json b/spring-security-modules/spring-security-angular/client/angular5/src/tsconfig.app.json similarity index 100% rename from spring-security-angular/client/angular5/src/tsconfig.app.json rename to spring-security-modules/spring-security-angular/client/angular5/src/tsconfig.app.json diff --git a/spring-security-angular/client/angular5/tsconfig.json b/spring-security-modules/spring-security-angular/client/angular5/tsconfig.json similarity index 100% rename from spring-security-angular/client/angular5/tsconfig.json rename to spring-security-modules/spring-security-angular/client/angular5/tsconfig.json diff --git a/spring-security-angular/client/angular5/tslint.json b/spring-security-modules/spring-security-angular/client/angular5/tslint.json similarity index 100% rename from spring-security-angular/client/angular5/tslint.json rename to spring-security-modules/spring-security-angular/client/angular5/tslint.json diff --git a/spring-security-angular/client/angular6/angular.json b/spring-security-modules/spring-security-angular/client/angular6/angular.json similarity index 100% rename from spring-security-angular/client/angular6/angular.json rename to spring-security-modules/spring-security-angular/client/angular6/angular.json diff --git a/spring-security-angular/client/angular6/package.json b/spring-security-modules/spring-security-angular/client/angular6/package.json similarity index 100% rename from spring-security-angular/client/angular6/package.json rename to spring-security-modules/spring-security-angular/client/angular6/package.json diff --git a/spring-security-angular/client/angular6/src/app/app.component.html b/spring-security-modules/spring-security-angular/client/angular6/src/app/app.component.html similarity index 100% rename from spring-security-angular/client/angular6/src/app/app.component.html rename to spring-security-modules/spring-security-angular/client/angular6/src/app/app.component.html diff --git a/spring-security-angular/client/angular6/src/app/app.component.ts b/spring-security-modules/spring-security-angular/client/angular6/src/app/app.component.ts similarity index 100% rename from spring-security-angular/client/angular6/src/app/app.component.ts rename to spring-security-modules/spring-security-angular/client/angular6/src/app/app.component.ts diff --git a/spring-security-angular/client/angular6/src/app/app.module.ts b/spring-security-modules/spring-security-angular/client/angular6/src/app/app.module.ts similarity index 100% rename from spring-security-angular/client/angular6/src/app/app.module.ts rename to spring-security-modules/spring-security-angular/client/angular6/src/app/app.module.ts diff --git a/spring-security-angular/client/angular6/src/app/app.routing.ts b/spring-security-modules/spring-security-angular/client/angular6/src/app/app.routing.ts similarity index 100% rename from spring-security-angular/client/angular6/src/app/app.routing.ts rename to spring-security-modules/spring-security-angular/client/angular6/src/app/app.routing.ts diff --git a/spring-security-angular/client/angular6/src/app/home/home.component.html b/spring-security-modules/spring-security-angular/client/angular6/src/app/home/home.component.html similarity index 100% rename from spring-security-angular/client/angular6/src/app/home/home.component.html rename to spring-security-modules/spring-security-angular/client/angular6/src/app/home/home.component.html diff --git a/spring-security-angular/client/angular6/src/app/home/home.component.ts b/spring-security-modules/spring-security-angular/client/angular6/src/app/home/home.component.ts similarity index 100% rename from spring-security-angular/client/angular6/src/app/home/home.component.ts rename to spring-security-modules/spring-security-angular/client/angular6/src/app/home/home.component.ts diff --git a/spring-security-angular/client/angular6/src/app/login/login.component.html b/spring-security-modules/spring-security-angular/client/angular6/src/app/login/login.component.html similarity index 100% rename from spring-security-angular/client/angular6/src/app/login/login.component.html rename to spring-security-modules/spring-security-angular/client/angular6/src/app/login/login.component.html diff --git a/spring-security-angular/client/angular6/src/app/login/login.component.ts b/spring-security-modules/spring-security-angular/client/angular6/src/app/login/login.component.ts similarity index 100% rename from spring-security-angular/client/angular6/src/app/login/login.component.ts rename to spring-security-modules/spring-security-angular/client/angular6/src/app/login/login.component.ts diff --git a/spring-security-angular/client/angular6/src/index.html b/spring-security-modules/spring-security-angular/client/angular6/src/index.html similarity index 100% rename from spring-security-angular/client/angular6/src/index.html rename to spring-security-modules/spring-security-angular/client/angular6/src/index.html diff --git a/spring-security-angular/client/angular6/src/main.ts b/spring-security-modules/spring-security-angular/client/angular6/src/main.ts similarity index 100% rename from spring-security-angular/client/angular6/src/main.ts rename to spring-security-modules/spring-security-angular/client/angular6/src/main.ts diff --git a/spring-security-angular/client/angular5/src/polyfills.ts b/spring-security-modules/spring-security-angular/client/angular6/src/polyfills.ts similarity index 97% rename from spring-security-angular/client/angular5/src/polyfills.ts rename to spring-security-modules/spring-security-angular/client/angular6/src/polyfills.ts index a4984ced57..ec50a75aeb 100644 --- a/spring-security-angular/client/angular5/src/polyfills.ts +++ b/spring-security-modules/spring-security-angular/client/angular6/src/polyfills.ts @@ -1,68 +1,68 @@ -/** - * This file includes polyfills needed by Angular and is loaded before the app. - * You can add your own extra polyfills to this file. - * - * This file is divided into 2 sections: - * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. - * 2. Application imports. Files imported after ZoneJS that should be loaded before your main - * file. - * - * The current setup is for so-called "evergreen" browsers; the last versions of browsers that - * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), - * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. - * - * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html - */ - -/*************************************************************************************************** - * BROWSER POLYFILLS - */ - -/** IE9, IE10 and IE11 requires all of the following polyfills. **/ -// import 'core-js/es6/symbol'; -// import 'core-js/es6/object'; -// import 'core-js/es6/function'; -// import 'core-js/es6/parse-int'; -// import 'core-js/es6/parse-float'; -// import 'core-js/es6/number'; -// import 'core-js/es6/math'; -// import 'core-js/es6/string'; -// import 'core-js/es6/date'; -// import 'core-js/es6/array'; -// import 'core-js/es6/regexp'; -// import 'core-js/es6/map'; -// import 'core-js/es6/weak-map'; -// import 'core-js/es6/set'; -/** IE10 and IE11 requires the following for NgClass support on SVG elements */ -// import 'classlist.js'; // Run `npm install --save classlist.js`. -/** Evergreen browsers require these. **/ -import 'core-js/es6/reflect'; -import 'core-js/es7/reflect'; - - -/** - * Required to support Web Animations `@angular/animation`. - * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation - **/ -// import 'web-animations-js'; // Run `npm install --save web-animations-js`. - - -/*************************************************************************************************** - * Zone JS is required by Angular itself. - */ -import 'zone.js/dist/zone'; // Included with Angular CLI. - - -/*************************************************************************************************** - * APPLICATION IMPORTS - */ - -/** - * Date, currency, decimal and percent pipes. - * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 - */ -// import 'intl'; // Run `npm install --save intl`. -/** - * Need to import at least one locale-data with intl. - */ +/** + * This file includes polyfills needed by Angular and is loaded before the app. + * You can add your own extra polyfills to this file. + * + * This file is divided into 2 sections: + * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. + * 2. Application imports. Files imported after ZoneJS that should be loaded before your main + * file. + * + * The current setup is for so-called "evergreen" browsers; the last versions of browsers that + * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), + * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. + * + * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html + */ + +/*************************************************************************************************** + * BROWSER POLYFILLS + */ + +/** IE9, IE10 and IE11 requires all of the following polyfills. **/ +// import 'core-js/es6/symbol'; +// import 'core-js/es6/object'; +// import 'core-js/es6/function'; +// import 'core-js/es6/parse-int'; +// import 'core-js/es6/parse-float'; +// import 'core-js/es6/number'; +// import 'core-js/es6/math'; +// import 'core-js/es6/string'; +// import 'core-js/es6/date'; +// import 'core-js/es6/array'; +// import 'core-js/es6/regexp'; +// import 'core-js/es6/map'; +// import 'core-js/es6/weak-map'; +// import 'core-js/es6/set'; +/** IE10 and IE11 requires the following for NgClass support on SVG elements */ +// import 'classlist.js'; // Run `npm install --save classlist.js`. +/** Evergreen browsers require these. **/ +import 'core-js/es6/reflect'; +import 'core-js/es7/reflect'; + + +/** + * Required to support Web Animations `@angular/animation`. + * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation + **/ +// import 'web-animations-js'; // Run `npm install --save web-animations-js`. + + +/*************************************************************************************************** + * Zone JS is required by Angular itself. + */ +import 'zone.js/dist/zone'; // Included with Angular CLI. + + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ + +/** + * Date, currency, decimal and percent pipes. + * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 + */ +// import 'intl'; // Run `npm install --save intl`. +/** + * Need to import at least one locale-data with intl. + */ // import 'intl/locale-data/jsonp/en'; \ No newline at end of file diff --git a/spring-security-angular/client/angular6/src/styles.css b/spring-security-modules/spring-security-angular/client/angular6/src/styles.css similarity index 100% rename from spring-security-angular/client/angular6/src/styles.css rename to spring-security-modules/spring-security-angular/client/angular6/src/styles.css diff --git a/spring-security-angular/client/angular6/src/tsconfig.app.json b/spring-security-modules/spring-security-angular/client/angular6/src/tsconfig.app.json similarity index 100% rename from spring-security-angular/client/angular6/src/tsconfig.app.json rename to spring-security-modules/spring-security-angular/client/angular6/src/tsconfig.app.json diff --git a/spring-security-angular/client/angular6/tsconfig.json b/spring-security-modules/spring-security-angular/client/angular6/tsconfig.json similarity index 100% rename from spring-security-angular/client/angular6/tsconfig.json rename to spring-security-modules/spring-security-angular/client/angular6/tsconfig.json diff --git a/spring-security-angular/client/angular6/tslint.json b/spring-security-modules/spring-security-angular/client/angular6/tslint.json similarity index 100% rename from spring-security-angular/client/angular6/tslint.json rename to spring-security-modules/spring-security-angular/client/angular6/tslint.json diff --git a/spring-security-angular/server/pom.xml b/spring-security-modules/spring-security-angular/server/pom.xml similarity index 98% rename from spring-security-angular/server/pom.xml rename to spring-security-modules/spring-security-angular/server/pom.xml index 2c2e5ab614..19d980062c 100644 --- a/spring-security-angular/server/pom.xml +++ b/spring-security-modules/spring-security-angular/server/pom.xml @@ -12,7 +12,7 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../../ diff --git a/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/basicauth/SpringBootSecurityApplication.java b/spring-security-modules/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/basicauth/SpringBootSecurityApplication.java similarity index 100% rename from spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/basicauth/SpringBootSecurityApplication.java rename to spring-security-modules/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/basicauth/SpringBootSecurityApplication.java diff --git a/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/basicauth/config/BasicAuthConfiguration.java b/spring-security-modules/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/basicauth/config/BasicAuthConfiguration.java similarity index 100% rename from spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/basicauth/config/BasicAuthConfiguration.java rename to spring-security-modules/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/basicauth/config/BasicAuthConfiguration.java diff --git a/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/controller/UserController.java b/spring-security-modules/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/controller/UserController.java similarity index 97% rename from spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/controller/UserController.java rename to spring-security-modules/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/controller/UserController.java index ab66065b61..0eef4198a1 100644 --- a/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/controller/UserController.java +++ b/spring-security-modules/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/controller/UserController.java @@ -1,29 +1,29 @@ -package com.baeldung.springbootsecurityrest.controller; - -import java.security.Principal; -import java.util.Base64; - -import javax.servlet.http.HttpServletRequest; - -import org.springframework.web.bind.annotation.CrossOrigin; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import com.baeldung.springbootsecurityrest.vo.User; - -@RestController -@CrossOrigin -public class UserController { - - @RequestMapping("/login") - public boolean login(@RequestBody User user) { - return user.getUserName().equals("user") && user.getPassword().equals("password"); - } - - @RequestMapping("/user") - public Principal user(HttpServletRequest request) { - String authToken = request.getHeader("Authorization").substring("Basic".length()).trim(); - return () -> new String(Base64.getDecoder().decode(authToken)).split(":")[0]; - } -} +package com.baeldung.springbootsecurityrest.controller; + +import java.security.Principal; +import java.util.Base64; + +import javax.servlet.http.HttpServletRequest; + +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.baeldung.springbootsecurityrest.vo.User; + +@RestController +@CrossOrigin +public class UserController { + + @RequestMapping("/login") + public boolean login(@RequestBody User user) { + return user.getUserName().equals("user") && user.getPassword().equals("password"); + } + + @RequestMapping("/user") + public Principal user(HttpServletRequest request) { + String authToken = request.getHeader("Authorization").substring("Basic".length()).trim(); + return () -> new String(Base64.getDecoder().decode(authToken)).split(":")[0]; + } +} diff --git a/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/vo/User.java b/spring-security-modules/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/vo/User.java similarity index 94% rename from spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/vo/User.java rename to spring-security-modules/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/vo/User.java index 0eda5ce9ec..52377ad741 100644 --- a/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/vo/User.java +++ b/spring-security-modules/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/vo/User.java @@ -1,21 +1,21 @@ -package com.baeldung.springbootsecurityrest.vo; - - -public class User { - - private String userName; - private String password; - - public String getUserName() { - return userName; - } - public void setUserName(String userName) { - this.userName = userName; - } - public String getPassword() { - return password; - } - public void setPassword(String password) { - this.password = password; - } -} +package com.baeldung.springbootsecurityrest.vo; + + +public class User { + + private String userName; + private String password; + + public String getUserName() { + return userName; + } + public void setUserName(String userName) { + this.userName = userName; + } + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } +} diff --git a/spring-security-angular/server/src/main/resources/application.properties b/spring-security-modules/spring-security-angular/server/src/main/resources/application.properties similarity index 100% rename from spring-security-angular/server/src/main/resources/application.properties rename to spring-security-modules/spring-security-angular/server/src/main/resources/application.properties diff --git a/spring-security-angular/server/src/main/resources/logback.xml b/spring-security-modules/spring-security-angular/server/src/main/resources/logback.xml similarity index 100% rename from spring-security-angular/server/src/main/resources/logback.xml rename to spring-security-modules/spring-security-angular/server/src/main/resources/logback.xml diff --git a/spring-security-angular/server/src/test/java/com/baeldung/springbootsecurityrest/BasicAuthConfigurationIntegrationTest.java b/spring-security-modules/spring-security-angular/server/src/test/java/com/baeldung/springbootsecurityrest/BasicAuthConfigurationIntegrationTest.java similarity index 100% rename from spring-security-angular/server/src/test/java/com/baeldung/springbootsecurityrest/BasicAuthConfigurationIntegrationTest.java rename to spring-security-modules/spring-security-angular/server/src/test/java/com/baeldung/springbootsecurityrest/BasicAuthConfigurationIntegrationTest.java diff --git a/spring-security-angular/server/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-angular/server/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-angular/server/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-angular/server/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-cache-control/README.md b/spring-security-modules/spring-security-cache-control/README.md similarity index 100% rename from spring-security-cache-control/README.md rename to spring-security-modules/spring-security-cache-control/README.md diff --git a/spring-security-cache-control/pom.xml b/spring-security-modules/spring-security-cache-control/pom.xml similarity index 97% rename from spring-security-cache-control/pom.xml rename to spring-security-modules/spring-security-cache-control/pom.xml index 2e018b68d9..ff96ae78dd 100644 --- a/spring-security-cache-control/pom.xml +++ b/spring-security-modules/spring-security-cache-control/pom.xml @@ -10,7 +10,7 @@ com.baeldung parent-boot-1 0.0.1-SNAPSHOT - ../parent-boot-1 + ../../parent-boot-1 diff --git a/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/AppRunner.java b/spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/AppRunner.java similarity index 100% rename from spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/AppRunner.java rename to spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/AppRunner.java diff --git a/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/ResourceEndpoint.java b/spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/ResourceEndpoint.java similarity index 100% rename from spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/ResourceEndpoint.java rename to spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/ResourceEndpoint.java diff --git a/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/config/SpringSecurityConfig.java b/spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/config/SpringSecurityConfig.java similarity index 100% rename from spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/config/SpringSecurityConfig.java rename to spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/config/SpringSecurityConfig.java diff --git a/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/model/TimestampDto.java b/spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/model/TimestampDto.java similarity index 100% rename from spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/model/TimestampDto.java rename to spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/model/TimestampDto.java diff --git a/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/model/UserDto.java b/spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/model/UserDto.java similarity index 100% rename from spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/model/UserDto.java rename to spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/model/UserDto.java diff --git a/spring-security-cache-control/src/main/resources/logback.xml b/spring-security-modules/spring-security-cache-control/src/main/resources/logback.xml similarity index 100% rename from spring-security-cache-control/src/main/resources/logback.xml rename to spring-security-modules/spring-security-cache-control/src/main/resources/logback.xml diff --git a/spring-security-cache-control/src/test/java/com/baeldung/cachecontrol/ResourceEndpointIntegrationTest.java b/spring-security-modules/spring-security-cache-control/src/test/java/com/baeldung/cachecontrol/ResourceEndpointIntegrationTest.java similarity index 100% rename from spring-security-cache-control/src/test/java/com/baeldung/cachecontrol/ResourceEndpointIntegrationTest.java rename to spring-security-modules/spring-security-cache-control/src/test/java/com/baeldung/cachecontrol/ResourceEndpointIntegrationTest.java diff --git a/spring-security-cache-control/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-cache-control/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-cache-control/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-cache-control/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-core/.gitignore b/spring-security-modules/spring-security-core/.gitignore similarity index 100% rename from spring-security-core/.gitignore rename to spring-security-modules/spring-security-core/.gitignore diff --git a/spring-security-core/README.md b/spring-security-modules/spring-security-core/README.md similarity index 100% rename from spring-security-core/README.md rename to spring-security-modules/spring-security-core/README.md diff --git a/spring-security-core/pom.xml b/spring-security-modules/spring-security-core/pom.xml similarity index 98% rename from spring-security-core/pom.xml rename to spring-security-modules/spring-security-core/pom.xml index 4a75983289..9f1e7cda29 100644 --- a/spring-security-core/pom.xml +++ b/spring-security-modules/spring-security-core/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/spring-security-core/src/main/java/com/baeldung/app/App.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/App.java similarity index 100% rename from spring-security-core/src/main/java/com/baeldung/app/App.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/App.java diff --git a/spring-security-core/src/main/java/com/baeldung/auditing/ExposeAttemptedPathAuthorizationAuditListener.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/auditing/ExposeAttemptedPathAuthorizationAuditListener.java similarity index 100% rename from spring-security-core/src/main/java/com/baeldung/auditing/ExposeAttemptedPathAuthorizationAuditListener.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/auditing/ExposeAttemptedPathAuthorizationAuditListener.java diff --git a/spring-security-core/src/main/java/com/baeldung/auditing/LoginAttemptsLogger.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/auditing/LoginAttemptsLogger.java similarity index 100% rename from spring-security-core/src/main/java/com/baeldung/auditing/LoginAttemptsLogger.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/auditing/LoginAttemptsLogger.java diff --git a/spring-security-core/src/main/java/com/baeldung/config/DatabaseLoader.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/config/DatabaseLoader.java similarity index 100% rename from spring-security-core/src/main/java/com/baeldung/config/DatabaseLoader.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/config/DatabaseLoader.java diff --git a/spring-security-core/src/main/java/com/baeldung/config/WebSecurityConfig.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/config/WebSecurityConfig.java similarity index 100% rename from spring-security-core/src/main/java/com/baeldung/config/WebSecurityConfig.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/config/WebSecurityConfig.java diff --git a/spring-security-core/src/main/java/com/baeldung/controller/TaskController.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/controller/TaskController.java similarity index 100% rename from spring-security-core/src/main/java/com/baeldung/controller/TaskController.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/controller/TaskController.java diff --git a/spring-security-core/src/main/java/com/baeldung/entity/Task.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/entity/Task.java similarity index 100% rename from spring-security-core/src/main/java/com/baeldung/entity/Task.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/entity/Task.java diff --git a/spring-security-core/src/main/java/com/baeldung/filter/CustomFilter.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/filter/CustomFilter.java similarity index 100% rename from spring-security-core/src/main/java/com/baeldung/filter/CustomFilter.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/filter/CustomFilter.java diff --git a/spring-security-core/src/main/java/com/baeldung/methodsecurity/annotation/IsViewer.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/annotation/IsViewer.java similarity index 96% rename from spring-security-core/src/main/java/com/baeldung/methodsecurity/annotation/IsViewer.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/annotation/IsViewer.java index bde4456f8e..a7fa08ff30 100644 --- a/spring-security-core/src/main/java/com/baeldung/methodsecurity/annotation/IsViewer.java +++ b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/annotation/IsViewer.java @@ -1,14 +1,14 @@ -package com.baeldung.methodsecurity.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import org.springframework.security.access.prepost.PreAuthorize; - -@Target(ElementType.METHOD) -@Retention(RetentionPolicy.RUNTIME) -@PreAuthorize("hasRole('VIEWER')") -public @interface IsViewer { +package com.baeldung.methodsecurity.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.springframework.security.access.prepost.PreAuthorize; + +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@PreAuthorize("hasRole('VIEWER')") +public @interface IsViewer { } \ No newline at end of file diff --git a/spring-security-core/src/main/java/com/baeldung/methodsecurity/config/MethodSecurityConfig.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/config/MethodSecurityConfig.java similarity index 100% rename from spring-security-core/src/main/java/com/baeldung/methodsecurity/config/MethodSecurityConfig.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/config/MethodSecurityConfig.java diff --git a/spring-security-core/src/main/java/com/baeldung/methodsecurity/entity/CustomUser.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/entity/CustomUser.java similarity index 96% rename from spring-security-core/src/main/java/com/baeldung/methodsecurity/entity/CustomUser.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/entity/CustomUser.java index 7daaef5984..cce7dc5f75 100644 --- a/spring-security-core/src/main/java/com/baeldung/methodsecurity/entity/CustomUser.java +++ b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/entity/CustomUser.java @@ -1,30 +1,30 @@ -package com.baeldung.methodsecurity.entity; - -import java.util.Collection; - -import org.springframework.security.core.GrantedAuthority; -import org.springframework.security.core.userdetails.User; - -@SuppressWarnings("serial") -public class CustomUser extends User { - - private String nickName; - - public CustomUser(String username, String password, Collection authorities) { - super(username, password, authorities); - } - - public CustomUser(String username, String password, Collection authorities, String nickName) { - super(username, password, authorities); - this.nickName = nickName; - } - - public String getNickName() { - return nickName; - } - - public void setNickName(String nickName) { - this.nickName = nickName; - } - -} +package com.baeldung.methodsecurity.entity; + +import java.util.Collection; + +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.userdetails.User; + +@SuppressWarnings("serial") +public class CustomUser extends User { + + private String nickName; + + public CustomUser(String username, String password, Collection authorities) { + super(username, password, authorities); + } + + public CustomUser(String username, String password, Collection authorities, String nickName) { + super(username, password, authorities); + this.nickName = nickName; + } + + public String getNickName() { + return nickName; + } + + public void setNickName(String nickName) { + this.nickName = nickName; + } + +} diff --git a/spring-security-core/src/main/java/com/baeldung/methodsecurity/repository/UserRoleRepository.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/repository/UserRoleRepository.java similarity index 97% rename from spring-security-core/src/main/java/com/baeldung/methodsecurity/repository/UserRoleRepository.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/repository/UserRoleRepository.java index eef39189a7..20a1f4e85c 100644 --- a/spring-security-core/src/main/java/com/baeldung/methodsecurity/repository/UserRoleRepository.java +++ b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/repository/UserRoleRepository.java @@ -1,58 +1,58 @@ -package com.baeldung.methodsecurity.repository; - -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import org.springframework.security.core.GrantedAuthority; -import org.springframework.security.core.authority.SimpleGrantedAuthority; -import org.springframework.security.core.userdetails.UsernameNotFoundException; -import org.springframework.stereotype.Service; - -import com.baeldung.methodsecurity.entity.CustomUser; - -@Service -public class UserRoleRepository { - - static Map DB_BASED_USER_MAPPING; - - static { - DB_BASED_USER_MAPPING = new LinkedHashMap<>(); - DB_BASED_USER_MAPPING.put("jane", new CustomUser("jane", "1234", getGrantedAuthorities("ROLE_USER", "ROLE_VIEWER"), "jane")); - DB_BASED_USER_MAPPING.put("john", new CustomUser("john", "1234", getGrantedAuthorities("ROLE_EDITOR", "ROLE_ADMIN"), "jane")); - DB_BASED_USER_MAPPING.put("jack", new CustomUser("jack", "1234", getGrantedAuthorities("ROLE_USER", "ROLE_REVIEWER"), "jane")); - } - - private static List getGrantedAuthorities(String... roles) { - ArrayList authorities = new ArrayList<>(); - for (String role : roles) { - authorities.add(new SimpleGrantedAuthority(role)); - } - return authorities; - } - - public CustomUser loadUserByUserName(String username) { - if (DB_BASED_USER_MAPPING.containsKey(username)) { - return DB_BASED_USER_MAPPING.get(username); - } - throw new UsernameNotFoundException("User " + username + " cannot be found"); - } - - public boolean isValidUsername(String username) { - return DB_BASED_USER_MAPPING.containsKey(username); - } - - public boolean isValidRole(String roleName) { - return roleName.startsWith("ROLE_"); - } - - public List getAllUsernames() { - List usernames = new ArrayList<>(); - usernames.add("jane"); - usernames.add("john"); - usernames.add("jack"); - return usernames; - } - -} +package com.baeldung.methodsecurity.repository; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.stereotype.Service; + +import com.baeldung.methodsecurity.entity.CustomUser; + +@Service +public class UserRoleRepository { + + static Map DB_BASED_USER_MAPPING; + + static { + DB_BASED_USER_MAPPING = new LinkedHashMap<>(); + DB_BASED_USER_MAPPING.put("jane", new CustomUser("jane", "1234", getGrantedAuthorities("ROLE_USER", "ROLE_VIEWER"), "jane")); + DB_BASED_USER_MAPPING.put("john", new CustomUser("john", "1234", getGrantedAuthorities("ROLE_EDITOR", "ROLE_ADMIN"), "jane")); + DB_BASED_USER_MAPPING.put("jack", new CustomUser("jack", "1234", getGrantedAuthorities("ROLE_USER", "ROLE_REVIEWER"), "jane")); + } + + private static List getGrantedAuthorities(String... roles) { + ArrayList authorities = new ArrayList<>(); + for (String role : roles) { + authorities.add(new SimpleGrantedAuthority(role)); + } + return authorities; + } + + public CustomUser loadUserByUserName(String username) { + if (DB_BASED_USER_MAPPING.containsKey(username)) { + return DB_BASED_USER_MAPPING.get(username); + } + throw new UsernameNotFoundException("User " + username + " cannot be found"); + } + + public boolean isValidUsername(String username) { + return DB_BASED_USER_MAPPING.containsKey(username); + } + + public boolean isValidRole(String roleName) { + return roleName.startsWith("ROLE_"); + } + + public List getAllUsernames() { + List usernames = new ArrayList<>(); + usernames.add("jane"); + usernames.add("john"); + usernames.add("jack"); + return usernames; + } + +} diff --git a/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/CustomUserDetailsService.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/CustomUserDetailsService.java similarity index 97% rename from spring-security-core/src/main/java/com/baeldung/methodsecurity/service/CustomUserDetailsService.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/CustomUserDetailsService.java index 685621b55f..e6828b32a1 100644 --- a/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/CustomUserDetailsService.java +++ b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/CustomUserDetailsService.java @@ -1,20 +1,20 @@ -package com.baeldung.methodsecurity.service; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.core.userdetails.UserDetails; -import org.springframework.security.core.userdetails.UserDetailsService; -import org.springframework.stereotype.Service; - -import com.baeldung.methodsecurity.repository.UserRoleRepository; - -@Service("userDetailService") -public class CustomUserDetailsService implements UserDetailsService { - - @Autowired - UserRoleRepository userRoleRepo; - - @Override - public UserDetails loadUserByUsername(String username) { - return userRoleRepo.loadUserByUserName(username); - } +package com.baeldung.methodsecurity.service; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.stereotype.Service; + +import com.baeldung.methodsecurity.repository.UserRoleRepository; + +@Service("userDetailService") +public class CustomUserDetailsService implements UserDetailsService { + + @Autowired + UserRoleRepository userRoleRepo; + + @Override + public UserDetails loadUserByUsername(String username) { + return userRoleRepo.loadUserByUserName(username); + } } \ No newline at end of file diff --git a/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/SystemService.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/SystemService.java similarity index 95% rename from spring-security-core/src/main/java/com/baeldung/methodsecurity/service/SystemService.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/SystemService.java index 623d51d34f..7e60f701ad 100644 --- a/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/SystemService.java +++ b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/SystemService.java @@ -1,18 +1,18 @@ -package com.baeldung.methodsecurity.service; - -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.stereotype.Service; - -@Service -@PreAuthorize("hasRole('ROLE_ADMIN')") -public class SystemService { - - public String getSystemYear(){ - return "2017"; - } - - public String getSystemDate(){ - return "31-12-2017"; - } - -} +package com.baeldung.methodsecurity.service; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.stereotype.Service; + +@Service +@PreAuthorize("hasRole('ROLE_ADMIN')") +public class SystemService { + + public String getSystemYear(){ + return "2017"; + } + + public String getSystemDate(){ + return "31-12-2017"; + } + +} diff --git a/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/UserRoleService.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/UserRoleService.java similarity index 97% rename from spring-security-core/src/main/java/com/baeldung/methodsecurity/service/UserRoleService.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/UserRoleService.java index 4d090fd90c..1579044700 100644 --- a/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/UserRoleService.java +++ b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/UserRoleService.java @@ -1,109 +1,109 @@ -package com.baeldung.methodsecurity.service; - -import java.util.List; -import java.util.stream.Collectors; - -import javax.annotation.security.RolesAllowed; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.annotation.Secured; -import org.springframework.security.access.prepost.PostAuthorize; -import org.springframework.security.access.prepost.PostFilter; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.security.access.prepost.PreFilter; -import org.springframework.security.core.context.SecurityContext; -import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.stereotype.Service; - -import com.baeldung.methodsecurity.annotation.IsViewer; -import com.baeldung.methodsecurity.entity.CustomUser; -import com.baeldung.methodsecurity.repository.UserRoleRepository; - -@Service -public class UserRoleService { - - @Autowired - UserRoleRepository userRoleRepository; - - @Secured("ROLE_VIEWER") - public String getUsername() { - SecurityContext securityContext = SecurityContextHolder.getContext(); - return securityContext.getAuthentication().getName(); - } - - @Secured({ "ROLE_VIEWER", "ROLE_EDITOR" }) - public boolean isValidUsername(String username) { - return userRoleRepository.isValidUsername(username); - } - - @RolesAllowed("ROLE_VIEWER") - public String getUsername2() { - SecurityContext securityContext = SecurityContextHolder.getContext(); - return securityContext.getAuthentication().getName(); - } - - @RolesAllowed({ "ROLE_VIEWER", "ROLE_EDITOR" }) - public boolean isValidUsername2(String username) { - return userRoleRepository.isValidUsername(username); - } - - @PreAuthorize("hasRole('ROLE_VIEWER')") - public String getUsernameInUpperCase() { - return getUsername().toUpperCase(); - } - - @PreAuthorize("hasAuthority('SYS_ADMIN')") - public String getUsernameLC() { - return getUsername().toLowerCase(); - } - - @PreAuthorize("hasRole('ROLE_VIEWER') or hasRole('ROLE_EDITOR')") - public boolean isValidUsername3(String username) { - return userRoleRepository.isValidUsername(username); - } - - @PreAuthorize("#username == authentication.principal.username") - public String getMyRoles(String username) { - SecurityContext securityContext = SecurityContextHolder.getContext(); - return securityContext.getAuthentication().getAuthorities().stream().map(auth -> auth.getAuthority()).collect(Collectors.joining(",")); - } - - @PostAuthorize("#username == authentication.principal.username") - public String getMyRoles2(String username) { - SecurityContext securityContext = SecurityContextHolder.getContext(); - return securityContext.getAuthentication().getAuthorities().stream().map(auth -> auth.getAuthority()).collect(Collectors.joining(",")); - } - - @PostAuthorize("returnObject.username == authentication.principal.nickName") - public CustomUser loadUserDetail(String username) { - return userRoleRepository.loadUserByUserName(username); - } - - @PreFilter("filterObject != authentication.principal.username") - public String joinUsernames(List usernames) { - return usernames.stream().collect(Collectors.joining(";")); - } - - @PreFilter(value = "filterObject != authentication.principal.username", filterTarget = "usernames") - public String joinUsernamesAndRoles(List usernames, List roles) { - return usernames.stream().collect(Collectors.joining(";")) + ":" + roles.stream().collect(Collectors.joining(";")); - } - - @PostFilter("filterObject != authentication.principal.username") - public List getAllUsernamesExceptCurrent() { - return userRoleRepository.getAllUsernames(); - } - - @IsViewer - public String getUsername4() { - SecurityContext securityContext = SecurityContextHolder.getContext(); - return securityContext.getAuthentication().getName(); - } - - @PreAuthorize("#username == authentication.principal.username") - @PostAuthorize("returnObject.username == authentication.principal.nickName") - public CustomUser securedLoadUserDetail(String username) { - return userRoleRepository.loadUserByUserName(username); - } - -} +package com.baeldung.methodsecurity.service; + +import java.util.List; +import java.util.stream.Collectors; + +import javax.annotation.security.RolesAllowed; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.annotation.Secured; +import org.springframework.security.access.prepost.PostAuthorize; +import org.springframework.security.access.prepost.PostFilter; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.security.access.prepost.PreFilter; +import org.springframework.security.core.context.SecurityContext; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.stereotype.Service; + +import com.baeldung.methodsecurity.annotation.IsViewer; +import com.baeldung.methodsecurity.entity.CustomUser; +import com.baeldung.methodsecurity.repository.UserRoleRepository; + +@Service +public class UserRoleService { + + @Autowired + UserRoleRepository userRoleRepository; + + @Secured("ROLE_VIEWER") + public String getUsername() { + SecurityContext securityContext = SecurityContextHolder.getContext(); + return securityContext.getAuthentication().getName(); + } + + @Secured({ "ROLE_VIEWER", "ROLE_EDITOR" }) + public boolean isValidUsername(String username) { + return userRoleRepository.isValidUsername(username); + } + + @RolesAllowed("ROLE_VIEWER") + public String getUsername2() { + SecurityContext securityContext = SecurityContextHolder.getContext(); + return securityContext.getAuthentication().getName(); + } + + @RolesAllowed({ "ROLE_VIEWER", "ROLE_EDITOR" }) + public boolean isValidUsername2(String username) { + return userRoleRepository.isValidUsername(username); + } + + @PreAuthorize("hasRole('ROLE_VIEWER')") + public String getUsernameInUpperCase() { + return getUsername().toUpperCase(); + } + + @PreAuthorize("hasAuthority('SYS_ADMIN')") + public String getUsernameLC() { + return getUsername().toLowerCase(); + } + + @PreAuthorize("hasRole('ROLE_VIEWER') or hasRole('ROLE_EDITOR')") + public boolean isValidUsername3(String username) { + return userRoleRepository.isValidUsername(username); + } + + @PreAuthorize("#username == authentication.principal.username") + public String getMyRoles(String username) { + SecurityContext securityContext = SecurityContextHolder.getContext(); + return securityContext.getAuthentication().getAuthorities().stream().map(auth -> auth.getAuthority()).collect(Collectors.joining(",")); + } + + @PostAuthorize("#username == authentication.principal.username") + public String getMyRoles2(String username) { + SecurityContext securityContext = SecurityContextHolder.getContext(); + return securityContext.getAuthentication().getAuthorities().stream().map(auth -> auth.getAuthority()).collect(Collectors.joining(",")); + } + + @PostAuthorize("returnObject.username == authentication.principal.nickName") + public CustomUser loadUserDetail(String username) { + return userRoleRepository.loadUserByUserName(username); + } + + @PreFilter("filterObject != authentication.principal.username") + public String joinUsernames(List usernames) { + return usernames.stream().collect(Collectors.joining(";")); + } + + @PreFilter(value = "filterObject != authentication.principal.username", filterTarget = "usernames") + public String joinUsernamesAndRoles(List usernames, List roles) { + return usernames.stream().collect(Collectors.joining(";")) + ":" + roles.stream().collect(Collectors.joining(";")); + } + + @PostFilter("filterObject != authentication.principal.username") + public List getAllUsernamesExceptCurrent() { + return userRoleRepository.getAllUsernames(); + } + + @IsViewer + public String getUsername4() { + SecurityContext securityContext = SecurityContextHolder.getContext(); + return securityContext.getAuthentication().getName(); + } + + @PreAuthorize("#username == authentication.principal.username") + @PostAuthorize("returnObject.username == authentication.principal.nickName") + public CustomUser securedLoadUserDetail(String username) { + return userRoleRepository.loadUserByUserName(username); + } + +} diff --git a/spring-security-core/src/main/java/com/baeldung/repository/TaskRepository.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/repository/TaskRepository.java similarity index 100% rename from spring-security-core/src/main/java/com/baeldung/repository/TaskRepository.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/repository/TaskRepository.java diff --git a/spring-security-core/src/main/java/com/baeldung/service/TaskService.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/service/TaskService.java similarity index 100% rename from spring-security-core/src/main/java/com/baeldung/service/TaskService.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/service/TaskService.java diff --git a/spring-security-core/src/main/resources/application.properties b/spring-security-modules/spring-security-core/src/main/resources/application.properties similarity index 100% rename from spring-security-core/src/main/resources/application.properties rename to spring-security-modules/spring-security-core/src/main/resources/application.properties diff --git a/spring-security-core/src/main/resources/logback.xml b/spring-security-modules/spring-security-core/src/main/resources/logback.xml similarity index 100% rename from spring-security-core/src/main/resources/logback.xml rename to spring-security-modules/spring-security-core/src/main/resources/logback.xml diff --git a/spring-security-core/src/main/webapp/WEB-INF/web.xml b/spring-security-modules/spring-security-core/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from spring-security-core/src/main/webapp/WEB-INF/web.xml rename to spring-security-modules/spring-security-core/src/main/webapp/WEB-INF/web.xml diff --git a/spring-security-core/src/test/java/com/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-core/src/test/java/com/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-core/src/test/java/com/baeldung/SpringContextTest.java diff --git a/spring-security-core/src/test/java/com/baeldung/methodsecurity/ClassLevelSecurityIntegrationTest.java b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/ClassLevelSecurityIntegrationTest.java similarity index 97% rename from spring-security-core/src/test/java/com/baeldung/methodsecurity/ClassLevelSecurityIntegrationTest.java rename to spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/ClassLevelSecurityIntegrationTest.java index 943bfda72c..d5ebdaa33b 100644 --- a/spring-security-core/src/test/java/com/baeldung/methodsecurity/ClassLevelSecurityIntegrationTest.java +++ b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/ClassLevelSecurityIntegrationTest.java @@ -1,50 +1,50 @@ -package com.baeldung.methodsecurity; - -import static org.junit.Assert.*; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.security.access.AccessDeniedException; -import org.springframework.security.test.context.support.WithMockUser; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import com.baeldung.methodsecurity.service.SystemService; - -@RunWith(SpringRunner.class) -@ContextConfiguration -public class ClassLevelSecurityIntegrationTest { - - @Autowired - SystemService systemService; - - @Configuration - @ComponentScan("com.baeldung.methodsecurity.*") - public static class SpringConfig { - - } - - @Test - @WithMockUser(username="john",roles={"ADMIN"}) - public void givenRoleAdmin_whenCallGetSystemYear_return2017(){ - String systemYear = systemService.getSystemYear(); - assertEquals("2017",systemYear); - } - - @Test(expected=AccessDeniedException.class) - @WithMockUser(username="john",roles={"VIEWER"}) - public void givenRoleViewer_whenCallGetSystemYear_returnAccessDenied(){ - String systemYear = systemService.getSystemYear(); - assertEquals("2017",systemYear); - } - - @Test - @WithMockUser(username="john",roles={"ADMIN"}) - public void givenRoleAdmin_whenCallGetSystemDate_returnDate(){ - String systemYear = systemService.getSystemDate(); - assertEquals("31-12-2017",systemYear); - } -} +package com.baeldung.methodsecurity; + +import static org.junit.Assert.*; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.access.AccessDeniedException; +import org.springframework.security.test.context.support.WithMockUser; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringRunner; + +import com.baeldung.methodsecurity.service.SystemService; + +@RunWith(SpringRunner.class) +@ContextConfiguration +public class ClassLevelSecurityIntegrationTest { + + @Autowired + SystemService systemService; + + @Configuration + @ComponentScan("com.baeldung.methodsecurity.*") + public static class SpringConfig { + + } + + @Test + @WithMockUser(username="john",roles={"ADMIN"}) + public void givenRoleAdmin_whenCallGetSystemYear_return2017(){ + String systemYear = systemService.getSystemYear(); + assertEquals("2017",systemYear); + } + + @Test(expected=AccessDeniedException.class) + @WithMockUser(username="john",roles={"VIEWER"}) + public void givenRoleViewer_whenCallGetSystemYear_returnAccessDenied(){ + String systemYear = systemService.getSystemYear(); + assertEquals("2017",systemYear); + } + + @Test + @WithMockUser(username="john",roles={"ADMIN"}) + public void givenRoleAdmin_whenCallGetSystemDate_returnDate(){ + String systemYear = systemService.getSystemDate(); + assertEquals("31-12-2017",systemYear); + } +} diff --git a/spring-security-core/src/test/java/com/baeldung/methodsecurity/MethodSecurityIntegrationTest.java b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/MethodSecurityIntegrationTest.java similarity index 97% rename from spring-security-core/src/test/java/com/baeldung/methodsecurity/MethodSecurityIntegrationTest.java rename to spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/MethodSecurityIntegrationTest.java index 81b150f43e..0ad01d9954 100644 --- a/spring-security-core/src/test/java/com/baeldung/methodsecurity/MethodSecurityIntegrationTest.java +++ b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/MethodSecurityIntegrationTest.java @@ -1,177 +1,177 @@ -package com.baeldung.methodsecurity; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.util.ArrayList; -import java.util.List; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.security.access.AccessDeniedException; -import org.springframework.security.authentication.AuthenticationCredentialsNotFoundException; -import org.springframework.security.test.context.support.WithAnonymousUser; -import org.springframework.security.test.context.support.WithMockUser; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import com.baeldung.methodsecurity.service.UserRoleService; - -@RunWith(SpringRunner.class) -@ContextConfiguration -public class MethodSecurityIntegrationTest { - - @Autowired - UserRoleService userRoleService; - - @Configuration - @ComponentScan("com.baeldung.methodsecurity.*") - public static class SpringConfig { - - } - - @Test(expected = AuthenticationCredentialsNotFoundException.class) - public void givenNoSecurity_whenCallGetUsername_thenReturnException() { - String userName = userRoleService.getUsername(); - assertEquals("john", userName); - } - - @Test - @WithMockUser(username = "john", roles = { "VIEWER" }) - public void givenRoleViewer_whenCallGetUsername_thenReturnUsername() { - String userName = userRoleService.getUsername(); - assertEquals("john", userName); - } - - @Test - @WithMockUser(username = "john", roles = { "EDITOR" }) - public void givenUsernameJohn_whenCallIsValidUsername_thenReturnTrue() { - boolean isValid = userRoleService.isValidUsername("john"); - assertEquals(true, isValid); - } - - @Test(expected = AccessDeniedException.class) - @WithMockUser(username = "john", roles = { "ADMIN" }) - public void givenRoleAdmin_whenCallGetUsername_thenReturnAccessDenied() { - userRoleService.getUsername(); - } - - @Test(expected = AccessDeniedException.class) - @WithMockUser(username = "john", roles = { "USER" }) - public void givenRoleUser_whenCallGetUsername2_thenReturnAccessDenied() { - userRoleService.getUsername2(); - } - - @Test - @WithMockUser(username = "john", roles = { "VIEWER", "EDITOR" }) - public void givenRoleViewer_whenCallGetUsername2_thenReturnUsername() { - String userName = userRoleService.getUsername2(); - assertEquals("john", userName); - } - - @Test - @WithMockUser(username = "john", roles = { "VIEWER" }) - public void givenUsernameJerry_whenCallIsValidUsername2_thenReturnFalse() { - boolean isValid = userRoleService.isValidUsername2("jerry"); - assertEquals(false, isValid); - } - - @Test - @WithMockUser(username = "JOHN", authorities = { "SYS_ADMIN" }) - public void givenAuthoritySysAdmin_whenCallGetUsernameLC_thenReturnUsername() { - String username = userRoleService.getUsernameLC(); - assertEquals("john", username); - } - - @Test - @WithMockUser(username = "john", roles = { "ADMIN", "USER", "VIEWER" }) - public void givenUserJohn_whenCallGetMyRolesWithJohn_thenReturnRoles() { - String roles = userRoleService.getMyRoles("john"); - assertEquals("ROLE_ADMIN,ROLE_USER,ROLE_VIEWER", roles); - } - - @Test(expected = AccessDeniedException.class) - @WithMockUser(username = "john", roles = { "ADMIN", "USER", "VIEWER" }) - public void givenUserJane_whenCallGetMyRolesWithJane_thenAccessDenied() { - userRoleService.getMyRoles("jane"); - } - - @Test - @WithMockUser(username = "john", roles = { "ADMIN", "USER", "VIEWER" }) - public void givenUserJohn_whenCallGetMyRoles2WithJohn_thenReturnRoles() { - String roles = userRoleService.getMyRoles2("john"); - assertEquals("ROLE_ADMIN,ROLE_USER,ROLE_VIEWER", roles); - } - - @Test(expected = AccessDeniedException.class) - @WithMockUser(username = "john", roles = { "ADMIN", "USER", "VIEWER" }) - public void givenUserJane_whenCallGetMyRoles2WithJane_thenAccessDenied() { - userRoleService.getMyRoles2("jane"); - } - - @Test(expected = AccessDeniedException.class) - @WithAnonymousUser - public void givenAnomynousUser_whenCallGetUsername_thenAccessDenied() { - userRoleService.getUsername(); - } - - @Test - @WithMockJohnViewer - public void givenMockedJohnViewer_whenCallGetUsername_thenReturnUsername() { - String userName = userRoleService.getUsername(); - assertEquals("john", userName); - } - - @Test - @WithMockUser(username = "jane") - public void givenListContainCurrentUsername_whenJoinUsernames_thenReturnUsernames() { - List usernames = new ArrayList<>(); - usernames.add("jane"); - usernames.add("john"); - usernames.add("jack"); - String containCurrentUser = userRoleService.joinUsernames(usernames); - assertEquals("john;jack", containCurrentUser); - } - - @Test - @WithMockUser(username = "john") - public void givenListContainCurrentUsername_whenCallJoinUsernamesAndRoles_thenReturnUsernameAndRoles() { - List usernames = new ArrayList<>(); - usernames.add("jane"); - usernames.add("john"); - usernames.add("jack"); - - List roles = new ArrayList<>(); - roles.add("ROLE_ADMIN"); - roles.add("ROLE_TEST"); - - String containCurrentUser = userRoleService.joinUsernamesAndRoles(usernames, roles); - assertEquals("jane;jack:ROLE_ADMIN;ROLE_TEST", containCurrentUser); - } - - @Test - @WithMockUser(username = "john") - public void givenUserJohn_whenCallGetAllUsernamesExceptCurrent_thenReturnOtherusernames() { - List others = userRoleService.getAllUsernamesExceptCurrent(); - assertEquals(2, others.size()); - assertTrue(others.contains("jane")); - assertTrue(others.contains("jack")); - } - - @Test - @WithMockUser(username = "john", roles = { "VIEWER" }) - public void givenRoleViewer_whenCallGetUsername4_thenReturnUsername() { - String userName = userRoleService.getUsername4(); - assertEquals("john", userName); - } - - @Test(expected = AccessDeniedException.class) - @WithMockUser(username = "john") - public void givenDefaultRole_whenCallGetUsername4_thenAccessDenied() { - userRoleService.getUsername4(); - } - +package com.baeldung.methodsecurity; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.List; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.access.AccessDeniedException; +import org.springframework.security.authentication.AuthenticationCredentialsNotFoundException; +import org.springframework.security.test.context.support.WithAnonymousUser; +import org.springframework.security.test.context.support.WithMockUser; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringRunner; + +import com.baeldung.methodsecurity.service.UserRoleService; + +@RunWith(SpringRunner.class) +@ContextConfiguration +public class MethodSecurityIntegrationTest { + + @Autowired + UserRoleService userRoleService; + + @Configuration + @ComponentScan("com.baeldung.methodsecurity.*") + public static class SpringConfig { + + } + + @Test(expected = AuthenticationCredentialsNotFoundException.class) + public void givenNoSecurity_whenCallGetUsername_thenReturnException() { + String userName = userRoleService.getUsername(); + assertEquals("john", userName); + } + + @Test + @WithMockUser(username = "john", roles = { "VIEWER" }) + public void givenRoleViewer_whenCallGetUsername_thenReturnUsername() { + String userName = userRoleService.getUsername(); + assertEquals("john", userName); + } + + @Test + @WithMockUser(username = "john", roles = { "EDITOR" }) + public void givenUsernameJohn_whenCallIsValidUsername_thenReturnTrue() { + boolean isValid = userRoleService.isValidUsername("john"); + assertEquals(true, isValid); + } + + @Test(expected = AccessDeniedException.class) + @WithMockUser(username = "john", roles = { "ADMIN" }) + public void givenRoleAdmin_whenCallGetUsername_thenReturnAccessDenied() { + userRoleService.getUsername(); + } + + @Test(expected = AccessDeniedException.class) + @WithMockUser(username = "john", roles = { "USER" }) + public void givenRoleUser_whenCallGetUsername2_thenReturnAccessDenied() { + userRoleService.getUsername2(); + } + + @Test + @WithMockUser(username = "john", roles = { "VIEWER", "EDITOR" }) + public void givenRoleViewer_whenCallGetUsername2_thenReturnUsername() { + String userName = userRoleService.getUsername2(); + assertEquals("john", userName); + } + + @Test + @WithMockUser(username = "john", roles = { "VIEWER" }) + public void givenUsernameJerry_whenCallIsValidUsername2_thenReturnFalse() { + boolean isValid = userRoleService.isValidUsername2("jerry"); + assertEquals(false, isValid); + } + + @Test + @WithMockUser(username = "JOHN", authorities = { "SYS_ADMIN" }) + public void givenAuthoritySysAdmin_whenCallGetUsernameLC_thenReturnUsername() { + String username = userRoleService.getUsernameLC(); + assertEquals("john", username); + } + + @Test + @WithMockUser(username = "john", roles = { "ADMIN", "USER", "VIEWER" }) + public void givenUserJohn_whenCallGetMyRolesWithJohn_thenReturnRoles() { + String roles = userRoleService.getMyRoles("john"); + assertEquals("ROLE_ADMIN,ROLE_USER,ROLE_VIEWER", roles); + } + + @Test(expected = AccessDeniedException.class) + @WithMockUser(username = "john", roles = { "ADMIN", "USER", "VIEWER" }) + public void givenUserJane_whenCallGetMyRolesWithJane_thenAccessDenied() { + userRoleService.getMyRoles("jane"); + } + + @Test + @WithMockUser(username = "john", roles = { "ADMIN", "USER", "VIEWER" }) + public void givenUserJohn_whenCallGetMyRoles2WithJohn_thenReturnRoles() { + String roles = userRoleService.getMyRoles2("john"); + assertEquals("ROLE_ADMIN,ROLE_USER,ROLE_VIEWER", roles); + } + + @Test(expected = AccessDeniedException.class) + @WithMockUser(username = "john", roles = { "ADMIN", "USER", "VIEWER" }) + public void givenUserJane_whenCallGetMyRoles2WithJane_thenAccessDenied() { + userRoleService.getMyRoles2("jane"); + } + + @Test(expected = AccessDeniedException.class) + @WithAnonymousUser + public void givenAnomynousUser_whenCallGetUsername_thenAccessDenied() { + userRoleService.getUsername(); + } + + @Test + @WithMockJohnViewer + public void givenMockedJohnViewer_whenCallGetUsername_thenReturnUsername() { + String userName = userRoleService.getUsername(); + assertEquals("john", userName); + } + + @Test + @WithMockUser(username = "jane") + public void givenListContainCurrentUsername_whenJoinUsernames_thenReturnUsernames() { + List usernames = new ArrayList<>(); + usernames.add("jane"); + usernames.add("john"); + usernames.add("jack"); + String containCurrentUser = userRoleService.joinUsernames(usernames); + assertEquals("john;jack", containCurrentUser); + } + + @Test + @WithMockUser(username = "john") + public void givenListContainCurrentUsername_whenCallJoinUsernamesAndRoles_thenReturnUsernameAndRoles() { + List usernames = new ArrayList<>(); + usernames.add("jane"); + usernames.add("john"); + usernames.add("jack"); + + List roles = new ArrayList<>(); + roles.add("ROLE_ADMIN"); + roles.add("ROLE_TEST"); + + String containCurrentUser = userRoleService.joinUsernamesAndRoles(usernames, roles); + assertEquals("jane;jack:ROLE_ADMIN;ROLE_TEST", containCurrentUser); + } + + @Test + @WithMockUser(username = "john") + public void givenUserJohn_whenCallGetAllUsernamesExceptCurrent_thenReturnOtherusernames() { + List others = userRoleService.getAllUsernamesExceptCurrent(); + assertEquals(2, others.size()); + assertTrue(others.contains("jane")); + assertTrue(others.contains("jack")); + } + + @Test + @WithMockUser(username = "john", roles = { "VIEWER" }) + public void givenRoleViewer_whenCallGetUsername4_thenReturnUsername() { + String userName = userRoleService.getUsername4(); + assertEquals("john", userName); + } + + @Test(expected = AccessDeniedException.class) + @WithMockUser(username = "john") + public void givenDefaultRole_whenCallGetUsername4_thenAccessDenied() { + userRoleService.getUsername4(); + } + } \ No newline at end of file diff --git a/spring-security-core/src/test/java/com/baeldung/methodsecurity/MockUserAtClassLevelIntegrationTest.java b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/MockUserAtClassLevelIntegrationTest.java similarity index 96% rename from spring-security-core/src/test/java/com/baeldung/methodsecurity/MockUserAtClassLevelIntegrationTest.java rename to spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/MockUserAtClassLevelIntegrationTest.java index fead89f75a..e7a2a2c828 100644 --- a/spring-security-core/src/test/java/com/baeldung/methodsecurity/MockUserAtClassLevelIntegrationTest.java +++ b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/MockUserAtClassLevelIntegrationTest.java @@ -1,35 +1,35 @@ -package com.baeldung.methodsecurity; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.security.test.context.support.WithMockUser; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import com.baeldung.methodsecurity.service.UserRoleService; - -@RunWith(SpringRunner.class) -@ContextConfiguration -@WithMockUser(username = "john", roles = { "VIEWER" }) -public class MockUserAtClassLevelIntegrationTest { - - @Test - public void givenRoleViewer_whenCallGetUsername_thenReturnUsername() { - String currentUserName = userService.getUsername(); - assertEquals("john", currentUserName); - } - - @Autowired - UserRoleService userService; - - @Configuration - @ComponentScan("com.baeldung.methodsecurity.*") - public static class SpringConfig { - - } -} +package com.baeldung.methodsecurity; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.test.context.support.WithMockUser; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringRunner; + +import com.baeldung.methodsecurity.service.UserRoleService; + +@RunWith(SpringRunner.class) +@ContextConfiguration +@WithMockUser(username = "john", roles = { "VIEWER" }) +public class MockUserAtClassLevelIntegrationTest { + + @Test + public void givenRoleViewer_whenCallGetUsername_thenReturnUsername() { + String currentUserName = userService.getUsername(); + assertEquals("john", currentUserName); + } + + @Autowired + UserRoleService userService; + + @Configuration + @ComponentScan("com.baeldung.methodsecurity.*") + public static class SpringConfig { + + } +} diff --git a/spring-security-core/src/test/java/com/baeldung/methodsecurity/UserDetailsIntegrationTest.java b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/UserDetailsIntegrationTest.java similarity index 97% rename from spring-security-core/src/test/java/com/baeldung/methodsecurity/UserDetailsIntegrationTest.java rename to spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/UserDetailsIntegrationTest.java index d43a26a5ff..c1298b1124 100644 --- a/spring-security-core/src/test/java/com/baeldung/methodsecurity/UserDetailsIntegrationTest.java +++ b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/UserDetailsIntegrationTest.java @@ -1,57 +1,57 @@ -package com.baeldung.methodsecurity; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.security.access.AccessDeniedException; -import org.springframework.security.test.context.support.WithUserDetails; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import com.baeldung.methodsecurity.entity.CustomUser; -import com.baeldung.methodsecurity.service.UserRoleService; - -@RunWith(SpringRunner.class) -@ContextConfiguration -public class UserDetailsIntegrationTest { - - @Autowired - UserRoleService userService; - - @Configuration - @ComponentScan("com.baeldung.methodsecurity.*") - public static class SpringConfig { - - } - - @Test - @WithUserDetails(value = "john", userDetailsServiceBeanName = "userDetailService") - public void whenJohn_callLoadUserDetail_thenOK() { - CustomUser user = userService.loadUserDetail("jane"); - assertEquals("jane", user.getNickName()); - } - - @Test - @WithUserDetails(value = "jane", userDetailsServiceBeanName = "userDetailService") - public void givenJane_callSecuredLoadUserDetailWithJane_thenOK() { - CustomUser user = userService.securedLoadUserDetail("jane"); - assertEquals("jane", user.getNickName()); - assertEquals("jane", user.getUsername()); - } - - @Test(expected = AccessDeniedException.class) - @WithUserDetails(value = "john", userDetailsServiceBeanName = "userDetailService") - public void givenJohn_callSecuredLoadUserDetailWithJane_thenAccessDenied() { - userService.securedLoadUserDetail("jane"); - } - - @Test(expected = AccessDeniedException.class) - @WithUserDetails(value = "john", userDetailsServiceBeanName = "userDetailService") - public void givenJohn_callSecuredLoadUserDetailWithJohn_thenAccessDenied() { - userService.securedLoadUserDetail("john"); - } -} +package com.baeldung.methodsecurity; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.access.AccessDeniedException; +import org.springframework.security.test.context.support.WithUserDetails; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringRunner; + +import com.baeldung.methodsecurity.entity.CustomUser; +import com.baeldung.methodsecurity.service.UserRoleService; + +@RunWith(SpringRunner.class) +@ContextConfiguration +public class UserDetailsIntegrationTest { + + @Autowired + UserRoleService userService; + + @Configuration + @ComponentScan("com.baeldung.methodsecurity.*") + public static class SpringConfig { + + } + + @Test + @WithUserDetails(value = "john", userDetailsServiceBeanName = "userDetailService") + public void whenJohn_callLoadUserDetail_thenOK() { + CustomUser user = userService.loadUserDetail("jane"); + assertEquals("jane", user.getNickName()); + } + + @Test + @WithUserDetails(value = "jane", userDetailsServiceBeanName = "userDetailService") + public void givenJane_callSecuredLoadUserDetailWithJane_thenOK() { + CustomUser user = userService.securedLoadUserDetail("jane"); + assertEquals("jane", user.getNickName()); + assertEquals("jane", user.getUsername()); + } + + @Test(expected = AccessDeniedException.class) + @WithUserDetails(value = "john", userDetailsServiceBeanName = "userDetailService") + public void givenJohn_callSecuredLoadUserDetailWithJane_thenAccessDenied() { + userService.securedLoadUserDetail("jane"); + } + + @Test(expected = AccessDeniedException.class) + @WithUserDetails(value = "john", userDetailsServiceBeanName = "userDetailService") + public void givenJohn_callSecuredLoadUserDetailWithJohn_thenAccessDenied() { + userService.securedLoadUserDetail("john"); + } +} diff --git a/spring-security-core/src/test/java/com/baeldung/methodsecurity/WithMockJohnViewer.java b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/WithMockJohnViewer.java similarity index 97% rename from spring-security-core/src/test/java/com/baeldung/methodsecurity/WithMockJohnViewer.java rename to spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/WithMockJohnViewer.java index f05a6bc20e..51c3904331 100644 --- a/spring-security-core/src/test/java/com/baeldung/methodsecurity/WithMockJohnViewer.java +++ b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/WithMockJohnViewer.java @@ -1,10 +1,10 @@ -package com.baeldung.methodsecurity; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -import org.springframework.security.test.context.support.WithMockUser; - -@Retention(RetentionPolicy.RUNTIME) -@WithMockUser(value="john",roles="VIEWER") +package com.baeldung.methodsecurity; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +import org.springframework.security.test.context.support.WithMockUser; + +@Retention(RetentionPolicy.RUNTIME) +@WithMockUser(value="john",roles="VIEWER") public @interface WithMockJohnViewer { } \ No newline at end of file diff --git a/spring-security-core/src/test/java/com/baeldung/test/LiveTest.java b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/test/LiveTest.java similarity index 100% rename from spring-security-core/src/test/java/com/baeldung/test/LiveTest.java rename to spring-security-modules/spring-security-core/src/test/java/com/baeldung/test/LiveTest.java diff --git a/spring-security-core/src/test/resources/.gitignore b/spring-security-modules/spring-security-core/src/test/resources/.gitignore similarity index 100% rename from spring-security-core/src/test/resources/.gitignore rename to spring-security-modules/spring-security-core/src/test/resources/.gitignore diff --git a/spring-security-cors/README.md b/spring-security-modules/spring-security-cors/README.md similarity index 100% rename from spring-security-cors/README.md rename to spring-security-modules/spring-security-cors/README.md diff --git a/spring-security-cors/pom.xml b/spring-security-modules/spring-security-cors/pom.xml similarity index 100% rename from spring-security-cors/pom.xml rename to spring-security-modules/spring-security-cors/pom.xml diff --git a/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/basicauth/SpringBootSecurityApplication.java b/spring-security-modules/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/basicauth/SpringBootSecurityApplication.java similarity index 100% rename from spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/basicauth/SpringBootSecurityApplication.java rename to spring-security-modules/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/basicauth/SpringBootSecurityApplication.java diff --git a/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/basicauth/config/WebSecurityConfig.java b/spring-security-modules/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/basicauth/config/WebSecurityConfig.java similarity index 100% rename from spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/basicauth/config/WebSecurityConfig.java rename to spring-security-modules/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/basicauth/config/WebSecurityConfig.java diff --git a/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/controller/ResourceController.java b/spring-security-modules/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/controller/ResourceController.java similarity index 96% rename from spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/controller/ResourceController.java rename to spring-security-modules/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/controller/ResourceController.java index 7292c7f4f4..5d7d9f7770 100644 --- a/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/controller/ResourceController.java +++ b/spring-security-modules/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/controller/ResourceController.java @@ -1,17 +1,17 @@ -package com.baeldung.springbootsecuritycors.controller; - -import java.security.Principal; - -import org.springframework.web.bind.annotation.CrossOrigin; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@CrossOrigin("http://localhost:4200") -public class ResourceController { - - @GetMapping("/user") - public String user(Principal principal) { - return principal.getName(); - } -} +package com.baeldung.springbootsecuritycors.controller; + +import java.security.Principal; + +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@CrossOrigin("http://localhost:4200") +public class ResourceController { + + @GetMapping("/user") + public String user(Principal principal) { + return principal.getName(); + } +} diff --git a/spring-security-cors/src/test/java/com/baeldung/springbootsecuritycors/ResourceControllerTest.java b/spring-security-modules/spring-security-cors/src/test/java/com/baeldung/springbootsecuritycors/ResourceControllerTest.java similarity index 97% rename from spring-security-cors/src/test/java/com/baeldung/springbootsecuritycors/ResourceControllerTest.java rename to spring-security-modules/spring-security-cors/src/test/java/com/baeldung/springbootsecuritycors/ResourceControllerTest.java index b45529ca5f..a471eb922f 100644 --- a/spring-security-cors/src/test/java/com/baeldung/springbootsecuritycors/ResourceControllerTest.java +++ b/spring-security-modules/spring-security-cors/src/test/java/com/baeldung/springbootsecuritycors/ResourceControllerTest.java @@ -1,42 +1,42 @@ -package com.baeldung.springbootsecuritycors; - -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.options; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.test.web.servlet.setup.MockMvcBuilders; -import org.springframework.web.context.WebApplicationContext; - -import com.baeldung.springbootsecuritycors.basicauth.SpringBootSecurityApplication; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = { SpringBootSecurityApplication.class }) -public class ResourceControllerTest { - - private MockMvc mockMvc; - - @Autowired - private WebApplicationContext wac; - - @Before - public void setUp() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac) - .apply(SecurityMockMvcConfigurers.springSecurity()) - .build(); - } - - @Test - public void givenPreFlightRequest_whenPerfomed_shouldReturnOK() throws Exception { - mockMvc.perform(options("/user") - .header("Access-Control-Request-Method", "GET") - .header("Origin", "http://localhost:4200")) - .andExpect(status().isOk()); - } -} +package com.baeldung.springbootsecuritycors; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.options; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.springframework.web.context.WebApplicationContext; + +import com.baeldung.springbootsecuritycors.basicauth.SpringBootSecurityApplication; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = { SpringBootSecurityApplication.class }) +public class ResourceControllerTest { + + private MockMvc mockMvc; + + @Autowired + private WebApplicationContext wac; + + @Before + public void setUp() { + this.mockMvc = MockMvcBuilders.webAppContextSetup(wac) + .apply(SecurityMockMvcConfigurers.springSecurity()) + .build(); + } + + @Test + public void givenPreFlightRequest_whenPerfomed_shouldReturnOK() throws Exception { + mockMvc.perform(options("/user") + .header("Access-Control-Request-Method", "GET") + .header("Origin", "http://localhost:4200")) + .andExpect(status().isOk()); + } +} diff --git a/spring-security-kerberos/README.md b/spring-security-modules/spring-security-kerberos/README.md similarity index 100% rename from spring-security-kerberos/README.md rename to spring-security-modules/spring-security-kerberos/README.md diff --git a/spring-security-kerberos/pom.xml b/spring-security-modules/spring-security-kerberos/pom.xml similarity index 97% rename from spring-security-kerberos/pom.xml rename to spring-security-modules/spring-security-kerberos/pom.xml index 7da1f1792b..6846bdf063 100644 --- a/spring-security-kerberos/pom.xml +++ b/spring-security-modules/spring-security-kerberos/pom.xml @@ -12,7 +12,7 @@ com.baeldung parent-boot-1 0.0.1-SNAPSHOT - ../parent-boot-1 + ../../parent-boot-1 diff --git a/spring-security-kerberos/src/main/java/org/baeldung/Application.java b/spring-security-modules/spring-security-kerberos/src/main/java/org/baeldung/Application.java similarity index 100% rename from spring-security-kerberos/src/main/java/org/baeldung/Application.java rename to spring-security-modules/spring-security-kerberos/src/main/java/org/baeldung/Application.java diff --git a/spring-security-kerberos/src/main/java/org/baeldung/config/WebSecurityConfig.java b/spring-security-modules/spring-security-kerberos/src/main/java/org/baeldung/config/WebSecurityConfig.java similarity index 100% rename from spring-security-kerberos/src/main/java/org/baeldung/config/WebSecurityConfig.java rename to spring-security-modules/spring-security-kerberos/src/main/java/org/baeldung/config/WebSecurityConfig.java diff --git a/spring-security-kerberos/src/main/java/org/baeldung/security/DummyUserDetailsService.java b/spring-security-modules/spring-security-kerberos/src/main/java/org/baeldung/security/DummyUserDetailsService.java similarity index 100% rename from spring-security-kerberos/src/main/java/org/baeldung/security/DummyUserDetailsService.java rename to spring-security-modules/spring-security-kerberos/src/main/java/org/baeldung/security/DummyUserDetailsService.java diff --git a/spring-security-mvc-boot/README.md b/spring-security-modules/spring-security-mvc-boot/README.md similarity index 100% rename from spring-security-mvc-boot/README.md rename to spring-security-modules/spring-security-mvc-boot/README.md diff --git a/spring-security-mvc-boot/WebContent/META-INF/MANIFEST.MF b/spring-security-modules/spring-security-mvc-boot/WebContent/META-INF/MANIFEST.MF similarity index 100% rename from spring-security-mvc-boot/WebContent/META-INF/MANIFEST.MF rename to spring-security-modules/spring-security-mvc-boot/WebContent/META-INF/MANIFEST.MF diff --git a/spring-security-mvc-boot/pom.xml b/spring-security-modules/spring-security-mvc-boot/pom.xml similarity index 99% rename from spring-security-mvc-boot/pom.xml rename to spring-security-modules/spring-security-mvc-boot/pom.xml index f4e50cce4c..489ec2d427 100644 --- a/spring-security-mvc-boot/pom.xml +++ b/spring-security-modules/spring-security-mvc-boot/pom.xml @@ -13,7 +13,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/spring-security-mvc-boot/src/main/java/com/baeldung/AppConfig.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/AppConfig.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/com/baeldung/AppConfig.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/AppConfig.java diff --git a/spring-security-mvc-boot/src/main/java/com/baeldung/SpringSecurityConfig.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/SpringSecurityConfig.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/com/baeldung/SpringSecurityConfig.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/SpringSecurityConfig.java diff --git a/spring-security-mvc-boot/src/main/java/com/baeldung/data/repositories/TweetRepository.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/data/repositories/TweetRepository.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/com/baeldung/data/repositories/TweetRepository.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/data/repositories/TweetRepository.java diff --git a/spring-security-mvc-boot/src/main/java/com/baeldung/data/repositories/UserRepository.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/data/repositories/UserRepository.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/com/baeldung/data/repositories/UserRepository.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/data/repositories/UserRepository.java diff --git a/spring-security-mvc-boot/src/main/java/com/baeldung/models/AppUser.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/models/AppUser.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/com/baeldung/models/AppUser.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/models/AppUser.java diff --git a/spring-security-mvc-boot/src/main/java/com/baeldung/models/Tweet.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/models/Tweet.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/com/baeldung/models/Tweet.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/models/Tweet.java diff --git a/spring-security-mvc-boot/src/main/java/com/baeldung/security/AppUserPrincipal.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/security/AppUserPrincipal.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/com/baeldung/security/AppUserPrincipal.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/security/AppUserPrincipal.java diff --git a/spring-security-mvc-boot/src/main/java/com/baeldung/security/AuthenticationSuccessHandlerImpl.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/security/AuthenticationSuccessHandlerImpl.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/com/baeldung/security/AuthenticationSuccessHandlerImpl.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/security/AuthenticationSuccessHandlerImpl.java diff --git a/spring-security-mvc-boot/src/main/java/com/baeldung/security/CustomUserDetailsService.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/security/CustomUserDetailsService.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/com/baeldung/security/CustomUserDetailsService.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/security/CustomUserDetailsService.java diff --git a/spring-security-mvc-boot/src/main/java/com/baeldung/util/DummyContentUtil.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/util/DummyContentUtil.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/com/baeldung/util/DummyContentUtil.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/util/DummyContentUtil.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/custom/Application.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/Application.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/custom/Application.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/Application.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/custom/config/MethodSecurityConfig.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/config/MethodSecurityConfig.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/custom/config/MethodSecurityConfig.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/config/MethodSecurityConfig.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/custom/config/MvcConfig.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/config/MvcConfig.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/custom/config/MvcConfig.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/config/MvcConfig.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/custom/config/SecurityConfig.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/config/SecurityConfig.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/custom/config/SecurityConfig.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/config/SecurityConfig.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/SetupData.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/SetupData.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/SetupData.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/SetupData.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/dao/OrganizationRepository.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/dao/OrganizationRepository.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/dao/OrganizationRepository.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/dao/OrganizationRepository.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/dao/PrivilegeRepository.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/dao/PrivilegeRepository.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/dao/PrivilegeRepository.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/dao/PrivilegeRepository.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/dao/UserRepository.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/dao/UserRepository.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/dao/UserRepository.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/dao/UserRepository.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/model/Foo.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/model/Foo.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/model/Foo.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/model/Foo.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/model/Organization.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/model/Organization.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/model/Organization.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/model/Organization.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/model/Privilege.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/model/Privilege.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/model/Privilege.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/model/Privilege.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/model/User.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/model/User.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/model/User.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/persistence/model/User.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/custom/security/CustomMethodSecurityExpressionHandler.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/security/CustomMethodSecurityExpressionHandler.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/custom/security/CustomMethodSecurityExpressionHandler.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/security/CustomMethodSecurityExpressionHandler.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/custom/security/CustomMethodSecurityExpressionRoot.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/security/CustomMethodSecurityExpressionRoot.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/custom/security/CustomMethodSecurityExpressionRoot.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/security/CustomMethodSecurityExpressionRoot.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/custom/security/CustomPermissionEvaluator.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/security/CustomPermissionEvaluator.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/custom/security/CustomPermissionEvaluator.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/security/CustomPermissionEvaluator.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/custom/security/MySecurityExpressionRoot.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/security/MySecurityExpressionRoot.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/custom/security/MySecurityExpressionRoot.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/security/MySecurityExpressionRoot.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/custom/security/MyUserDetailsService.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/security/MyUserDetailsService.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/custom/security/MyUserDetailsService.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/security/MyUserDetailsService.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/custom/security/MyUserPrincipal.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/security/MyUserPrincipal.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/custom/security/MyUserPrincipal.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/security/MyUserPrincipal.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/custom/web/MainController.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/web/MainController.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/custom/web/MainController.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/custom/web/MainController.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/ip/IpApplication.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/ip/IpApplication.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/ip/IpApplication.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/ip/IpApplication.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/ip/config/CustomIpAuthenticationProvider.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/ip/config/CustomIpAuthenticationProvider.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/ip/config/CustomIpAuthenticationProvider.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/ip/config/CustomIpAuthenticationProvider.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/ip/config/SecurityConfig.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/ip/config/SecurityConfig.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/ip/config/SecurityConfig.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/ip/config/SecurityConfig.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/ip/config/SecurityXmlConfig.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/ip/config/SecurityXmlConfig.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/ip/config/SecurityXmlConfig.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/ip/config/SecurityXmlConfig.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/ip/web/MainController.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/ip/web/MainController.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/ip/web/MainController.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/ip/web/MainController.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/h2/H2JdbcAuthenticationApplication.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/h2/H2JdbcAuthenticationApplication.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/h2/H2JdbcAuthenticationApplication.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/h2/H2JdbcAuthenticationApplication.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/h2/config/SecurityConfiguration.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/h2/config/SecurityConfiguration.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/h2/config/SecurityConfiguration.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/h2/config/SecurityConfiguration.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/h2/web/UserController.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/h2/web/UserController.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/h2/web/UserController.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/h2/web/UserController.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/mysql/MySqlJdbcAuthenticationApplication.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/mysql/MySqlJdbcAuthenticationApplication.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/mysql/MySqlJdbcAuthenticationApplication.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/mysql/MySqlJdbcAuthenticationApplication.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/mysql/config/SecurityConfiguration.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/mysql/config/SecurityConfiguration.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/mysql/config/SecurityConfiguration.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/mysql/config/SecurityConfiguration.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/mysql/web/UserController.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/mysql/web/UserController.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/mysql/web/UserController.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/mysql/web/UserController.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/postgre/PostgreJdbcAuthenticationApplication.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/postgre/PostgreJdbcAuthenticationApplication.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/postgre/PostgreJdbcAuthenticationApplication.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/postgre/PostgreJdbcAuthenticationApplication.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/postgre/config/SecurityConfiguration.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/postgre/config/SecurityConfiguration.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/postgre/config/SecurityConfiguration.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/postgre/config/SecurityConfiguration.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/postgre/web/UserController.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/postgre/web/UserController.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/postgre/web/UserController.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/jdbcauthentication/postgre/web/UserController.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/multipleauthproviders/CustomAuthenticationProvider.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/multipleauthproviders/CustomAuthenticationProvider.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/multipleauthproviders/CustomAuthenticationProvider.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/multipleauthproviders/CustomAuthenticationProvider.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthController.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthController.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthController.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthController.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthProvidersApplication.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthProvidersApplication.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthProvidersApplication.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthProvidersApplication.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthProvidersSecurityConfig.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthProvidersSecurityConfig.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthProvidersSecurityConfig.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/multipleauthproviders/MultipleAuthProvidersSecurityConfig.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/multipleentrypoints/MultipleEntryPointsApplication.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/multipleentrypoints/MultipleEntryPointsApplication.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/multipleentrypoints/MultipleEntryPointsApplication.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/multipleentrypoints/MultipleEntryPointsApplication.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/multipleentrypoints/MultipleEntryPointsSecurityConfig.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/multipleentrypoints/MultipleEntryPointsSecurityConfig.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/multipleentrypoints/MultipleEntryPointsSecurityConfig.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/multipleentrypoints/MultipleEntryPointsSecurityConfig.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/multipleentrypoints/PagesController.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/multipleentrypoints/PagesController.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/multipleentrypoints/PagesController.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/multipleentrypoints/PagesController.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/multiplelogin/MultipleLoginApplication.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/multiplelogin/MultipleLoginApplication.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/multiplelogin/MultipleLoginApplication.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/multiplelogin/MultipleLoginApplication.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/multiplelogin/MultipleLoginMvcConfig.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/multiplelogin/MultipleLoginMvcConfig.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/multiplelogin/MultipleLoginMvcConfig.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/multiplelogin/MultipleLoginMvcConfig.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/multiplelogin/MultipleLoginSecurityConfig.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/multiplelogin/MultipleLoginSecurityConfig.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/multiplelogin/MultipleLoginSecurityConfig.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/multiplelogin/MultipleLoginSecurityConfig.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/multiplelogin/UsersController.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/multiplelogin/UsersController.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/multiplelogin/UsersController.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/multiplelogin/UsersController.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/CustomAuthenticationProvider.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/CustomAuthenticationProvider.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/CustomAuthenticationProvider.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/CustomAuthenticationProvider.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/MyLogoutSuccessHandler.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/MyLogoutSuccessHandler.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/MyLogoutSuccessHandler.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/MyLogoutSuccessHandler.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/MyUserDetailsService.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/MyUserDetailsService.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/MyUserDetailsService.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/MyUserDetailsService.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/RolesAuthoritiesApplication.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/RolesAuthoritiesApplication.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/RolesAuthoritiesApplication.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/RolesAuthoritiesApplication.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/config/MvcConfig.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/config/MvcConfig.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/config/MvcConfig.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/config/MvcConfig.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/config/SecurityConfig.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/config/SecurityConfig.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/config/SecurityConfig.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/config/SecurityConfig.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/model/Privilege.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/model/Privilege.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/model/Privilege.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/model/Privilege.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/model/Role.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/model/Role.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/model/Role.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/model/Role.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/model/User.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/model/User.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/model/User.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/model/User.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/persistence/IUserService.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/persistence/IUserService.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/persistence/IUserService.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/persistence/IUserService.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/persistence/PrivilegeRepository.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/persistence/PrivilegeRepository.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/persistence/PrivilegeRepository.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/persistence/PrivilegeRepository.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/persistence/RoleRepository.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/persistence/RoleRepository.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/persistence/RoleRepository.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/persistence/RoleRepository.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/persistence/SetupDataLoader.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/persistence/SetupDataLoader.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/persistence/SetupDataLoader.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/persistence/SetupDataLoader.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/persistence/UserRepository.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/persistence/UserRepository.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/persistence/UserRepository.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/persistence/UserRepository.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/persistence/UserService.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/persistence/UserService.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/persistence/UserService.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/rolesauthorities/persistence/UserService.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/HttpsEnabledApplication.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/HttpsEnabledApplication.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/ssl/HttpsEnabledApplication.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/HttpsEnabledApplication.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/SecurityConfig.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/SecurityConfig.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/ssl/SecurityConfig.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/SecurityConfig.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/WelcomeController.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/WelcomeController.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/ssl/WelcomeController.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/ssl/WelcomeController.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/voter/MinuteBasedVoter.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/voter/MinuteBasedVoter.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/voter/MinuteBasedVoter.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/voter/MinuteBasedVoter.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/voter/VoterApplication.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/voter/VoterApplication.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/voter/VoterApplication.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/voter/VoterApplication.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/voter/VoterMvcConfig.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/voter/VoterMvcConfig.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/voter/VoterMvcConfig.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/voter/VoterMvcConfig.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/voter/WebSecurityConfig.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/voter/WebSecurityConfig.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/voter/WebSecurityConfig.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/voter/WebSecurityConfig.java diff --git a/spring-security-mvc-boot/src/main/java/org/baeldung/voter/XmlSecurityConfig.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/voter/XmlSecurityConfig.java similarity index 100% rename from spring-security-mvc-boot/src/main/java/org/baeldung/voter/XmlSecurityConfig.java rename to spring-security-modules/spring-security-mvc-boot/src/main/java/org/baeldung/voter/XmlSecurityConfig.java diff --git a/spring-security-mvc-boot/src/main/resources/application-defaults.properties b/spring-security-modules/spring-security-mvc-boot/src/main/resources/application-defaults.properties similarity index 100% rename from spring-security-mvc-boot/src/main/resources/application-defaults.properties rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/application-defaults.properties diff --git a/spring-security-mvc-boot/src/main/resources/application-mysql.properties b/spring-security-modules/spring-security-mvc-boot/src/main/resources/application-mysql.properties similarity index 100% rename from spring-security-mvc-boot/src/main/resources/application-mysql.properties rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/application-mysql.properties diff --git a/spring-security-mvc-boot/src/main/resources/application-postgre.properties b/spring-security-modules/spring-security-mvc-boot/src/main/resources/application-postgre.properties similarity index 100% rename from spring-security-mvc-boot/src/main/resources/application-postgre.properties rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/application-postgre.properties diff --git a/spring-security-mvc-boot/src/main/resources/application-ssl.properties b/spring-security-modules/spring-security-mvc-boot/src/main/resources/application-ssl.properties similarity index 100% rename from spring-security-mvc-boot/src/main/resources/application-ssl.properties rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/application-ssl.properties diff --git a/spring-security-mvc-boot/src/main/resources/application.properties b/spring-security-modules/spring-security-mvc-boot/src/main/resources/application.properties similarity index 100% rename from spring-security-mvc-boot/src/main/resources/application.properties rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/application.properties diff --git a/spring-security-mvc-boot/src/main/resources/data-mysql.sql b/spring-security-modules/spring-security-mvc-boot/src/main/resources/data-mysql.sql similarity index 100% rename from spring-security-mvc-boot/src/main/resources/data-mysql.sql rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/data-mysql.sql diff --git a/spring-security-mvc-boot/src/main/resources/data-postgre.sql b/spring-security-modules/spring-security-mvc-boot/src/main/resources/data-postgre.sql similarity index 100% rename from spring-security-mvc-boot/src/main/resources/data-postgre.sql rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/data-postgre.sql diff --git a/spring-security-mvc-boot/src/main/resources/keystore/baeldung.p12 b/spring-security-modules/spring-security-mvc-boot/src/main/resources/keystore/baeldung.p12 similarity index 100% rename from spring-security-mvc-boot/src/main/resources/keystore/baeldung.p12 rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/keystore/baeldung.p12 diff --git a/spring-security-mvc-boot/src/main/resources/logback.xml b/spring-security-modules/spring-security-mvc-boot/src/main/resources/logback.xml similarity index 100% rename from spring-security-mvc-boot/src/main/resources/logback.xml rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/logback.xml diff --git a/spring-security-mvc-boot/src/main/resources/persistence-h2.properties b/spring-security-modules/spring-security-mvc-boot/src/main/resources/persistence-h2.properties similarity index 100% rename from spring-security-mvc-boot/src/main/resources/persistence-h2.properties rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/persistence-h2.properties diff --git a/spring-security-mvc-boot/src/main/resources/schema-mysql.sql b/spring-security-modules/spring-security-mvc-boot/src/main/resources/schema-mysql.sql similarity index 100% rename from spring-security-mvc-boot/src/main/resources/schema-mysql.sql rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/schema-mysql.sql diff --git a/spring-security-mvc-boot/src/main/resources/schema-postgre.sql b/spring-security-modules/spring-security-mvc-boot/src/main/resources/schema-postgre.sql similarity index 100% rename from spring-security-mvc-boot/src/main/resources/schema-postgre.sql rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/schema-postgre.sql diff --git a/spring-security-mvc-boot/src/main/resources/spring-security-custom-voter.xml b/spring-security-modules/spring-security-mvc-boot/src/main/resources/spring-security-custom-voter.xml similarity index 100% rename from spring-security-mvc-boot/src/main/resources/spring-security-custom-voter.xml rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/spring-security-custom-voter.xml diff --git a/spring-security-mvc-boot/src/main/resources/spring-security-ip.xml b/spring-security-modules/spring-security-mvc-boot/src/main/resources/spring-security-ip.xml similarity index 100% rename from spring-security-mvc-boot/src/main/resources/spring-security-ip.xml rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/spring-security-ip.xml diff --git a/spring-security-mvc-boot/src/main/resources/spring-security-multiple-auth-providers.xml b/spring-security-modules/spring-security-mvc-boot/src/main/resources/spring-security-multiple-auth-providers.xml similarity index 100% rename from spring-security-mvc-boot/src/main/resources/spring-security-multiple-auth-providers.xml rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/spring-security-multiple-auth-providers.xml diff --git a/spring-security-mvc-boot/src/main/resources/spring-security-multiple-entry.xml b/spring-security-modules/spring-security-mvc-boot/src/main/resources/spring-security-multiple-entry.xml similarity index 100% rename from spring-security-mvc-boot/src/main/resources/spring-security-multiple-entry.xml rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/spring-security-multiple-entry.xml diff --git a/spring-security-mvc-boot/src/main/resources/templates/403.html b/spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/403.html similarity index 100% rename from spring-security-mvc-boot/src/main/resources/templates/403.html rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/403.html diff --git a/spring-security-mvc-boot/src/main/resources/templates/adminPage.html b/spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/adminPage.html similarity index 100% rename from spring-security-mvc-boot/src/main/resources/templates/adminPage.html rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/adminPage.html diff --git a/spring-security-mvc-boot/src/main/resources/templates/index.html b/spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/index.html similarity index 100% rename from spring-security-mvc-boot/src/main/resources/templates/index.html rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/index.html diff --git a/spring-security-mvc-boot/src/main/resources/templates/login.html b/spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/login.html similarity index 100% rename from spring-security-mvc-boot/src/main/resources/templates/login.html rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/login.html diff --git a/spring-security-mvc-boot/src/main/resources/templates/loginAdmin.html b/spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/loginAdmin.html similarity index 100% rename from spring-security-mvc-boot/src/main/resources/templates/loginAdmin.html rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/loginAdmin.html diff --git a/spring-security-mvc-boot/src/main/resources/templates/loginUser.html b/spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/loginUser.html similarity index 100% rename from spring-security-mvc-boot/src/main/resources/templates/loginUser.html rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/loginUser.html diff --git a/spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/login.html b/spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/login.html similarity index 100% rename from spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/login.html rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/login.html diff --git a/spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/loginWithWarning.html b/spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/loginWithWarning.html similarity index 100% rename from spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/loginWithWarning.html rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/loginWithWarning.html diff --git a/spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/multipleHttpLinks.html b/spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/multipleHttpLinks.html similarity index 100% rename from spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/multipleHttpLinks.html rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/multipleHttpLinks.html diff --git a/spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/myAdminPage.html b/spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/myAdminPage.html similarity index 100% rename from spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/myAdminPage.html rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/myAdminPage.html diff --git a/spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/myGuestPage.html b/spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/myGuestPage.html similarity index 100% rename from spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/myGuestPage.html rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/myGuestPage.html diff --git a/spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/myPrivateUserPage.html b/spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/myPrivateUserPage.html similarity index 100% rename from spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/myPrivateUserPage.html rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/myPrivateUserPage.html diff --git a/spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/myUserPage.html b/spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/myUserPage.html similarity index 100% rename from spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/myUserPage.html rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/multipleHttpElems/myUserPage.html diff --git a/spring-security-mvc-boot/src/main/resources/templates/private.html b/spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/private.html similarity index 100% rename from spring-security-mvc-boot/src/main/resources/templates/private.html rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/private.html diff --git a/spring-security-mvc-boot/src/main/resources/templates/protectedLinks.html b/spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/protectedLinks.html similarity index 100% rename from spring-security-mvc-boot/src/main/resources/templates/protectedLinks.html rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/protectedLinks.html diff --git a/spring-security-mvc-boot/src/main/resources/templates/rolesauthorities/home.html b/spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/rolesauthorities/home.html similarity index 100% rename from spring-security-mvc-boot/src/main/resources/templates/rolesauthorities/home.html rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/rolesauthorities/home.html diff --git a/spring-security-mvc-boot/src/main/resources/templates/rolesauthorities/login.html b/spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/rolesauthorities/login.html similarity index 100% rename from spring-security-mvc-boot/src/main/resources/templates/rolesauthorities/login.html rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/rolesauthorities/login.html diff --git a/spring-security-mvc-boot/src/main/resources/templates/rolesauthorities/protectedbyauthority.html b/spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/rolesauthorities/protectedbyauthority.html similarity index 100% rename from spring-security-mvc-boot/src/main/resources/templates/rolesauthorities/protectedbyauthority.html rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/rolesauthorities/protectedbyauthority.html diff --git a/spring-security-mvc-boot/src/main/resources/templates/rolesauthorities/protectedbynothing.html b/spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/rolesauthorities/protectedbynothing.html similarity index 100% rename from spring-security-mvc-boot/src/main/resources/templates/rolesauthorities/protectedbynothing.html rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/rolesauthorities/protectedbynothing.html diff --git a/spring-security-mvc-boot/src/main/resources/templates/rolesauthorities/protectedbyrole.html b/spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/rolesauthorities/protectedbyrole.html similarity index 100% rename from spring-security-mvc-boot/src/main/resources/templates/rolesauthorities/protectedbyrole.html rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/rolesauthorities/protectedbyrole.html diff --git a/spring-security-mvc-boot/src/main/resources/templates/ssl/welcome.html b/spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/ssl/welcome.html similarity index 100% rename from spring-security-mvc-boot/src/main/resources/templates/ssl/welcome.html rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/ssl/welcome.html diff --git a/spring-security-mvc-boot/src/main/resources/templates/userPage.html b/spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/userPage.html similarity index 100% rename from spring-security-mvc-boot/src/main/resources/templates/userPage.html rename to spring-security-modules/spring-security-mvc-boot/src/main/resources/templates/userPage.html diff --git a/spring-security-mvc-boot/src/test/java/com/baeldung/relationships/SpringDataWithSecurityIntegrationTest.java b/spring-security-modules/spring-security-mvc-boot/src/test/java/com/baeldung/relationships/SpringDataWithSecurityIntegrationTest.java similarity index 100% rename from spring-security-mvc-boot/src/test/java/com/baeldung/relationships/SpringDataWithSecurityIntegrationTest.java rename to spring-security-modules/spring-security-mvc-boot/src/test/java/com/baeldung/relationships/SpringDataWithSecurityIntegrationTest.java diff --git a/spring-security-mvc-boot/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-mvc-boot/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-mvc-boot/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-mvc-boot/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-mvc-boot/src/test/java/org/baeldung/jdbcauthentication/h2/SpringContextTest.java b/spring-security-modules/spring-security-mvc-boot/src/test/java/org/baeldung/jdbcauthentication/h2/SpringContextTest.java similarity index 100% rename from spring-security-mvc-boot/src/test/java/org/baeldung/jdbcauthentication/h2/SpringContextTest.java rename to spring-security-modules/spring-security-mvc-boot/src/test/java/org/baeldung/jdbcauthentication/h2/SpringContextTest.java diff --git a/spring-security-mvc-boot/src/test/java/org/baeldung/jdbcauthentication/h2/web/UserControllerLiveTest.java b/spring-security-modules/spring-security-mvc-boot/src/test/java/org/baeldung/jdbcauthentication/h2/web/UserControllerLiveTest.java similarity index 100% rename from spring-security-mvc-boot/src/test/java/org/baeldung/jdbcauthentication/h2/web/UserControllerLiveTest.java rename to spring-security-modules/spring-security-mvc-boot/src/test/java/org/baeldung/jdbcauthentication/h2/web/UserControllerLiveTest.java diff --git a/spring-security-mvc-boot/src/test/java/org/baeldung/jdbcauthentication/mysql/web/UserControllerLiveTest.java b/spring-security-modules/spring-security-mvc-boot/src/test/java/org/baeldung/jdbcauthentication/mysql/web/UserControllerLiveTest.java similarity index 100% rename from spring-security-mvc-boot/src/test/java/org/baeldung/jdbcauthentication/mysql/web/UserControllerLiveTest.java rename to spring-security-modules/spring-security-mvc-boot/src/test/java/org/baeldung/jdbcauthentication/mysql/web/UserControllerLiveTest.java diff --git a/spring-security-mvc-boot/src/test/java/org/baeldung/jdbcauthentication/postgre/web/UserControllerLiveTest.java b/spring-security-modules/spring-security-mvc-boot/src/test/java/org/baeldung/jdbcauthentication/postgre/web/UserControllerLiveTest.java similarity index 100% rename from spring-security-mvc-boot/src/test/java/org/baeldung/jdbcauthentication/postgre/web/UserControllerLiveTest.java rename to spring-security-modules/spring-security-mvc-boot/src/test/java/org/baeldung/jdbcauthentication/postgre/web/UserControllerLiveTest.java diff --git a/spring-security-mvc-boot/src/test/java/org/baeldung/web/ApplicationLiveTest.java b/spring-security-modules/spring-security-mvc-boot/src/test/java/org/baeldung/web/ApplicationLiveTest.java similarity index 100% rename from spring-security-mvc-boot/src/test/java/org/baeldung/web/ApplicationLiveTest.java rename to spring-security-modules/spring-security-mvc-boot/src/test/java/org/baeldung/web/ApplicationLiveTest.java diff --git a/spring-security-mvc-boot/src/test/java/org/baeldung/web/CustomUserDetailsServiceIntegrationTest.java b/spring-security-modules/spring-security-mvc-boot/src/test/java/org/baeldung/web/CustomUserDetailsServiceIntegrationTest.java similarity index 100% rename from spring-security-mvc-boot/src/test/java/org/baeldung/web/CustomUserDetailsServiceIntegrationTest.java rename to spring-security-modules/spring-security-mvc-boot/src/test/java/org/baeldung/web/CustomUserDetailsServiceIntegrationTest.java diff --git a/spring-security-mvc-boot/src/test/java/org/baeldung/web/HttpsApplicationIntegrationTest.java b/spring-security-modules/spring-security-mvc-boot/src/test/java/org/baeldung/web/HttpsApplicationIntegrationTest.java similarity index 100% rename from spring-security-mvc-boot/src/test/java/org/baeldung/web/HttpsApplicationIntegrationTest.java rename to spring-security-modules/spring-security-mvc-boot/src/test/java/org/baeldung/web/HttpsApplicationIntegrationTest.java diff --git a/spring-security-mvc-boot/src/test/java/org/baeldung/web/IpLiveTest.java b/spring-security-modules/spring-security-mvc-boot/src/test/java/org/baeldung/web/IpLiveTest.java similarity index 100% rename from spring-security-mvc-boot/src/test/java/org/baeldung/web/IpLiveTest.java rename to spring-security-modules/spring-security-mvc-boot/src/test/java/org/baeldung/web/IpLiveTest.java diff --git a/spring-security-mvc-boot/src/test/java/org/baeldung/web/MultipleAuthProvidersApplicationIntegrationTest.java b/spring-security-modules/spring-security-mvc-boot/src/test/java/org/baeldung/web/MultipleAuthProvidersApplicationIntegrationTest.java similarity index 100% rename from spring-security-mvc-boot/src/test/java/org/baeldung/web/MultipleAuthProvidersApplicationIntegrationTest.java rename to spring-security-modules/spring-security-mvc-boot/src/test/java/org/baeldung/web/MultipleAuthProvidersApplicationIntegrationTest.java diff --git a/spring-security-mvc-boot/src/test/java/org/baeldung/web/MultipleEntryPointsIntegrationTest.java b/spring-security-modules/spring-security-mvc-boot/src/test/java/org/baeldung/web/MultipleEntryPointsIntegrationTest.java similarity index 100% rename from spring-security-mvc-boot/src/test/java/org/baeldung/web/MultipleEntryPointsIntegrationTest.java rename to spring-security-modules/spring-security-mvc-boot/src/test/java/org/baeldung/web/MultipleEntryPointsIntegrationTest.java diff --git a/spring-security-mvc-custom/.gitignore b/spring-security-modules/spring-security-mvc-custom/.gitignore similarity index 100% rename from spring-security-mvc-custom/.gitignore rename to spring-security-modules/spring-security-mvc-custom/.gitignore diff --git a/spring-security-mvc-custom/README.md b/spring-security-modules/spring-security-mvc-custom/README.md similarity index 100% rename from spring-security-mvc-custom/README.md rename to spring-security-modules/spring-security-mvc-custom/README.md diff --git a/spring-security-mvc-custom/pom.xml b/spring-security-modules/spring-security-mvc-custom/pom.xml similarity index 99% rename from spring-security-mvc-custom/pom.xml rename to spring-security-modules/spring-security-mvc-custom/pom.xml index 86aa117c91..fe8c749c59 100644 --- a/spring-security-mvc-custom/pom.xml +++ b/spring-security-modules/spring-security-mvc-custom/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-spring-5 0.0.1-SNAPSHOT - ../parent-spring-5 + ../../parent-spring-5 diff --git a/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 similarity index 100% rename from spring-security-mvc-custom/src/main/java/org/baeldung/security/MySimpleUrlAuthenticationSuccessHandler.java rename to spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/security/MySimpleUrlAuthenticationSuccessHandler.java diff --git a/spring-security-mvc-custom/src/main/java/org/baeldung/spring/MvcConfig.java b/spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/spring/MvcConfig.java similarity index 100% rename from spring-security-mvc-custom/src/main/java/org/baeldung/spring/MvcConfig.java rename to spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/spring/MvcConfig.java diff --git a/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 similarity index 100% rename from spring-security-mvc-custom/src/main/java/org/baeldung/spring/SecSecurityConfig.java rename to spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/spring/SecSecurityConfig.java diff --git a/spring-security-mvc-custom/src/main/java/org/baeldung/web/controller/BankController.java b/spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/web/controller/BankController.java similarity index 100% rename from spring-security-mvc-custom/src/main/java/org/baeldung/web/controller/BankController.java rename to spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/web/controller/BankController.java diff --git a/spring-security-mvc-custom/src/main/java/org/baeldung/web/controller/FooController.java b/spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/web/controller/FooController.java similarity index 100% rename from spring-security-mvc-custom/src/main/java/org/baeldung/web/controller/FooController.java rename to spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/web/controller/FooController.java diff --git a/spring-security-mvc-custom/src/main/java/org/baeldung/web/controller/LoginController.java b/spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/web/controller/LoginController.java similarity index 100% rename from spring-security-mvc-custom/src/main/java/org/baeldung/web/controller/LoginController.java rename to spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/web/controller/LoginController.java diff --git a/spring-security-mvc-custom/src/main/java/org/baeldung/web/controller/PrintUserController.java b/spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/web/controller/PrintUserController.java similarity index 100% rename from spring-security-mvc-custom/src/main/java/org/baeldung/web/controller/PrintUserController.java rename to spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/web/controller/PrintUserController.java diff --git a/spring-security-mvc-custom/src/main/java/org/baeldung/web/dto/Foo.java b/spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/web/dto/Foo.java similarity index 100% rename from spring-security-mvc-custom/src/main/java/org/baeldung/web/dto/Foo.java rename to spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/web/dto/Foo.java diff --git a/spring-security-mvc-custom/src/main/java/org/baeldung/web/interceptor/LoggerInterceptor.java b/spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/web/interceptor/LoggerInterceptor.java similarity index 100% rename from spring-security-mvc-custom/src/main/java/org/baeldung/web/interceptor/LoggerInterceptor.java rename to spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/web/interceptor/LoggerInterceptor.java diff --git a/spring-security-mvc-custom/src/main/java/org/baeldung/web/interceptor/SessionTimerInterceptor.java b/spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/web/interceptor/SessionTimerInterceptor.java similarity index 100% rename from spring-security-mvc-custom/src/main/java/org/baeldung/web/interceptor/SessionTimerInterceptor.java rename to spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/web/interceptor/SessionTimerInterceptor.java diff --git a/spring-security-mvc-custom/src/main/java/org/baeldung/web/interceptor/UserInterceptor.java b/spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/web/interceptor/UserInterceptor.java similarity index 100% rename from spring-security-mvc-custom/src/main/java/org/baeldung/web/interceptor/UserInterceptor.java rename to spring-security-modules/spring-security-mvc-custom/src/main/java/org/baeldung/web/interceptor/UserInterceptor.java diff --git a/spring-security-mvc-custom/src/main/resources/logback.xml b/spring-security-modules/spring-security-mvc-custom/src/main/resources/logback.xml similarity index 100% rename from spring-security-mvc-custom/src/main/resources/logback.xml rename to spring-security-modules/spring-security-mvc-custom/src/main/resources/logback.xml diff --git a/spring-security-mvc-custom/src/main/resources/webSecurityConfig.xml b/spring-security-modules/spring-security-mvc-custom/src/main/resources/webSecurityConfig.xml similarity index 100% rename from spring-security-mvc-custom/src/main/resources/webSecurityConfig.xml rename to spring-security-modules/spring-security-mvc-custom/src/main/resources/webSecurityConfig.xml diff --git a/spring-security-mvc-custom/src/main/webapp/WEB-INF/mvc-servlet.xml b/spring-security-modules/spring-security-mvc-custom/src/main/webapp/WEB-INF/mvc-servlet.xml similarity index 100% rename from spring-security-mvc-custom/src/main/webapp/WEB-INF/mvc-servlet.xml rename to spring-security-modules/spring-security-mvc-custom/src/main/webapp/WEB-INF/mvc-servlet.xml diff --git a/spring-security-mvc-custom/src/main/webapp/WEB-INF/view/anonymous.jsp b/spring-security-modules/spring-security-mvc-custom/src/main/webapp/WEB-INF/view/anonymous.jsp similarity index 100% rename from spring-security-mvc-custom/src/main/webapp/WEB-INF/view/anonymous.jsp rename to spring-security-modules/spring-security-mvc-custom/src/main/webapp/WEB-INF/view/anonymous.jsp diff --git a/spring-security-mvc-custom/src/main/webapp/WEB-INF/view/console.jsp b/spring-security-modules/spring-security-mvc-custom/src/main/webapp/WEB-INF/view/console.jsp similarity index 100% rename from spring-security-mvc-custom/src/main/webapp/WEB-INF/view/console.jsp rename to spring-security-modules/spring-security-mvc-custom/src/main/webapp/WEB-INF/view/console.jsp diff --git a/spring-security-mvc-custom/src/main/webapp/WEB-INF/view/csrfHome.jsp b/spring-security-modules/spring-security-mvc-custom/src/main/webapp/WEB-INF/view/csrfHome.jsp similarity index 100% rename from spring-security-mvc-custom/src/main/webapp/WEB-INF/view/csrfHome.jsp rename to spring-security-modules/spring-security-mvc-custom/src/main/webapp/WEB-INF/view/csrfHome.jsp diff --git a/spring-security-mvc-custom/src/main/webapp/WEB-INF/view/homepage.jsp b/spring-security-modules/spring-security-mvc-custom/src/main/webapp/WEB-INF/view/homepage.jsp similarity index 100% rename from spring-security-mvc-custom/src/main/webapp/WEB-INF/view/homepage.jsp rename to spring-security-modules/spring-security-mvc-custom/src/main/webapp/WEB-INF/view/homepage.jsp diff --git a/spring-security-mvc-custom/src/main/webapp/WEB-INF/view/login.jsp b/spring-security-modules/spring-security-mvc-custom/src/main/webapp/WEB-INF/view/login.jsp similarity index 100% rename from spring-security-mvc-custom/src/main/webapp/WEB-INF/view/login.jsp rename to spring-security-modules/spring-security-mvc-custom/src/main/webapp/WEB-INF/view/login.jsp diff --git a/spring-security-mvc-custom/src/main/webapp/WEB-INF/web.xml b/spring-security-modules/spring-security-mvc-custom/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from spring-security-mvc-custom/src/main/webapp/WEB-INF/web.xml rename to spring-security-modules/spring-security-mvc-custom/src/main/webapp/WEB-INF/web.xml diff --git a/spring-security-mvc-custom/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-mvc-custom/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-mvc-custom/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-mvc-custom/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-mvc-custom/src/test/java/org/baeldung/security/csrf/CsrfAbstractIntegrationTest.java b/spring-security-modules/spring-security-mvc-custom/src/test/java/org/baeldung/security/csrf/CsrfAbstractIntegrationTest.java similarity index 100% rename from spring-security-mvc-custom/src/test/java/org/baeldung/security/csrf/CsrfAbstractIntegrationTest.java rename to spring-security-modules/spring-security-mvc-custom/src/test/java/org/baeldung/security/csrf/CsrfAbstractIntegrationTest.java diff --git a/spring-security-mvc-custom/src/test/java/org/baeldung/security/csrf/CsrfDisabledIntegrationTest.java b/spring-security-modules/spring-security-mvc-custom/src/test/java/org/baeldung/security/csrf/CsrfDisabledIntegrationTest.java similarity index 100% rename from spring-security-mvc-custom/src/test/java/org/baeldung/security/csrf/CsrfDisabledIntegrationTest.java rename to spring-security-modules/spring-security-mvc-custom/src/test/java/org/baeldung/security/csrf/CsrfDisabledIntegrationTest.java diff --git a/spring-security-mvc-custom/src/test/java/org/baeldung/security/csrf/CsrfEnabledIntegrationTest.java b/spring-security-modules/spring-security-mvc-custom/src/test/java/org/baeldung/security/csrf/CsrfEnabledIntegrationTest.java similarity index 100% rename from spring-security-mvc-custom/src/test/java/org/baeldung/security/csrf/CsrfEnabledIntegrationTest.java rename to spring-security-modules/spring-security-mvc-custom/src/test/java/org/baeldung/security/csrf/CsrfEnabledIntegrationTest.java diff --git a/spring-security-mvc-custom/src/test/java/org/baeldung/security/spring/ManualSecurityConfig.java b/spring-security-modules/spring-security-mvc-custom/src/test/java/org/baeldung/security/spring/ManualSecurityConfig.java similarity index 100% rename from spring-security-mvc-custom/src/test/java/org/baeldung/security/spring/ManualSecurityConfig.java rename to spring-security-modules/spring-security-mvc-custom/src/test/java/org/baeldung/security/spring/ManualSecurityConfig.java diff --git a/spring-security-mvc-custom/src/test/java/org/baeldung/security/spring/ManualSecurityIntegrationTest.java b/spring-security-modules/spring-security-mvc-custom/src/test/java/org/baeldung/security/spring/ManualSecurityIntegrationTest.java similarity index 100% rename from spring-security-mvc-custom/src/test/java/org/baeldung/security/spring/ManualSecurityIntegrationTest.java rename to spring-security-modules/spring-security-mvc-custom/src/test/java/org/baeldung/security/spring/ManualSecurityIntegrationTest.java diff --git a/spring-security-mvc-custom/src/test/java/org/baeldung/security/spring/SecurityWithCsrfConfig.java b/spring-security-modules/spring-security-mvc-custom/src/test/java/org/baeldung/security/spring/SecurityWithCsrfConfig.java similarity index 100% rename from spring-security-mvc-custom/src/test/java/org/baeldung/security/spring/SecurityWithCsrfConfig.java rename to spring-security-modules/spring-security-mvc-custom/src/test/java/org/baeldung/security/spring/SecurityWithCsrfConfig.java diff --git a/spring-security-mvc-custom/src/test/java/org/baeldung/security/spring/SecurityWithoutCsrfConfig.java b/spring-security-modules/spring-security-mvc-custom/src/test/java/org/baeldung/security/spring/SecurityWithoutCsrfConfig.java similarity index 100% rename from spring-security-mvc-custom/src/test/java/org/baeldung/security/spring/SecurityWithoutCsrfConfig.java rename to spring-security-modules/spring-security-mvc-custom/src/test/java/org/baeldung/security/spring/SecurityWithoutCsrfConfig.java diff --git a/spring-security-mvc-custom/src/test/java/org/baeldung/web/interceptor/LoggerInterceptorIntegrationTest.java b/spring-security-modules/spring-security-mvc-custom/src/test/java/org/baeldung/web/interceptor/LoggerInterceptorIntegrationTest.java similarity index 100% rename from spring-security-mvc-custom/src/test/java/org/baeldung/web/interceptor/LoggerInterceptorIntegrationTest.java rename to spring-security-modules/spring-security-mvc-custom/src/test/java/org/baeldung/web/interceptor/LoggerInterceptorIntegrationTest.java diff --git a/spring-security-mvc-custom/src/test/java/org/baeldung/web/interceptor/SessionTimerInterceptorIntegrationTest.java b/spring-security-modules/spring-security-mvc-custom/src/test/java/org/baeldung/web/interceptor/SessionTimerInterceptorIntegrationTest.java similarity index 100% rename from spring-security-mvc-custom/src/test/java/org/baeldung/web/interceptor/SessionTimerInterceptorIntegrationTest.java rename to spring-security-modules/spring-security-mvc-custom/src/test/java/org/baeldung/web/interceptor/SessionTimerInterceptorIntegrationTest.java diff --git a/spring-security-mvc-custom/src/test/java/org/baeldung/web/interceptor/UserInterceptorIntegrationTest.java b/spring-security-modules/spring-security-mvc-custom/src/test/java/org/baeldung/web/interceptor/UserInterceptorIntegrationTest.java similarity index 100% rename from spring-security-mvc-custom/src/test/java/org/baeldung/web/interceptor/UserInterceptorIntegrationTest.java rename to spring-security-modules/spring-security-mvc-custom/src/test/java/org/baeldung/web/interceptor/UserInterceptorIntegrationTest.java diff --git a/spring-security-mvc-custom/src/test/resources/.gitignore b/spring-security-modules/spring-security-mvc-custom/src/test/resources/.gitignore similarity index 100% rename from spring-security-mvc-custom/src/test/resources/.gitignore rename to spring-security-modules/spring-security-mvc-custom/src/test/resources/.gitignore diff --git a/spring-security-mvc-digest-auth/.gitignore b/spring-security-modules/spring-security-mvc-digest-auth/.gitignore similarity index 100% rename from spring-security-mvc-digest-auth/.gitignore rename to spring-security-modules/spring-security-mvc-digest-auth/.gitignore diff --git a/spring-security-mvc-digest-auth/README.md b/spring-security-modules/spring-security-mvc-digest-auth/README.md similarity index 100% rename from spring-security-mvc-digest-auth/README.md rename to spring-security-modules/spring-security-mvc-digest-auth/README.md diff --git a/spring-security-mvc-digest-auth/pom.xml b/spring-security-modules/spring-security-mvc-digest-auth/pom.xml similarity index 99% rename from spring-security-mvc-digest-auth/pom.xml rename to spring-security-modules/spring-security-mvc-digest-auth/pom.xml index 25fe71e804..8061235c71 100644 --- a/spring-security-mvc-digest-auth/pom.xml +++ b/spring-security-modules/spring-security-mvc-digest-auth/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-spring-4 0.0.1-SNAPSHOT - ../parent-spring-4 + ../../parent-spring-4 diff --git a/spring-security-mvc-digest-auth/src/main/java/org/baeldung/basic/MyBasicAuthenticationEntryPoint.java b/spring-security-modules/spring-security-mvc-digest-auth/src/main/java/org/baeldung/basic/MyBasicAuthenticationEntryPoint.java similarity index 100% rename from spring-security-mvc-digest-auth/src/main/java/org/baeldung/basic/MyBasicAuthenticationEntryPoint.java rename to spring-security-modules/spring-security-mvc-digest-auth/src/main/java/org/baeldung/basic/MyBasicAuthenticationEntryPoint.java diff --git a/spring-security-mvc-digest-auth/src/main/java/org/baeldung/client/HttpComponentsClientHttpRequestFactoryDigestAuth.java b/spring-security-modules/spring-security-mvc-digest-auth/src/main/java/org/baeldung/client/HttpComponentsClientHttpRequestFactoryDigestAuth.java similarity index 100% rename from spring-security-mvc-digest-auth/src/main/java/org/baeldung/client/HttpComponentsClientHttpRequestFactoryDigestAuth.java rename to spring-security-modules/spring-security-mvc-digest-auth/src/main/java/org/baeldung/client/HttpComponentsClientHttpRequestFactoryDigestAuth.java diff --git a/spring-security-mvc-digest-auth/src/main/java/org/baeldung/spring/ClientConfig.java b/spring-security-modules/spring-security-mvc-digest-auth/src/main/java/org/baeldung/spring/ClientConfig.java similarity index 100% rename from spring-security-mvc-digest-auth/src/main/java/org/baeldung/spring/ClientConfig.java rename to spring-security-modules/spring-security-mvc-digest-auth/src/main/java/org/baeldung/spring/ClientConfig.java diff --git a/spring-security-mvc-digest-auth/src/main/java/org/baeldung/spring/MvcConfig.java b/spring-security-modules/spring-security-mvc-digest-auth/src/main/java/org/baeldung/spring/MvcConfig.java similarity index 100% rename from spring-security-mvc-digest-auth/src/main/java/org/baeldung/spring/MvcConfig.java rename to spring-security-modules/spring-security-mvc-digest-auth/src/main/java/org/baeldung/spring/MvcConfig.java diff --git a/spring-security-mvc-digest-auth/src/main/java/org/baeldung/spring/SecSecurityConfig.java b/spring-security-modules/spring-security-mvc-digest-auth/src/main/java/org/baeldung/spring/SecSecurityConfig.java similarity index 100% rename from spring-security-mvc-digest-auth/src/main/java/org/baeldung/spring/SecSecurityConfig.java rename to spring-security-modules/spring-security-mvc-digest-auth/src/main/java/org/baeldung/spring/SecSecurityConfig.java diff --git a/spring-security-mvc-digest-auth/src/main/resources/logback.xml b/spring-security-modules/spring-security-mvc-digest-auth/src/main/resources/logback.xml similarity index 100% rename from spring-security-mvc-digest-auth/src/main/resources/logback.xml rename to spring-security-modules/spring-security-mvc-digest-auth/src/main/resources/logback.xml diff --git a/spring-security-mvc-digest-auth/src/main/resources/webSecurityConfig.xml b/spring-security-modules/spring-security-mvc-digest-auth/src/main/resources/webSecurityConfig.xml similarity index 100% rename from spring-security-mvc-digest-auth/src/main/resources/webSecurityConfig.xml rename to spring-security-modules/spring-security-mvc-digest-auth/src/main/resources/webSecurityConfig.xml diff --git a/spring-security-mvc-digest-auth/src/main/webapp/WEB-INF/mvc-servlet.xml b/spring-security-modules/spring-security-mvc-digest-auth/src/main/webapp/WEB-INF/mvc-servlet.xml similarity index 100% rename from spring-security-mvc-digest-auth/src/main/webapp/WEB-INF/mvc-servlet.xml rename to spring-security-modules/spring-security-mvc-digest-auth/src/main/webapp/WEB-INF/mvc-servlet.xml diff --git a/spring-security-mvc-digest-auth/src/main/webapp/WEB-INF/view/homepage.jsp b/spring-security-modules/spring-security-mvc-digest-auth/src/main/webapp/WEB-INF/view/homepage.jsp similarity index 100% rename from spring-security-mvc-digest-auth/src/main/webapp/WEB-INF/view/homepage.jsp rename to spring-security-modules/spring-security-mvc-digest-auth/src/main/webapp/WEB-INF/view/homepage.jsp diff --git a/spring-security-mvc-digest-auth/src/main/webapp/WEB-INF/web.xml b/spring-security-modules/spring-security-mvc-digest-auth/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from spring-security-mvc-digest-auth/src/main/webapp/WEB-INF/web.xml rename to spring-security-modules/spring-security-mvc-digest-auth/src/main/webapp/WEB-INF/web.xml diff --git a/spring-security-mvc-digest-auth/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-mvc-digest-auth/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-mvc-digest-auth/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-mvc-digest-auth/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-mvc-digest-auth/src/test/java/org/baeldung/client/RawClientLiveTest.java b/spring-security-modules/spring-security-mvc-digest-auth/src/test/java/org/baeldung/client/RawClientLiveTest.java similarity index 100% rename from spring-security-mvc-digest-auth/src/test/java/org/baeldung/client/RawClientLiveTest.java rename to spring-security-modules/spring-security-mvc-digest-auth/src/test/java/org/baeldung/client/RawClientLiveTest.java diff --git a/spring-security-mvc-digest-auth/src/test/resources/.gitignore b/spring-security-modules/spring-security-mvc-digest-auth/src/test/resources/.gitignore similarity index 100% rename from spring-security-mvc-digest-auth/src/test/resources/.gitignore rename to spring-security-modules/spring-security-mvc-digest-auth/src/test/resources/.gitignore diff --git a/spring-security-mvc-jsonview/.gitignore b/spring-security-modules/spring-security-mvc-jsonview/.gitignore similarity index 100% rename from spring-security-mvc-jsonview/.gitignore rename to spring-security-modules/spring-security-mvc-jsonview/.gitignore diff --git a/spring-security-mvc-jsonview/README.md b/spring-security-modules/spring-security-mvc-jsonview/README.md similarity index 100% rename from spring-security-mvc-jsonview/README.md rename to spring-security-modules/spring-security-mvc-jsonview/README.md diff --git a/spring-security-mvc-jsonview/pom.xml b/spring-security-modules/spring-security-mvc-jsonview/pom.xml similarity index 99% rename from spring-security-mvc-jsonview/pom.xml rename to spring-security-modules/spring-security-mvc-jsonview/pom.xml index aef7293fa7..f6ba997c62 100644 --- a/spring-security-mvc-jsonview/pom.xml +++ b/spring-security-modules/spring-security-mvc-jsonview/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-spring-5 0.0.1-SNAPSHOT - ../parent-spring-5 + ../../parent-spring-5 diff --git a/spring-security-mvc-jsonview/src/main/java/com/baeldung/AppInitializer.java b/spring-security-modules/spring-security-mvc-jsonview/src/main/java/com/baeldung/AppInitializer.java similarity index 100% rename from spring-security-mvc-jsonview/src/main/java/com/baeldung/AppInitializer.java rename to spring-security-modules/spring-security-mvc-jsonview/src/main/java/com/baeldung/AppInitializer.java diff --git a/spring-security-mvc-jsonview/src/main/java/com/baeldung/controller/ItemsController.java b/spring-security-modules/spring-security-mvc-jsonview/src/main/java/com/baeldung/controller/ItemsController.java similarity index 100% rename from spring-security-mvc-jsonview/src/main/java/com/baeldung/controller/ItemsController.java rename to spring-security-modules/spring-security-mvc-jsonview/src/main/java/com/baeldung/controller/ItemsController.java diff --git a/spring-security-mvc-jsonview/src/main/java/com/baeldung/controller/View.java b/spring-security-modules/spring-security-mvc-jsonview/src/main/java/com/baeldung/controller/View.java similarity index 100% rename from spring-security-mvc-jsonview/src/main/java/com/baeldung/controller/View.java rename to spring-security-modules/spring-security-mvc-jsonview/src/main/java/com/baeldung/controller/View.java diff --git a/spring-security-mvc-jsonview/src/main/java/com/baeldung/model/Item.java b/spring-security-modules/spring-security-mvc-jsonview/src/main/java/com/baeldung/model/Item.java similarity index 100% rename from spring-security-mvc-jsonview/src/main/java/com/baeldung/model/Item.java rename to spring-security-modules/spring-security-mvc-jsonview/src/main/java/com/baeldung/model/Item.java diff --git a/spring-security-mvc-jsonview/src/main/java/com/baeldung/spring/AppConfig.java b/spring-security-modules/spring-security-mvc-jsonview/src/main/java/com/baeldung/spring/AppConfig.java similarity index 100% rename from spring-security-mvc-jsonview/src/main/java/com/baeldung/spring/AppConfig.java rename to spring-security-modules/spring-security-mvc-jsonview/src/main/java/com/baeldung/spring/AppConfig.java diff --git a/spring-security-mvc-jsonview/src/main/java/com/baeldung/spring/SecurityJsonViewControllerAdvice.java b/spring-security-modules/spring-security-mvc-jsonview/src/main/java/com/baeldung/spring/SecurityJsonViewControllerAdvice.java similarity index 100% rename from spring-security-mvc-jsonview/src/main/java/com/baeldung/spring/SecurityJsonViewControllerAdvice.java rename to spring-security-modules/spring-security-mvc-jsonview/src/main/java/com/baeldung/spring/SecurityJsonViewControllerAdvice.java diff --git a/spring-security-mvc-jsonview/src/main/resources/logback.xml b/spring-security-modules/spring-security-mvc-jsonview/src/main/resources/logback.xml similarity index 100% rename from spring-security-mvc-jsonview/src/main/resources/logback.xml rename to spring-security-modules/spring-security-mvc-jsonview/src/main/resources/logback.xml diff --git a/spring-security-mvc-jsonview/src/test/java/com/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-mvc-jsonview/src/test/java/com/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-mvc-jsonview/src/test/java/com/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-mvc-jsonview/src/test/java/com/baeldung/SpringContextTest.java diff --git a/spring-security-mvc-jsonview/src/test/java/com/baeldung/security/SpringSecurityJsonViewIntegrationTest.java b/spring-security-modules/spring-security-mvc-jsonview/src/test/java/com/baeldung/security/SpringSecurityJsonViewIntegrationTest.java similarity index 100% rename from spring-security-mvc-jsonview/src/test/java/com/baeldung/security/SpringSecurityJsonViewIntegrationTest.java rename to spring-security-modules/spring-security-mvc-jsonview/src/test/java/com/baeldung/security/SpringSecurityJsonViewIntegrationTest.java diff --git a/spring-security-mvc-ldap/README.md b/spring-security-modules/spring-security-mvc-ldap/README.md similarity index 100% rename from spring-security-mvc-ldap/README.md rename to spring-security-modules/spring-security-mvc-ldap/README.md diff --git a/spring-security-mvc-ldap/pom.xml b/spring-security-modules/spring-security-mvc-ldap/pom.xml similarity index 97% rename from spring-security-mvc-ldap/pom.xml rename to spring-security-modules/spring-security-mvc-ldap/pom.xml index ad4bc2eefe..2f227d7908 100644 --- a/spring-security-mvc-ldap/pom.xml +++ b/spring-security-modules/spring-security-mvc-ldap/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-boot-1 0.0.1-SNAPSHOT - ../parent-boot-1 + ../../parent-boot-1 diff --git a/spring-security-mvc-ldap/src/main/java/org/baeldung/SampleLDAPApplication.java b/spring-security-modules/spring-security-mvc-ldap/src/main/java/org/baeldung/SampleLDAPApplication.java similarity index 100% rename from spring-security-mvc-ldap/src/main/java/org/baeldung/SampleLDAPApplication.java rename to spring-security-modules/spring-security-mvc-ldap/src/main/java/org/baeldung/SampleLDAPApplication.java diff --git a/spring-security-mvc-ldap/src/main/java/org/baeldung/controller/MyController.java b/spring-security-modules/spring-security-mvc-ldap/src/main/java/org/baeldung/controller/MyController.java similarity index 100% rename from spring-security-mvc-ldap/src/main/java/org/baeldung/controller/MyController.java rename to spring-security-modules/spring-security-mvc-ldap/src/main/java/org/baeldung/controller/MyController.java diff --git a/spring-security-mvc-ldap/src/main/java/org/baeldung/security/SecurityConfig.java b/spring-security-modules/spring-security-mvc-ldap/src/main/java/org/baeldung/security/SecurityConfig.java similarity index 100% rename from spring-security-mvc-ldap/src/main/java/org/baeldung/security/SecurityConfig.java rename to spring-security-modules/spring-security-mvc-ldap/src/main/java/org/baeldung/security/SecurityConfig.java diff --git a/spring-security-mvc-ldap/src/main/resources/logback.xml b/spring-security-modules/spring-security-mvc-ldap/src/main/resources/logback.xml similarity index 100% rename from spring-security-mvc-ldap/src/main/resources/logback.xml rename to spring-security-modules/spring-security-mvc-ldap/src/main/resources/logback.xml diff --git a/spring-security-mvc-ldap/src/main/resources/static/css/bootstrap.min.css b/spring-security-modules/spring-security-mvc-ldap/src/main/resources/static/css/bootstrap.min.css similarity index 100% rename from spring-security-mvc-ldap/src/main/resources/static/css/bootstrap.min.css rename to spring-security-modules/spring-security-mvc-ldap/src/main/resources/static/css/bootstrap.min.css diff --git a/spring-security-mvc-ldap/src/main/resources/templates/error.html b/spring-security-modules/spring-security-mvc-ldap/src/main/resources/templates/error.html similarity index 100% rename from spring-security-mvc-ldap/src/main/resources/templates/error.html rename to spring-security-modules/spring-security-mvc-ldap/src/main/resources/templates/error.html diff --git a/spring-security-mvc-ldap/src/main/resources/templates/home.html b/spring-security-modules/spring-security-mvc-ldap/src/main/resources/templates/home.html similarity index 100% rename from spring-security-mvc-ldap/src/main/resources/templates/home.html rename to spring-security-modules/spring-security-mvc-ldap/src/main/resources/templates/home.html diff --git a/spring-security-mvc-ldap/src/main/resources/templates/login.html b/spring-security-modules/spring-security-mvc-ldap/src/main/resources/templates/login.html similarity index 100% rename from spring-security-mvc-ldap/src/main/resources/templates/login.html rename to spring-security-modules/spring-security-mvc-ldap/src/main/resources/templates/login.html diff --git a/spring-security-mvc-ldap/src/main/resources/users.ldif b/spring-security-modules/spring-security-mvc-ldap/src/main/resources/users.ldif similarity index 100% rename from spring-security-mvc-ldap/src/main/resources/users.ldif rename to spring-security-modules/spring-security-mvc-ldap/src/main/resources/users.ldif diff --git a/spring-security-mvc-ldap/src/main/resources/webSecurityConfig.xml b/spring-security-modules/spring-security-mvc-ldap/src/main/resources/webSecurityConfig.xml similarity index 100% rename from spring-security-mvc-ldap/src/main/resources/webSecurityConfig.xml rename to spring-security-modules/spring-security-mvc-ldap/src/main/resources/webSecurityConfig.xml diff --git a/spring-security-mvc-ldap/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-mvc-ldap/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-mvc-ldap/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-mvc-ldap/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-mvc-ldap/src/test/resources/.gitignore b/spring-security-modules/spring-security-mvc-ldap/src/test/resources/.gitignore similarity index 100% rename from spring-security-mvc-ldap/src/test/resources/.gitignore rename to spring-security-modules/spring-security-mvc-ldap/src/test/resources/.gitignore diff --git a/spring-security-mvc-login/.gitignore b/spring-security-modules/spring-security-mvc-login/.gitignore similarity index 100% rename from spring-security-mvc-login/.gitignore rename to spring-security-modules/spring-security-mvc-login/.gitignore diff --git a/spring-security-mvc-login/README.md b/spring-security-modules/spring-security-mvc-login/README.md similarity index 100% rename from spring-security-mvc-login/README.md rename to spring-security-modules/spring-security-mvc-login/README.md diff --git a/spring-security-mvc-login/pom.xml b/spring-security-modules/spring-security-mvc-login/pom.xml similarity index 99% rename from spring-security-mvc-login/pom.xml rename to spring-security-modules/spring-security-mvc-login/pom.xml index 5a564667e4..4e0fe00176 100644 --- a/spring-security-mvc-login/pom.xml +++ b/spring-security-modules/spring-security-mvc-login/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-spring-5 0.0.1-SNAPSHOT - ../parent-spring-5 + ../../parent-spring-5 diff --git a/spring-security-mvc-login/src/main/java/com/baeldung/AppInitializer.java b/spring-security-modules/spring-security-mvc-login/src/main/java/com/baeldung/AppInitializer.java similarity index 100% rename from spring-security-mvc-login/src/main/java/com/baeldung/AppInitializer.java rename to spring-security-modules/spring-security-mvc-login/src/main/java/com/baeldung/AppInitializer.java diff --git a/spring-security-mvc-login/src/main/java/com/baeldung/controller/SecuredResourceController.java b/spring-security-modules/spring-security-mvc-login/src/main/java/com/baeldung/controller/SecuredResourceController.java similarity index 100% rename from spring-security-mvc-login/src/main/java/com/baeldung/controller/SecuredResourceController.java rename to spring-security-modules/spring-security-mvc-login/src/main/java/com/baeldung/controller/SecuredResourceController.java diff --git a/spring-security-mvc-login/src/main/java/com/baeldung/security/CustomAccessDeniedHandler.java b/spring-security-modules/spring-security-mvc-login/src/main/java/com/baeldung/security/CustomAccessDeniedHandler.java similarity index 100% rename from spring-security-mvc-login/src/main/java/com/baeldung/security/CustomAccessDeniedHandler.java rename to spring-security-modules/spring-security-mvc-login/src/main/java/com/baeldung/security/CustomAccessDeniedHandler.java diff --git a/spring-security-mvc-login/src/main/java/com/baeldung/security/CustomAuthenticationFailureHandler.java b/spring-security-modules/spring-security-mvc-login/src/main/java/com/baeldung/security/CustomAuthenticationFailureHandler.java similarity index 100% rename from spring-security-mvc-login/src/main/java/com/baeldung/security/CustomAuthenticationFailureHandler.java rename to spring-security-modules/spring-security-mvc-login/src/main/java/com/baeldung/security/CustomAuthenticationFailureHandler.java diff --git a/spring-security-mvc-login/src/main/java/com/baeldung/security/CustomLogoutSuccessHandler.java b/spring-security-modules/spring-security-mvc-login/src/main/java/com/baeldung/security/CustomLogoutSuccessHandler.java similarity index 100% rename from spring-security-mvc-login/src/main/java/com/baeldung/security/CustomLogoutSuccessHandler.java rename to spring-security-modules/spring-security-mvc-login/src/main/java/com/baeldung/security/CustomLogoutSuccessHandler.java diff --git a/spring-security-mvc-login/src/main/java/com/baeldung/security/RefererAuthenticationSuccessHandler.java b/spring-security-modules/spring-security-mvc-login/src/main/java/com/baeldung/security/RefererAuthenticationSuccessHandler.java similarity index 100% rename from spring-security-mvc-login/src/main/java/com/baeldung/security/RefererAuthenticationSuccessHandler.java rename to spring-security-modules/spring-security-mvc-login/src/main/java/com/baeldung/security/RefererAuthenticationSuccessHandler.java diff --git a/spring-security-mvc-login/src/main/java/com/baeldung/security/config/SecSecurityConfig.java b/spring-security-modules/spring-security-mvc-login/src/main/java/com/baeldung/security/config/SecSecurityConfig.java similarity index 100% rename from spring-security-mvc-login/src/main/java/com/baeldung/security/config/SecSecurityConfig.java rename to spring-security-modules/spring-security-mvc-login/src/main/java/com/baeldung/security/config/SecSecurityConfig.java diff --git a/spring-security-mvc-login/src/main/java/com/baeldung/spring/ChannelSecSecurityConfig.java b/spring-security-modules/spring-security-mvc-login/src/main/java/com/baeldung/spring/ChannelSecSecurityConfig.java similarity index 100% rename from spring-security-mvc-login/src/main/java/com/baeldung/spring/ChannelSecSecurityConfig.java rename to spring-security-modules/spring-security-mvc-login/src/main/java/com/baeldung/spring/ChannelSecSecurityConfig.java diff --git a/spring-security-mvc-login/src/main/java/com/baeldung/spring/MvcConfig.java b/spring-security-modules/spring-security-mvc-login/src/main/java/com/baeldung/spring/MvcConfig.java similarity index 100% rename from spring-security-mvc-login/src/main/java/com/baeldung/spring/MvcConfig.java rename to spring-security-modules/spring-security-mvc-login/src/main/java/com/baeldung/spring/MvcConfig.java diff --git a/spring-security-mvc-login/src/main/java/com/baeldung/spring/RedirectionSecurityConfig.java b/spring-security-modules/spring-security-mvc-login/src/main/java/com/baeldung/spring/RedirectionSecurityConfig.java similarity index 100% rename from spring-security-mvc-login/src/main/java/com/baeldung/spring/RedirectionSecurityConfig.java rename to spring-security-modules/spring-security-mvc-login/src/main/java/com/baeldung/spring/RedirectionSecurityConfig.java diff --git a/spring-security-mvc-login/src/main/resources/RedirectionWebSecurityConfig.xml b/spring-security-modules/spring-security-mvc-login/src/main/resources/RedirectionWebSecurityConfig.xml similarity index 100% rename from spring-security-mvc-login/src/main/resources/RedirectionWebSecurityConfig.xml rename to spring-security-modules/spring-security-mvc-login/src/main/resources/RedirectionWebSecurityConfig.xml diff --git a/spring-security-mvc-login/src/main/resources/channelWebSecurityConfig.xml b/spring-security-modules/spring-security-mvc-login/src/main/resources/channelWebSecurityConfig.xml similarity index 100% rename from spring-security-mvc-login/src/main/resources/channelWebSecurityConfig.xml rename to spring-security-modules/spring-security-mvc-login/src/main/resources/channelWebSecurityConfig.xml diff --git a/spring-security-mvc-login/src/main/resources/logback.xml b/spring-security-modules/spring-security-mvc-login/src/main/resources/logback.xml similarity index 100% rename from spring-security-mvc-login/src/main/resources/logback.xml rename to spring-security-modules/spring-security-mvc-login/src/main/resources/logback.xml diff --git a/spring-security-mvc-login/src/main/resources/webSecurityConfig.xml b/spring-security-modules/spring-security-mvc-login/src/main/resources/webSecurityConfig.xml similarity index 100% rename from spring-security-mvc-login/src/main/resources/webSecurityConfig.xml rename to spring-security-modules/spring-security-mvc-login/src/main/resources/webSecurityConfig.xml diff --git a/spring-security-mvc-login/src/main/webapp/WEB-INF/mvc-servlet.xml b/spring-security-modules/spring-security-mvc-login/src/main/webapp/WEB-INF/mvc-servlet.xml similarity index 100% rename from spring-security-mvc-login/src/main/webapp/WEB-INF/mvc-servlet.xml rename to spring-security-modules/spring-security-mvc-login/src/main/webapp/WEB-INF/mvc-servlet.xml diff --git a/spring-security-mvc-login/src/main/webapp/WEB-INF/view/accessDenied.jsp b/spring-security-modules/spring-security-mvc-login/src/main/webapp/WEB-INF/view/accessDenied.jsp similarity index 100% rename from spring-security-mvc-login/src/main/webapp/WEB-INF/view/accessDenied.jsp rename to spring-security-modules/spring-security-mvc-login/src/main/webapp/WEB-INF/view/accessDenied.jsp diff --git a/spring-security-mvc-login/src/main/webapp/WEB-INF/view/admin/adminpage.jsp b/spring-security-modules/spring-security-mvc-login/src/main/webapp/WEB-INF/view/admin/adminpage.jsp similarity index 100% rename from spring-security-mvc-login/src/main/webapp/WEB-INF/view/admin/adminpage.jsp rename to spring-security-modules/spring-security-mvc-login/src/main/webapp/WEB-INF/view/admin/adminpage.jsp diff --git a/spring-security-mvc-login/src/main/webapp/WEB-INF/view/anonymous.jsp b/spring-security-modules/spring-security-mvc-login/src/main/webapp/WEB-INF/view/anonymous.jsp similarity index 100% rename from spring-security-mvc-login/src/main/webapp/WEB-INF/view/anonymous.jsp rename to spring-security-modules/spring-security-mvc-login/src/main/webapp/WEB-INF/view/anonymous.jsp diff --git a/spring-security-mvc-login/src/main/webapp/WEB-INF/view/homepage.jsp b/spring-security-modules/spring-security-mvc-login/src/main/webapp/WEB-INF/view/homepage.jsp similarity index 100% rename from spring-security-mvc-login/src/main/webapp/WEB-INF/view/homepage.jsp rename to spring-security-modules/spring-security-mvc-login/src/main/webapp/WEB-INF/view/homepage.jsp diff --git a/spring-security-mvc-login/src/main/webapp/WEB-INF/view/login.jsp b/spring-security-modules/spring-security-mvc-login/src/main/webapp/WEB-INF/view/login.jsp similarity index 100% rename from spring-security-mvc-login/src/main/webapp/WEB-INF/view/login.jsp rename to spring-security-modules/spring-security-mvc-login/src/main/webapp/WEB-INF/view/login.jsp diff --git a/spring-security-mvc-login/src/main/webapp/WEB-INF/web-old.xml b/spring-security-modules/spring-security-mvc-login/src/main/webapp/WEB-INF/web-old.xml similarity index 100% rename from spring-security-mvc-login/src/main/webapp/WEB-INF/web-old.xml rename to spring-security-modules/spring-security-mvc-login/src/main/webapp/WEB-INF/web-old.xml diff --git a/spring-security-mvc-login/src/test/java/com/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-mvc-login/src/test/java/com/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-mvc-login/src/test/java/com/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-mvc-login/src/test/java/com/baeldung/SpringContextTest.java diff --git a/spring-security-mvc-login/src/test/java/com/baeldung/security/FormLoginUnitTest.java b/spring-security-modules/spring-security-mvc-login/src/test/java/com/baeldung/security/FormLoginUnitTest.java similarity index 100% rename from spring-security-mvc-login/src/test/java/com/baeldung/security/FormLoginUnitTest.java rename to spring-security-modules/spring-security-mvc-login/src/test/java/com/baeldung/security/FormLoginUnitTest.java diff --git a/spring-security-mvc-login/src/test/java/com/baeldung/security/RedirectionSecurityIntegrationTest.java b/spring-security-modules/spring-security-mvc-login/src/test/java/com/baeldung/security/RedirectionSecurityIntegrationTest.java similarity index 100% rename from spring-security-mvc-login/src/test/java/com/baeldung/security/RedirectionSecurityIntegrationTest.java rename to spring-security-modules/spring-security-mvc-login/src/test/java/com/baeldung/security/RedirectionSecurityIntegrationTest.java diff --git a/spring-security-mvc-login/src/test/resources/.gitignore b/spring-security-modules/spring-security-mvc-login/src/test/resources/.gitignore similarity index 100% rename from spring-security-mvc-login/src/test/resources/.gitignore rename to spring-security-modules/spring-security-mvc-login/src/test/resources/.gitignore diff --git a/spring-security-mvc-login/src/test/resources/mvc-servlet.xml b/spring-security-modules/spring-security-mvc-login/src/test/resources/mvc-servlet.xml similarity index 100% rename from spring-security-mvc-login/src/test/resources/mvc-servlet.xml rename to spring-security-modules/spring-security-mvc-login/src/test/resources/mvc-servlet.xml diff --git a/spring-security-mvc-persisted-remember-me/.gitignore b/spring-security-modules/spring-security-mvc-persisted-remember-me/.gitignore similarity index 100% rename from spring-security-mvc-persisted-remember-me/.gitignore rename to spring-security-modules/spring-security-mvc-persisted-remember-me/.gitignore diff --git a/spring-security-mvc-persisted-remember-me/README.md b/spring-security-modules/spring-security-mvc-persisted-remember-me/README.md similarity index 100% rename from spring-security-mvc-persisted-remember-me/README.md rename to spring-security-modules/spring-security-mvc-persisted-remember-me/README.md diff --git a/spring-security-mvc-persisted-remember-me/pom.xml b/spring-security-modules/spring-security-mvc-persisted-remember-me/pom.xml similarity index 99% rename from spring-security-mvc-persisted-remember-me/pom.xml rename to spring-security-modules/spring-security-mvc-persisted-remember-me/pom.xml index 282cd51450..9410793222 100644 --- a/spring-security-mvc-persisted-remember-me/pom.xml +++ b/spring-security-modules/spring-security-mvc-persisted-remember-me/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-spring-4 0.0.1-SNAPSHOT - ../parent-spring-4 + ../../parent-spring-4 diff --git a/spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/controller/MyController.java b/spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/controller/MyController.java similarity index 100% rename from spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/controller/MyController.java rename to spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/controller/MyController.java diff --git a/spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/security/MySimpleUrlAuthenticationSuccessHandler.java b/spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/security/MySimpleUrlAuthenticationSuccessHandler.java similarity index 100% rename from spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/security/MySimpleUrlAuthenticationSuccessHandler.java rename to spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/security/MySimpleUrlAuthenticationSuccessHandler.java diff --git a/spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/security/SecurityRole.java b/spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/security/SecurityRole.java similarity index 100% rename from spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/security/SecurityRole.java rename to spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/security/SecurityRole.java diff --git a/spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/security/SecurityWebApplicationInitializer.java b/spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/security/SecurityWebApplicationInitializer.java similarity index 100% rename from spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/security/SecurityWebApplicationInitializer.java rename to spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/security/SecurityWebApplicationInitializer.java diff --git a/spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/service/MyUserDetailsService.java b/spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/service/MyUserDetailsService.java similarity index 100% rename from spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/service/MyUserDetailsService.java rename to spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/service/MyUserDetailsService.java diff --git a/spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/spring/MvcConfig.java b/spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/spring/MvcConfig.java similarity index 100% rename from spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/spring/MvcConfig.java rename to spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/spring/MvcConfig.java diff --git a/spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/spring/PersistenceConfig.java b/spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/spring/PersistenceConfig.java similarity index 100% rename from spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/spring/PersistenceConfig.java rename to spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/spring/PersistenceConfig.java diff --git a/spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/spring/SecurityConfig.java b/spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/spring/SecurityConfig.java similarity index 100% rename from spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/spring/SecurityConfig.java rename to spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/java/org/baeldung/spring/SecurityConfig.java diff --git a/spring-security-mvc-persisted-remember-me/src/main/resources/logback.xml b/spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/resources/logback.xml similarity index 100% rename from spring-security-mvc-persisted-remember-me/src/main/resources/logback.xml rename to spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/resources/logback.xml diff --git a/spring-security-mvc-persisted-remember-me/src/main/resources/persisted_logins_create_table.sql b/spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/resources/persisted_logins_create_table.sql similarity index 100% rename from spring-security-mvc-persisted-remember-me/src/main/resources/persisted_logins_create_table.sql rename to spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/resources/persisted_logins_create_table.sql diff --git a/spring-security-mvc-persisted-remember-me/src/main/resources/persistence-h2.properties b/spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/resources/persistence-h2.properties similarity index 100% rename from spring-security-mvc-persisted-remember-me/src/main/resources/persistence-h2.properties rename to spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/resources/persistence-h2.properties diff --git a/spring-security-mvc-persisted-remember-me/src/main/resources/persistence-postgres.properties b/spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/resources/persistence-postgres.properties similarity index 100% rename from spring-security-mvc-persisted-remember-me/src/main/resources/persistence-postgres.properties rename to spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/resources/persistence-postgres.properties diff --git a/spring-security-mvc-persisted-remember-me/src/main/resources/webSecurityConfig.xml b/spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/resources/webSecurityConfig.xml similarity index 100% rename from spring-security-mvc-persisted-remember-me/src/main/resources/webSecurityConfig.xml rename to spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/resources/webSecurityConfig.xml diff --git a/spring-security-mvc-persisted-remember-me/src/main/webapp/WEB-INF/mvc-servlet.xml b/spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/webapp/WEB-INF/mvc-servlet.xml similarity index 100% rename from spring-security-mvc-persisted-remember-me/src/main/webapp/WEB-INF/mvc-servlet.xml rename to spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/webapp/WEB-INF/mvc-servlet.xml diff --git a/spring-security-mvc-persisted-remember-me/src/main/webapp/WEB-INF/view/anonymous.jsp b/spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/webapp/WEB-INF/view/anonymous.jsp similarity index 100% rename from spring-security-mvc-persisted-remember-me/src/main/webapp/WEB-INF/view/anonymous.jsp rename to spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/webapp/WEB-INF/view/anonymous.jsp diff --git a/spring-security-mvc-persisted-remember-me/src/main/webapp/WEB-INF/view/console.jsp b/spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/webapp/WEB-INF/view/console.jsp similarity index 100% rename from spring-security-mvc-persisted-remember-me/src/main/webapp/WEB-INF/view/console.jsp rename to spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/webapp/WEB-INF/view/console.jsp diff --git a/spring-security-mvc-persisted-remember-me/src/main/webapp/WEB-INF/view/homepage.jsp b/spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/webapp/WEB-INF/view/homepage.jsp similarity index 100% rename from spring-security-mvc-persisted-remember-me/src/main/webapp/WEB-INF/view/homepage.jsp rename to spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/webapp/WEB-INF/view/homepage.jsp diff --git a/spring-security-mvc-persisted-remember-me/src/main/webapp/WEB-INF/view/login.jsp b/spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/webapp/WEB-INF/view/login.jsp similarity index 100% rename from spring-security-mvc-persisted-remember-me/src/main/webapp/WEB-INF/view/login.jsp rename to spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/webapp/WEB-INF/view/login.jsp diff --git a/spring-security-mvc-persisted-remember-me/src/main/webapp/WEB-INF/web.xml b/spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from spring-security-mvc-persisted-remember-me/src/main/webapp/WEB-INF/web.xml rename to spring-security-modules/spring-security-mvc-persisted-remember-me/src/main/webapp/WEB-INF/web.xml diff --git a/spring-security-mvc-persisted-remember-me/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-mvc-persisted-remember-me/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-mvc-persisted-remember-me/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-mvc-persisted-remember-me/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-mvc-persisted-remember-me/src/test/resources/.gitignore b/spring-security-modules/spring-security-mvc-persisted-remember-me/src/test/resources/.gitignore similarity index 100% rename from spring-security-mvc-persisted-remember-me/src/test/resources/.gitignore rename to spring-security-modules/spring-security-mvc-persisted-remember-me/src/test/resources/.gitignore diff --git a/spring-security-mvc-socket/.gitignore b/spring-security-modules/spring-security-mvc-socket/.gitignore similarity index 100% rename from spring-security-mvc-socket/.gitignore rename to spring-security-modules/spring-security-mvc-socket/.gitignore diff --git a/spring-security-mvc-socket/README.md b/spring-security-modules/spring-security-mvc-socket/README.md similarity index 100% rename from spring-security-mvc-socket/README.md rename to spring-security-modules/spring-security-mvc-socket/README.md diff --git a/spring-security-mvc-socket/pom.xml b/spring-security-modules/spring-security-mvc-socket/pom.xml similarity index 99% rename from spring-security-mvc-socket/pom.xml rename to spring-security-modules/spring-security-mvc-socket/pom.xml index e9941192ad..ff8cc708e3 100644 --- a/spring-security-mvc-socket/pom.xml +++ b/spring-security-modules/spring-security-mvc-socket/pom.xml @@ -12,7 +12,7 @@ com.baeldung parent-spring-4 0.0.1-SNAPSHOT - ../parent-spring-4 + ../../parent-spring-4 diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/Constants.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/Constants.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/Constants.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/Constants.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/AppConfig.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/AppConfig.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/AppConfig.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/AppConfig.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/DataStoreConfig.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/DataStoreConfig.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/DataStoreConfig.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/DataStoreConfig.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/SecurityConfig.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/SecurityConfig.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/SecurityConfig.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/SecurityConfig.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/SocketBrokerConfig.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/SocketBrokerConfig.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/SocketBrokerConfig.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/SocketBrokerConfig.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/SocketSecurityConfig.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/SocketSecurityConfig.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/SocketSecurityConfig.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/SocketSecurityConfig.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/WebAppInitializer.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/WebAppInitializer.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/WebAppInitializer.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/WebAppInitializer.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/controllers/CsrfTokenController.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/controllers/CsrfTokenController.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/controllers/CsrfTokenController.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/controllers/CsrfTokenController.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/controllers/SocketController.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/controllers/SocketController.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/controllers/SocketController.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/controllers/SocketController.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/domain/Role.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/domain/Role.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/domain/Role.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/domain/Role.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/domain/User.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/domain/User.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/domain/User.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/domain/User.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/repositories/UserRepository.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/repositories/UserRepository.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/repositories/UserRepository.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/repositories/UserRepository.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomAccessDeniedHandler.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomAccessDeniedHandler.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomAccessDeniedHandler.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomAccessDeniedHandler.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomDaoAuthenticationProvider.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomDaoAuthenticationProvider.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomDaoAuthenticationProvider.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomDaoAuthenticationProvider.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomLoginSuccessHandler.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomLoginSuccessHandler.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomLoginSuccessHandler.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomLoginSuccessHandler.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomLogoutSuccessHandler.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomLogoutSuccessHandler.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomLogoutSuccessHandler.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomLogoutSuccessHandler.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomUserDetailsService.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomUserDetailsService.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomUserDetailsService.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomUserDetailsService.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/SecurityWebApplicationInitializer.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/SecurityWebApplicationInitializer.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/SecurityWebApplicationInitializer.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/SecurityWebApplicationInitializer.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/transfer/socket/Message.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/transfer/socket/Message.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/transfer/socket/Message.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/transfer/socket/Message.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/transfer/socket/OutputMessage.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/transfer/socket/OutputMessage.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/transfer/socket/OutputMessage.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/transfer/socket/OutputMessage.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/transfer/user/CustomUserDetails.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/transfer/user/CustomUserDetails.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/transfer/user/CustomUserDetails.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/transfer/user/CustomUserDetails.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/config/WebSocketMessageBrokerConfig.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/config/WebSocketMessageBrokerConfig.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/config/WebSocketMessageBrokerConfig.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/config/WebSocketMessageBrokerConfig.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/controllers/RestAPIController.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/controllers/RestAPIController.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/controllers/RestAPIController.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/controllers/RestAPIController.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/controllers/WebSocketController.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/controllers/WebSocketController.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/controllers/WebSocketController.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/controllers/WebSocketController.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/models/Greeting.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/models/Greeting.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/models/Greeting.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/models/Greeting.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/models/Message.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/models/Message.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/models/Message.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/models/Message.java diff --git a/spring-security-mvc-socket/src/main/resources/data.sql b/spring-security-modules/spring-security-mvc-socket/src/main/resources/data.sql similarity index 100% rename from spring-security-mvc-socket/src/main/resources/data.sql rename to spring-security-modules/spring-security-mvc-socket/src/main/resources/data.sql diff --git a/spring-security-mvc-socket/src/main/resources/logback.xml b/spring-security-modules/spring-security-mvc-socket/src/main/resources/logback.xml similarity index 100% rename from spring-security-mvc-socket/src/main/resources/logback.xml rename to spring-security-modules/spring-security-mvc-socket/src/main/resources/logback.xml diff --git a/spring-security-mvc-socket/src/main/resources/schema.sql b/spring-security-modules/spring-security-mvc-socket/src/main/resources/schema.sql similarity index 100% rename from spring-security-mvc-socket/src/main/resources/schema.sql rename to spring-security-modules/spring-security-mvc-socket/src/main/resources/schema.sql diff --git a/spring-security-mvc-socket/src/main/resources/static/rest.html b/spring-security-modules/spring-security-mvc-socket/src/main/resources/static/rest.html similarity index 100% rename from spring-security-mvc-socket/src/main/resources/static/rest.html rename to spring-security-modules/spring-security-mvc-socket/src/main/resources/static/rest.html diff --git a/spring-security-mvc-socket/src/main/resources/static/rest.js b/spring-security-modules/spring-security-mvc-socket/src/main/resources/static/rest.js similarity index 100% rename from spring-security-mvc-socket/src/main/resources/static/rest.js rename to spring-security-modules/spring-security-mvc-socket/src/main/resources/static/rest.js diff --git a/spring-security-mvc-socket/src/main/resources/static/ws.html b/spring-security-modules/spring-security-mvc-socket/src/main/resources/static/ws.html similarity index 100% rename from spring-security-mvc-socket/src/main/resources/static/ws.html rename to spring-security-modules/spring-security-mvc-socket/src/main/resources/static/ws.html diff --git a/spring-security-mvc-socket/src/main/resources/static/ws.js b/spring-security-modules/spring-security-mvc-socket/src/main/resources/static/ws.js similarity index 100% rename from spring-security-mvc-socket/src/main/resources/static/ws.js rename to spring-security-modules/spring-security-mvc-socket/src/main/resources/static/ws.js diff --git a/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/denied.jsp b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/denied.jsp similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/denied.jsp rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/denied.jsp diff --git a/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/index.jsp b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/index.jsp similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/index.jsp rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/index.jsp diff --git a/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/login.jsp b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/login.jsp similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/login.jsp rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/login.jsp diff --git a/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/socket.jsp b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/socket.jsp similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/socket.jsp rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/socket.jsp diff --git a/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/success.jsp b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/success.jsp similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/success.jsp rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/success.jsp diff --git a/spring-security-mvc-socket/src/main/webapp/resources/scripts/app.js b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/scripts/app.js similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/scripts/app.js rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/scripts/app.js diff --git a/spring-security-mvc-socket/src/main/webapp/resources/scripts/controllers/indexController.js b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/scripts/controllers/indexController.js similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/scripts/controllers/indexController.js rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/scripts/controllers/indexController.js diff --git a/spring-security-mvc-socket/src/main/webapp/resources/scripts/controllers/socketController.js b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/scripts/controllers/socketController.js similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/scripts/controllers/socketController.js rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/scripts/controllers/socketController.js diff --git a/spring-security-mvc-socket/src/main/webapp/resources/scripts/controllers/successController.js b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/scripts/controllers/successController.js similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/scripts/controllers/successController.js rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/scripts/controllers/successController.js diff --git a/spring-security-mvc-socket/src/main/webapp/resources/scripts/routes/router.js b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/scripts/routes/router.js similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/scripts/routes/router.js rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/scripts/routes/router.js diff --git a/spring-security-mvc-socket/src/main/webapp/resources/scripts/services/SocketService.js b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/scripts/services/SocketService.js similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/scripts/services/SocketService.js rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/scripts/services/SocketService.js diff --git a/spring-security-mvc-socket/src/main/webapp/resources/styles/app.css b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/styles/app.css similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/styles/app.css rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/styles/app.css diff --git a/spring-security-mvc-socket/src/main/webapp/resources/styles/denied.css b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/styles/denied.css similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/styles/denied.css rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/styles/denied.css diff --git a/spring-security-mvc-socket/src/main/webapp/resources/styles/index.css b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/styles/index.css similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/styles/index.css rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/styles/index.css diff --git a/spring-security-mvc-socket/src/main/webapp/resources/styles/login.css b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/styles/login.css similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/styles/login.css rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/styles/login.css diff --git a/spring-security-mvc-socket/src/main/webapp/resources/styles/socket.css b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/styles/socket.css similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/styles/socket.css rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/styles/socket.css diff --git a/spring-security-mvc-socket/src/main/webapp/resources/styles/success.css b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/styles/success.css similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/styles/success.css rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/styles/success.css diff --git a/spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular-route.min.js b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular-route.min.js similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular-route.min.js rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular-route.min.js diff --git a/spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular-route.min.js.map b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular-route.min.js.map similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular-route.min.js.map rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular-route.min.js.map diff --git a/spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular.min.js b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular.min.js similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular.min.js rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular.min.js diff --git a/spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular.min.js.map b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular.min.js.map similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular.min.js.map rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular.min.js.map diff --git a/spring-security-mvc-socket/src/main/webapp/resources/vendor/jquery/jquery.min.js b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/jquery/jquery.min.js similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/vendor/jquery/jquery.min.js rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/jquery/jquery.min.js diff --git a/spring-security-mvc-socket/src/main/webapp/resources/vendor/sockjs/sockjs.min.js b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/sockjs/sockjs.min.js similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/vendor/sockjs/sockjs.min.js rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/sockjs/sockjs.min.js diff --git a/spring-security-mvc-socket/src/main/webapp/resources/vendor/sockjs/sockjs.min.js.map b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/sockjs/sockjs.min.js.map similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/vendor/sockjs/sockjs.min.js.map rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/sockjs/sockjs.min.js.map diff --git a/spring-security-mvc-socket/src/main/webapp/resources/vendor/stomp/stomp.min.js b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/stomp/stomp.min.js similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/vendor/stomp/stomp.min.js rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/stomp/stomp.min.js diff --git a/spring-security-mvc-socket/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-mvc-socket/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-mvc-socket/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-mvc-socket/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-mvc/.gitignore b/spring-security-modules/spring-security-mvc/.gitignore similarity index 100% rename from spring-security-mvc/.gitignore rename to spring-security-modules/spring-security-mvc/.gitignore diff --git a/spring-security-mvc/README.md b/spring-security-modules/spring-security-mvc/README.md similarity index 100% rename from spring-security-mvc/README.md rename to spring-security-modules/spring-security-mvc/README.md diff --git a/spring-security-mvc/pom.xml b/spring-security-modules/spring-security-mvc/pom.xml similarity index 97% rename from spring-security-mvc/pom.xml rename to spring-security-modules/spring-security-mvc/pom.xml index d8f8372142..7da047707a 100644 --- a/spring-security-mvc/pom.xml +++ b/spring-security-modules/spring-security-mvc/pom.xml @@ -12,7 +12,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/spring-security-mvc/src/main/java/com/baeldung/monitoring/MetricRegistrySingleton.java b/spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/monitoring/MetricRegistrySingleton.java similarity index 100% rename from spring-security-mvc/src/main/java/com/baeldung/monitoring/MetricRegistrySingleton.java rename to spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/monitoring/MetricRegistrySingleton.java diff --git a/spring-security-mvc/src/main/java/com/baeldung/security/MySimpleUrlAuthenticationSuccessHandler.java b/spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/security/MySimpleUrlAuthenticationSuccessHandler.java similarity index 100% rename from spring-security-mvc/src/main/java/com/baeldung/security/MySimpleUrlAuthenticationSuccessHandler.java rename to spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/security/MySimpleUrlAuthenticationSuccessHandler.java diff --git a/spring-security-mvc/src/main/java/com/baeldung/session/SpringSessionApplication.java b/spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/SpringSessionApplication.java similarity index 100% rename from spring-security-mvc/src/main/java/com/baeldung/session/SpringSessionApplication.java rename to spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/SpringSessionApplication.java diff --git a/spring-security-mvc/src/main/java/com/baeldung/session/bean/Constants.java b/spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/bean/Constants.java similarity index 100% rename from spring-security-mvc/src/main/java/com/baeldung/session/bean/Constants.java rename to spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/bean/Constants.java diff --git a/spring-security-mvc/src/main/java/com/baeldung/session/bean/Foo.java b/spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/bean/Foo.java similarity index 100% rename from spring-security-mvc/src/main/java/com/baeldung/session/bean/Foo.java rename to spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/bean/Foo.java diff --git a/spring-security-mvc/src/main/java/com/baeldung/session/filter/SessionFilter.java b/spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/filter/SessionFilter.java similarity index 100% rename from spring-security-mvc/src/main/java/com/baeldung/session/filter/SessionFilter.java rename to spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/filter/SessionFilter.java diff --git a/spring-security-mvc/src/main/java/com/baeldung/session/security/config/SecSecurityConfig.java b/spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/security/config/SecSecurityConfig.java similarity index 100% rename from spring-security-mvc/src/main/java/com/baeldung/session/security/config/SecSecurityConfig.java rename to spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/security/config/SecSecurityConfig.java diff --git a/spring-security-mvc/src/main/java/com/baeldung/session/web/FooController.java b/spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/web/FooController.java similarity index 100% rename from spring-security-mvc/src/main/java/com/baeldung/session/web/FooController.java rename to spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/web/FooController.java diff --git a/spring-security-mvc/src/main/java/com/baeldung/session/web/SessionRestController.java b/spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/web/SessionRestController.java similarity index 100% rename from spring-security-mvc/src/main/java/com/baeldung/session/web/SessionRestController.java rename to spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/web/SessionRestController.java diff --git a/spring-security-mvc/src/main/java/com/baeldung/session/web/config/MvcConfig.java b/spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/web/config/MvcConfig.java similarity index 100% rename from spring-security-mvc/src/main/java/com/baeldung/session/web/config/MvcConfig.java rename to spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/web/config/MvcConfig.java diff --git a/spring-security-mvc/src/main/java/com/baeldung/web/SessionListenerWithMetrics.java b/spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/web/SessionListenerWithMetrics.java similarity index 100% rename from spring-security-mvc/src/main/java/com/baeldung/web/SessionListenerWithMetrics.java rename to spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/web/SessionListenerWithMetrics.java diff --git a/spring-security-mvc/src/main/resources/application.properties b/spring-security-modules/spring-security-mvc/src/main/resources/application.properties similarity index 100% rename from spring-security-mvc/src/main/resources/application.properties rename to spring-security-modules/spring-security-mvc/src/main/resources/application.properties diff --git a/spring-security-mvc/src/main/resources/logback.xml b/spring-security-modules/spring-security-mvc/src/main/resources/logback.xml similarity index 100% rename from spring-security-mvc/src/main/resources/logback.xml rename to spring-security-modules/spring-security-mvc/src/main/resources/logback.xml diff --git a/spring-security-mvc/src/main/resources/webSecurityConfig.xml b/spring-security-modules/spring-security-mvc/src/main/resources/webSecurityConfig.xml similarity index 100% rename from spring-security-mvc/src/main/resources/webSecurityConfig.xml rename to spring-security-modules/spring-security-mvc/src/main/resources/webSecurityConfig.xml diff --git a/spring-security-mvc/src/main/webapp/WEB-INF/mvc-servlet.xml b/spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/mvc-servlet.xml similarity index 100% rename from spring-security-mvc/src/main/webapp/WEB-INF/mvc-servlet.xml rename to spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/mvc-servlet.xml diff --git a/spring-security-mvc/src/main/webapp/WEB-INF/view/anonymous.jsp b/spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/view/anonymous.jsp similarity index 100% rename from spring-security-mvc/src/main/webapp/WEB-INF/view/anonymous.jsp rename to spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/view/anonymous.jsp diff --git a/spring-security-mvc/src/main/webapp/WEB-INF/view/console.jsp b/spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/view/console.jsp similarity index 100% rename from spring-security-mvc/src/main/webapp/WEB-INF/view/console.jsp rename to spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/view/console.jsp diff --git a/spring-security-mvc/src/main/webapp/WEB-INF/view/homepage.jsp b/spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/view/homepage.jsp similarity index 100% rename from spring-security-mvc/src/main/webapp/WEB-INF/view/homepage.jsp rename to spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/view/homepage.jsp diff --git a/spring-security-mvc/src/main/webapp/WEB-INF/view/invalidSession.jsp b/spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/view/invalidSession.jsp similarity index 100% rename from spring-security-mvc/src/main/webapp/WEB-INF/view/invalidSession.jsp rename to spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/view/invalidSession.jsp diff --git a/spring-security-mvc/src/main/webapp/WEB-INF/view/login.jsp b/spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/view/login.jsp similarity index 100% rename from spring-security-mvc/src/main/webapp/WEB-INF/view/login.jsp rename to spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/view/login.jsp diff --git a/spring-security-mvc/src/main/webapp/WEB-INF/view/sessionExpired.jsp b/spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/view/sessionExpired.jsp similarity index 100% rename from spring-security-mvc/src/main/webapp/WEB-INF/view/sessionExpired.jsp rename to spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/view/sessionExpired.jsp diff --git a/spring-security-mvc/src/main/webapp/WEB-INF/web.xml b/spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from spring-security-mvc/src/main/webapp/WEB-INF/web.xml rename to spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/web.xml diff --git a/spring-security-mvc/src/test/java/com/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-mvc/src/test/java/com/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-mvc/src/test/java/com/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-mvc/src/test/java/com/baeldung/SpringContextTest.java diff --git a/spring-security-mvc/src/test/java/com/baeldung/session/SessionConfigurationLiveTest.java b/spring-security-modules/spring-security-mvc/src/test/java/com/baeldung/session/SessionConfigurationLiveTest.java similarity index 100% rename from spring-security-mvc/src/test/java/com/baeldung/session/SessionConfigurationLiveTest.java rename to spring-security-modules/spring-security-mvc/src/test/java/com/baeldung/session/SessionConfigurationLiveTest.java diff --git a/spring-security-mvc/src/test/resources/.gitignore b/spring-security-modules/spring-security-mvc/src/test/resources/.gitignore similarity index 100% rename from spring-security-mvc/src/test/resources/.gitignore rename to spring-security-modules/spring-security-mvc/src/test/resources/.gitignore diff --git a/spring-security-openid/README.md b/spring-security-modules/spring-security-openid/README.md similarity index 100% rename from spring-security-openid/README.md rename to spring-security-modules/spring-security-openid/README.md diff --git a/spring-security-openid/pom.xml b/spring-security-modules/spring-security-openid/pom.xml similarity index 97% rename from spring-security-openid/pom.xml rename to spring-security-modules/spring-security-openid/pom.xml index a67f5043e4..970182dc3b 100644 --- a/spring-security-openid/pom.xml +++ b/spring-security-modules/spring-security-openid/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/spring-security-openid/src/main/java/org/baeldung/config/GoogleOpenIdConnectConfig.java b/spring-security-modules/spring-security-openid/src/main/java/org/baeldung/config/GoogleOpenIdConnectConfig.java similarity index 100% rename from spring-security-openid/src/main/java/org/baeldung/config/GoogleOpenIdConnectConfig.java rename to spring-security-modules/spring-security-openid/src/main/java/org/baeldung/config/GoogleOpenIdConnectConfig.java diff --git a/spring-security-openid/src/main/java/org/baeldung/config/HomeController.java b/spring-security-modules/spring-security-openid/src/main/java/org/baeldung/config/HomeController.java similarity index 100% rename from spring-security-openid/src/main/java/org/baeldung/config/HomeController.java rename to spring-security-modules/spring-security-openid/src/main/java/org/baeldung/config/HomeController.java diff --git a/spring-security-openid/src/main/java/org/baeldung/config/SecurityConfig.java b/spring-security-modules/spring-security-openid/src/main/java/org/baeldung/config/SecurityConfig.java similarity index 100% rename from spring-security-openid/src/main/java/org/baeldung/config/SecurityConfig.java rename to spring-security-modules/spring-security-openid/src/main/java/org/baeldung/config/SecurityConfig.java diff --git a/spring-security-openid/src/main/java/org/baeldung/config/SpringOpenidApplication.java b/spring-security-modules/spring-security-openid/src/main/java/org/baeldung/config/SpringOpenidApplication.java similarity index 100% rename from spring-security-openid/src/main/java/org/baeldung/config/SpringOpenidApplication.java rename to spring-security-modules/spring-security-openid/src/main/java/org/baeldung/config/SpringOpenidApplication.java diff --git a/spring-security-openid/src/main/java/org/baeldung/security/OpenIdConnectFilter.java b/spring-security-modules/spring-security-openid/src/main/java/org/baeldung/security/OpenIdConnectFilter.java similarity index 100% rename from spring-security-openid/src/main/java/org/baeldung/security/OpenIdConnectFilter.java rename to spring-security-modules/spring-security-openid/src/main/java/org/baeldung/security/OpenIdConnectFilter.java diff --git a/spring-security-openid/src/main/java/org/baeldung/security/OpenIdConnectUserDetails.java b/spring-security-modules/spring-security-openid/src/main/java/org/baeldung/security/OpenIdConnectUserDetails.java similarity index 100% rename from spring-security-openid/src/main/java/org/baeldung/security/OpenIdConnectUserDetails.java rename to spring-security-modules/spring-security-openid/src/main/java/org/baeldung/security/OpenIdConnectUserDetails.java diff --git a/spring-security-openid/src/main/resources/application.properties b/spring-security-modules/spring-security-openid/src/main/resources/application.properties similarity index 100% rename from spring-security-openid/src/main/resources/application.properties rename to spring-security-modules/spring-security-openid/src/main/resources/application.properties diff --git a/spring-security-openid/src/main/resources/logback.xml b/spring-security-modules/spring-security-openid/src/main/resources/logback.xml similarity index 100% rename from spring-security-openid/src/main/resources/logback.xml rename to spring-security-modules/spring-security-openid/src/main/resources/logback.xml diff --git a/spring-security-openid/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-openid/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-openid/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-openid/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-react/.gitignore b/spring-security-modules/spring-security-react/.gitignore similarity index 100% rename from spring-security-react/.gitignore rename to spring-security-modules/spring-security-react/.gitignore diff --git a/spring-security-react/README.md b/spring-security-modules/spring-security-react/README.md similarity index 100% rename from spring-security-react/README.md rename to spring-security-modules/spring-security-react/README.md diff --git a/spring-security-react/pom.xml b/spring-security-modules/spring-security-react/pom.xml similarity index 99% rename from spring-security-react/pom.xml rename to spring-security-modules/spring-security-react/pom.xml index 96ef1c5a04..19240fe88c 100644 --- a/spring-security-react/pom.xml +++ b/spring-security-modules/spring-security-react/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-spring-4 0.0.1-SNAPSHOT - ../parent-spring-4 + ../../parent-spring-4 diff --git a/spring-security-react/src/main/java/org/baeldung/spring/MvcConfig.java b/spring-security-modules/spring-security-react/src/main/java/org/baeldung/spring/MvcConfig.java similarity index 100% rename from spring-security-react/src/main/java/org/baeldung/spring/MvcConfig.java rename to spring-security-modules/spring-security-react/src/main/java/org/baeldung/spring/MvcConfig.java diff --git a/spring-security-react/src/main/java/org/baeldung/spring/SecSecurityConfig.java b/spring-security-modules/spring-security-react/src/main/java/org/baeldung/spring/SecSecurityConfig.java similarity index 100% rename from spring-security-react/src/main/java/org/baeldung/spring/SecSecurityConfig.java rename to spring-security-modules/spring-security-react/src/main/java/org/baeldung/spring/SecSecurityConfig.java diff --git a/spring-security-react/src/main/resources/logback.xml b/spring-security-modules/spring-security-react/src/main/resources/logback.xml similarity index 100% rename from spring-security-react/src/main/resources/logback.xml rename to spring-security-modules/spring-security-react/src/main/resources/logback.xml diff --git a/spring-security-react/src/main/webapp/WEB-INF/mvc-servlet.xml b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/mvc-servlet.xml similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/mvc-servlet.xml rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/mvc-servlet.xml diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/accessDenied.jsp b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/accessDenied.jsp similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/accessDenied.jsp rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/accessDenied.jsp diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/admin/adminpage.jsp b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/admin/adminpage.jsp similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/admin/adminpage.jsp rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/admin/adminpage.jsp diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/anonymous.jsp b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/anonymous.jsp similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/anonymous.jsp rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/anonymous.jsp diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/homepage.jsp b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/homepage.jsp similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/homepage.jsp rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/homepage.jsp diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/.babelrc b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/.babelrc similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/.babelrc rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/.babelrc diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/.eslintignore b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/.eslintignore similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/.eslintignore rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/.eslintignore diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/.eslintrc b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/.eslintrc similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/.eslintrc rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/.eslintrc diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/.gitignore b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/.gitignore similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/.gitignore rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/.gitignore diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/package-lock.json b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/package-lock.json similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/package-lock.json rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/package-lock.json diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/package.json b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/package.json similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/package.json rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/package.json diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/public/favicon.ico b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/public/favicon.ico similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/public/favicon.ico rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/public/favicon.ico diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/public/index.html b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/public/index.html similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/public/index.html rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/public/index.html diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/public/manifest.json b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/public/manifest.json similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/public/manifest.json rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/public/manifest.json diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/src/Form.js b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/src/Form.js similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/src/Form.js rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/src/Form.js diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/src/Input.js b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/src/Input.js similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/src/Input.js rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/src/Input.js diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/src/index.css b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/src/index.css similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/src/index.css rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/src/index.css diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/src/index.js b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/src/index.js similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/src/index.js rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/src/index.js diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/src/registerServiceWorker.js b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/src/registerServiceWorker.js similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/src/registerServiceWorker.js rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/src/registerServiceWorker.js diff --git a/spring-security-react/src/main/webapp/WEB-INF/web.xml b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/web.xml rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/web.xml diff --git a/spring-security-react/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-react/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-react/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-react/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-rest-basic-auth/.gitignore b/spring-security-modules/spring-security-rest-basic-auth/.gitignore similarity index 100% rename from spring-security-rest-basic-auth/.gitignore rename to spring-security-modules/spring-security-rest-basic-auth/.gitignore diff --git a/spring-security-rest-basic-auth/README.md b/spring-security-modules/spring-security-rest-basic-auth/README.md similarity index 100% rename from spring-security-rest-basic-auth/README.md rename to spring-security-modules/spring-security-rest-basic-auth/README.md diff --git a/spring-security-rest-basic-auth/pom.xml b/spring-security-modules/spring-security-rest-basic-auth/pom.xml similarity index 99% rename from spring-security-rest-basic-auth/pom.xml rename to spring-security-modules/spring-security-rest-basic-auth/pom.xml index 5bb74fa6e6..416882b3d4 100644 --- a/spring-security-rest-basic-auth/pom.xml +++ b/spring-security-modules/spring-security-rest-basic-auth/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-spring-5 0.0.1-SNAPSHOT - ../parent-spring-5 + ../../parent-spring-5 diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/basic/MyBasicAuthenticationEntryPoint.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/basic/MyBasicAuthenticationEntryPoint.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/basic/MyBasicAuthenticationEntryPoint.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/basic/MyBasicAuthenticationEntryPoint.java diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/client/HttpComponentsClientHttpRequestFactoryBasicAuth.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/client/HttpComponentsClientHttpRequestFactoryBasicAuth.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/client/HttpComponentsClientHttpRequestFactoryBasicAuth.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/client/HttpComponentsClientHttpRequestFactoryBasicAuth.java diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/client/RestTemplateFactory.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/client/RestTemplateFactory.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/client/RestTemplateFactory.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/client/RestTemplateFactory.java diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/client/spring/ClientConfig.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/client/spring/ClientConfig.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/client/spring/ClientConfig.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/client/spring/ClientConfig.java diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/filter/CustomFilter.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/filter/CustomFilter.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/filter/CustomFilter.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/filter/CustomFilter.java diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/filter/CustomWebSecurityConfigurerAdapter.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/filter/CustomWebSecurityConfigurerAdapter.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/filter/CustomWebSecurityConfigurerAdapter.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/filter/CustomWebSecurityConfigurerAdapter.java diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/security/MySavedRequestAwareAuthenticationSuccessHandler.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/security/MySavedRequestAwareAuthenticationSuccessHandler.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/security/MySavedRequestAwareAuthenticationSuccessHandler.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/security/MySavedRequestAwareAuthenticationSuccessHandler.java diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/security/RestAuthenticationEntryPoint.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/security/RestAuthenticationEntryPoint.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/security/RestAuthenticationEntryPoint.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/security/RestAuthenticationEntryPoint.java diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/spring/SecSecurityConfig.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/spring/SecSecurityConfig.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/spring/SecSecurityConfig.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/spring/SecSecurityConfig.java diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/spring/WebConfig.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/spring/WebConfig.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/spring/WebConfig.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/spring/WebConfig.java diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/web/controller/BarController.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/web/controller/BarController.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/web/controller/BarController.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/web/controller/BarController.java diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/web/controller/FooController.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/web/controller/FooController.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/web/controller/FooController.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/web/controller/FooController.java diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/web/dto/Bar.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/web/dto/Bar.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/web/dto/Bar.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/web/dto/Bar.java diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/web/dto/Foo.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/web/dto/Foo.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/web/dto/Foo.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/web/dto/Foo.java diff --git a/spring-security-rest-basic-auth/src/main/resources/logback.xml b/spring-security-modules/spring-security-rest-basic-auth/src/main/resources/logback.xml similarity index 100% rename from spring-security-rest-basic-auth/src/main/resources/logback.xml rename to spring-security-modules/spring-security-rest-basic-auth/src/main/resources/logback.xml diff --git a/spring-security-rest-basic-auth/src/main/resources/webSecurityConfig.xml b/spring-security-modules/spring-security-rest-basic-auth/src/main/resources/webSecurityConfig.xml similarity index 100% rename from spring-security-rest-basic-auth/src/main/resources/webSecurityConfig.xml rename to spring-security-modules/spring-security-rest-basic-auth/src/main/resources/webSecurityConfig.xml diff --git a/spring-security-rest-basic-auth/src/main/webapp/WEB-INF/api-servlet.xml b/spring-security-modules/spring-security-rest-basic-auth/src/main/webapp/WEB-INF/api-servlet.xml similarity index 100% rename from spring-security-rest-basic-auth/src/main/webapp/WEB-INF/api-servlet.xml rename to spring-security-modules/spring-security-rest-basic-auth/src/main/webapp/WEB-INF/api-servlet.xml diff --git a/spring-security-rest-basic-auth/src/main/webapp/WEB-INF/web.xml b/spring-security-modules/spring-security-rest-basic-auth/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from spring-security-rest-basic-auth/src/main/webapp/WEB-INF/web.xml rename to spring-security-modules/spring-security-rest-basic-auth/src/main/webapp/WEB-INF/web.xml diff --git a/spring-security-rest-basic-auth/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-rest-basic-auth/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-rest-basic-auth/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-rest-basic-auth/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-rest-basic-auth/src/test/resources/.gitignore b/spring-security-modules/spring-security-rest-basic-auth/src/test/resources/.gitignore similarity index 100% rename from spring-security-rest-basic-auth/src/test/resources/.gitignore rename to spring-security-modules/spring-security-rest-basic-auth/src/test/resources/.gitignore diff --git a/spring-security-rest-custom/README.md b/spring-security-modules/spring-security-rest-custom/README.md similarity index 100% rename from spring-security-rest-custom/README.md rename to spring-security-modules/spring-security-rest-custom/README.md diff --git a/spring-security-rest-custom/pom.xml b/spring-security-modules/spring-security-rest-custom/pom.xml similarity index 99% rename from spring-security-rest-custom/pom.xml rename to spring-security-modules/spring-security-rest-custom/pom.xml index d8e53d5b38..d9072ec8a2 100644 --- a/spring-security-rest-custom/pom.xml +++ b/spring-security-modules/spring-security-rest-custom/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/config/MainWebAppInitializer.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/config/MainWebAppInitializer.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/config/MainWebAppInitializer.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/config/MainWebAppInitializer.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/config/child/MethodSecurityConfig.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/config/child/MethodSecurityConfig.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/config/child/MethodSecurityConfig.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/config/child/MethodSecurityConfig.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/config/child/WebConfig.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/config/child/WebConfig.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/config/child/WebConfig.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/config/child/WebConfig.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/config/parent/SecurityConfig.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/config/parent/SecurityConfig.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/config/parent/SecurityConfig.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/config/parent/SecurityConfig.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/config/parent/ServiceConfig.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/config/parent/ServiceConfig.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/config/parent/ServiceConfig.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/config/parent/ServiceConfig.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/security/AuthenticationFacade.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/security/AuthenticationFacade.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/security/AuthenticationFacade.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/security/AuthenticationFacade.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/security/CustomAuthenticationProvider.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/security/CustomAuthenticationProvider.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/security/CustomAuthenticationProvider.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/security/CustomAuthenticationProvider.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/security/IAuthenticationFacade.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/security/IAuthenticationFacade.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/security/IAuthenticationFacade.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/security/IAuthenticationFacade.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/security/MySavedRequestAwareAuthenticationSuccessHandler.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/security/MySavedRequestAwareAuthenticationSuccessHandler.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/security/MySavedRequestAwareAuthenticationSuccessHandler.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/security/MySavedRequestAwareAuthenticationSuccessHandler.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/security/RestAuthenticationEntryPoint.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/security/RestAuthenticationEntryPoint.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/security/RestAuthenticationEntryPoint.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/security/RestAuthenticationEntryPoint.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/service/FooService.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/service/FooService.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/service/FooService.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/service/FooService.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/service/IFooService.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/service/IFooService.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/service/IFooService.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/service/IFooService.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/service/RunAsService.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/service/RunAsService.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/service/RunAsService.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/service/RunAsService.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/FooController.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/FooController.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/web/controller/FooController.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/FooController.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/GetUserWithCustomInterfaceController.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/GetUserWithCustomInterfaceController.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/web/controller/GetUserWithCustomInterfaceController.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/GetUserWithCustomInterfaceController.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/GetUserWithHTTPServletRequestController.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/GetUserWithHTTPServletRequestController.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/web/controller/GetUserWithHTTPServletRequestController.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/GetUserWithHTTPServletRequestController.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/RunAsController.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/RunAsController.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/web/controller/RunAsController.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/RunAsController.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/SecurityController.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/SecurityController.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/web/controller/SecurityController.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/SecurityController.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/SecurityController1.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/SecurityController1.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/web/controller/SecurityController1.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/SecurityController1.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/SecurityController3.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/SecurityController3.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/web/controller/SecurityController3.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/SecurityController3.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/ViewController.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/ViewController.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/web/controller/ViewController.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/ViewController.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/web/dto/Foo.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/dto/Foo.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/web/dto/Foo.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/dto/Foo.java diff --git a/spring-security-rest-custom/src/main/resources/foo.properties b/spring-security-modules/spring-security-rest-custom/src/main/resources/foo.properties similarity index 100% rename from spring-security-rest-custom/src/main/resources/foo.properties rename to spring-security-modules/spring-security-rest-custom/src/main/resources/foo.properties diff --git a/spring-security-rest-custom/src/main/resources/logback.xml b/spring-security-modules/spring-security-rest-custom/src/main/resources/logback.xml similarity index 100% rename from spring-security-rest-custom/src/main/resources/logback.xml rename to spring-security-modules/spring-security-rest-custom/src/main/resources/logback.xml diff --git a/spring-security-rest-custom/src/main/resources/prop.xml b/spring-security-modules/spring-security-rest-custom/src/main/resources/prop.xml similarity index 100% rename from spring-security-rest-custom/src/main/resources/prop.xml rename to spring-security-modules/spring-security-rest-custom/src/main/resources/prop.xml diff --git a/spring-security-rest-custom/src/main/resources/webSecurityConfig.xml b/spring-security-modules/spring-security-rest-custom/src/main/resources/webSecurityConfig.xml similarity index 100% rename from spring-security-rest-custom/src/main/resources/webSecurityConfig.xml rename to spring-security-modules/spring-security-rest-custom/src/main/resources/webSecurityConfig.xml diff --git a/spring-security-rest-custom/src/main/webapp/WEB-INF/templates/index.html b/spring-security-modules/spring-security-rest-custom/src/main/webapp/WEB-INF/templates/index.html similarity index 100% rename from spring-security-rest-custom/src/main/webapp/WEB-INF/templates/index.html rename to spring-security-modules/spring-security-rest-custom/src/main/webapp/WEB-INF/templates/index.html diff --git a/spring-security-rest-custom/src/main/webapp/WEB-INF/templates/runas.html b/spring-security-modules/spring-security-rest-custom/src/main/webapp/WEB-INF/templates/runas.html similarity index 100% rename from spring-security-rest-custom/src/main/webapp/WEB-INF/templates/runas.html rename to spring-security-modules/spring-security-rest-custom/src/main/webapp/WEB-INF/templates/runas.html diff --git a/spring-security-rest-custom/src/main/webapp/WEB-INF/web_old.xml b/spring-security-modules/spring-security-rest-custom/src/main/webapp/WEB-INF/web_old.xml similarity index 100% rename from spring-security-rest-custom/src/main/webapp/WEB-INF/web_old.xml rename to spring-security-modules/spring-security-rest-custom/src/main/webapp/WEB-INF/web_old.xml diff --git a/spring-security-rest-custom/src/test/resources/.gitignore b/spring-security-modules/spring-security-rest-custom/src/test/resources/.gitignore similarity index 100% rename from spring-security-rest-custom/src/test/resources/.gitignore rename to spring-security-modules/spring-security-rest-custom/src/test/resources/.gitignore diff --git a/spring-security-rest/.gitignore b/spring-security-modules/spring-security-rest/.gitignore similarity index 100% rename from spring-security-rest/.gitignore rename to spring-security-modules/spring-security-rest/.gitignore diff --git a/spring-security-rest/README.md b/spring-security-modules/spring-security-rest/README.md similarity index 100% rename from spring-security-rest/README.md rename to spring-security-modules/spring-security-rest/README.md diff --git a/spring-security-rest/pom.xml b/spring-security-modules/spring-security-rest/pom.xml similarity index 99% rename from spring-security-rest/pom.xml rename to spring-security-modules/spring-security-rest/pom.xml index 6b29d6ea7f..9410f08378 100644 --- a/spring-security-rest/pom.xml +++ b/spring-security-modules/spring-security-rest/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-spring-5 0.0.1-SNAPSHOT - ../parent-spring-5 + ../../parent-spring-5 diff --git a/spring-security-rest/src/main/java/org/baeldung/errorhandling/ApiError.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/errorhandling/ApiError.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/errorhandling/ApiError.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/errorhandling/ApiError.java diff --git a/spring-security-rest/src/main/java/org/baeldung/errorhandling/CustomRestExceptionHandler.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/errorhandling/CustomRestExceptionHandler.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/errorhandling/CustomRestExceptionHandler.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/errorhandling/CustomRestExceptionHandler.java diff --git a/spring-security-rest/src/main/java/org/baeldung/persistence/model/Foo.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/persistence/model/Foo.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/persistence/model/Foo.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/persistence/model/Foo.java diff --git a/spring-security-rest/src/main/java/org/baeldung/security/SecurityJavaConfig.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/security/SecurityJavaConfig.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/security/SecurityJavaConfig.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/security/SecurityJavaConfig.java diff --git a/spring-security-rest/src/main/java/org/baeldung/security/web/MySavedRequestAwareAuthenticationSuccessHandler.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/security/web/MySavedRequestAwareAuthenticationSuccessHandler.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/security/web/MySavedRequestAwareAuthenticationSuccessHandler.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/security/web/MySavedRequestAwareAuthenticationSuccessHandler.java diff --git a/spring-security-rest/src/main/java/org/baeldung/security/web/RestAuthenticationEntryPoint.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/security/web/RestAuthenticationEntryPoint.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/security/web/RestAuthenticationEntryPoint.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/security/web/RestAuthenticationEntryPoint.java diff --git a/spring-security-rest/src/main/java/org/baeldung/spring/ClientWebConfig.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/spring/ClientWebConfig.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/spring/ClientWebConfig.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/spring/ClientWebConfig.java diff --git a/spring-security-rest/src/main/java/org/baeldung/spring/SecurityXmlConfig.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/spring/SecurityXmlConfig.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/spring/SecurityXmlConfig.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/spring/SecurityXmlConfig.java diff --git a/spring-security-rest/src/main/java/org/baeldung/spring/WebConfig.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/spring/WebConfig.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/spring/WebConfig.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/spring/WebConfig.java diff --git a/spring-security-rest/src/main/java/org/baeldung/swagger2/SwaggerConfig.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/swagger2/SwaggerConfig.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/swagger2/SwaggerConfig.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/swagger2/SwaggerConfig.java diff --git a/spring-security-rest/src/main/java/org/baeldung/web/controller/AsyncController.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/controller/AsyncController.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/web/controller/AsyncController.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/controller/AsyncController.java diff --git a/spring-security-rest/src/main/java/org/baeldung/web/controller/CustomController.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/controller/CustomController.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/web/controller/CustomController.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/controller/CustomController.java diff --git a/spring-security-rest/src/main/java/org/baeldung/web/controller/FooController.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/controller/FooController.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/web/controller/FooController.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/controller/FooController.java diff --git a/spring-security-rest/src/main/java/org/baeldung/web/controller/RootController.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/controller/RootController.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/web/controller/RootController.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/controller/RootController.java diff --git a/spring-security-rest/src/main/java/org/baeldung/web/error/CustomAccessDeniedHandler.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/error/CustomAccessDeniedHandler.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/web/error/CustomAccessDeniedHandler.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/error/CustomAccessDeniedHandler.java diff --git a/spring-security-rest/src/main/java/org/baeldung/web/error/RestResponseEntityExceptionHandler.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/error/RestResponseEntityExceptionHandler.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/web/error/RestResponseEntityExceptionHandler.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/error/RestResponseEntityExceptionHandler.java diff --git a/spring-security-rest/src/main/java/org/baeldung/web/exception/MyResourceNotFoundException.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/exception/MyResourceNotFoundException.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/web/exception/MyResourceNotFoundException.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/exception/MyResourceNotFoundException.java diff --git a/spring-security-rest/src/main/java/org/baeldung/web/service/AsyncService.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/service/AsyncService.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/web/service/AsyncService.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/service/AsyncService.java diff --git a/spring-security-rest/src/main/java/org/baeldung/web/service/AsyncServiceImpl.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/service/AsyncServiceImpl.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/web/service/AsyncServiceImpl.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/service/AsyncServiceImpl.java diff --git a/spring-security-rest/src/main/resources/logback.xml b/spring-security-modules/spring-security-rest/src/main/resources/logback.xml similarity index 100% rename from spring-security-rest/src/main/resources/logback.xml rename to spring-security-modules/spring-security-rest/src/main/resources/logback.xml diff --git a/spring-security-rest/src/main/resources/webSecurityConfig.xml b/spring-security-modules/spring-security-rest/src/main/resources/webSecurityConfig.xml similarity index 100% rename from spring-security-rest/src/main/resources/webSecurityConfig.xml rename to spring-security-modules/spring-security-rest/src/main/resources/webSecurityConfig.xml diff --git a/spring-security-rest/src/main/webapp/WEB-INF/api-servlet.xml b/spring-security-modules/spring-security-rest/src/main/webapp/WEB-INF/api-servlet.xml similarity index 100% rename from spring-security-rest/src/main/webapp/WEB-INF/api-servlet.xml rename to spring-security-modules/spring-security-rest/src/main/webapp/WEB-INF/api-servlet.xml diff --git a/spring-security-rest/src/main/webapp/WEB-INF/view/csrfAttacker.jsp b/spring-security-modules/spring-security-rest/src/main/webapp/WEB-INF/view/csrfAttacker.jsp similarity index 100% rename from spring-security-rest/src/main/webapp/WEB-INF/view/csrfAttacker.jsp rename to spring-security-modules/spring-security-rest/src/main/webapp/WEB-INF/view/csrfAttacker.jsp diff --git a/spring-security-rest/src/main/webapp/WEB-INF/web.xml b/spring-security-modules/spring-security-rest/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from spring-security-rest/src/main/webapp/WEB-INF/web.xml rename to spring-security-modules/spring-security-rest/src/main/webapp/WEB-INF/web.xml diff --git a/spring-security-rest/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-rest/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-rest/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-rest/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-rest/src/test/java/org/baeldung/errorhandling/FooLiveTest.java b/spring-security-modules/spring-security-rest/src/test/java/org/baeldung/errorhandling/FooLiveTest.java similarity index 100% rename from spring-security-rest/src/test/java/org/baeldung/errorhandling/FooLiveTest.java rename to spring-security-modules/spring-security-rest/src/test/java/org/baeldung/errorhandling/FooLiveTest.java diff --git a/spring-security-rest/src/test/java/org/baeldung/web/AsyncControllerIntegrationTest.java b/spring-security-modules/spring-security-rest/src/test/java/org/baeldung/web/AsyncControllerIntegrationTest.java similarity index 100% rename from spring-security-rest/src/test/java/org/baeldung/web/AsyncControllerIntegrationTest.java rename to spring-security-modules/spring-security-rest/src/test/java/org/baeldung/web/AsyncControllerIntegrationTest.java diff --git a/spring-security-rest/src/test/java/org/baeldung/web/SwaggerLiveTest.java b/spring-security-modules/spring-security-rest/src/test/java/org/baeldung/web/SwaggerLiveTest.java similarity index 100% rename from spring-security-rest/src/test/java/org/baeldung/web/SwaggerLiveTest.java rename to spring-security-modules/spring-security-rest/src/test/java/org/baeldung/web/SwaggerLiveTest.java diff --git a/spring-security-rest/src/test/java/org/baeldung/web/TestConfig.java b/spring-security-modules/spring-security-rest/src/test/java/org/baeldung/web/TestConfig.java similarity index 100% rename from spring-security-rest/src/test/java/org/baeldung/web/TestConfig.java rename to spring-security-modules/spring-security-rest/src/test/java/org/baeldung/web/TestConfig.java diff --git a/spring-security-rest/src/test/resources/.gitignore b/spring-security-modules/spring-security-rest/src/test/resources/.gitignore similarity index 100% rename from spring-security-rest/src/test/resources/.gitignore rename to spring-security-modules/spring-security-rest/src/test/resources/.gitignore diff --git a/spring-security-sso/README.md b/spring-security-modules/spring-security-sso/README.md similarity index 100% rename from spring-security-sso/README.md rename to spring-security-modules/spring-security-sso/README.md diff --git a/spring-security-sso/pom.xml b/spring-security-modules/spring-security-sso/pom.xml similarity index 95% rename from spring-security-sso/pom.xml rename to spring-security-modules/spring-security-sso/pom.xml index c921cf1867..3d9c1bf595 100644 --- a/spring-security-sso/pom.xml +++ b/spring-security-modules/spring-security-sso/pom.xml @@ -12,7 +12,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/spring-security-sso/spring-security-sso-auth-server/pom.xml b/spring-security-modules/spring-security-sso/spring-security-sso-auth-server/pom.xml similarity index 100% rename from spring-security-sso/spring-security-sso-auth-server/pom.xml rename to spring-security-modules/spring-security-sso/spring-security-sso-auth-server/pom.xml diff --git a/spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/AuthServerConfig.java b/spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/AuthServerConfig.java similarity index 100% rename from spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/AuthServerConfig.java rename to spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/AuthServerConfig.java diff --git a/spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/AuthorizationServerApplication.java b/spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/AuthorizationServerApplication.java similarity index 100% rename from spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/AuthorizationServerApplication.java rename to spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/AuthorizationServerApplication.java diff --git a/spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/SecurityConfig.java b/spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/SecurityConfig.java similarity index 100% rename from spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/SecurityConfig.java rename to spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/SecurityConfig.java diff --git a/spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/UserController.java b/spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/UserController.java similarity index 100% rename from spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/UserController.java rename to spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/UserController.java diff --git a/spring-security-sso/spring-security-sso-auth-server/src/main/resources/application.properties b/spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/main/resources/application.properties similarity index 100% rename from spring-security-sso/spring-security-sso-auth-server/src/main/resources/application.properties rename to spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/main/resources/application.properties diff --git a/spring-security-sso/spring-security-sso-auth-server/src/main/resources/logback.xml b/spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/main/resources/logback.xml similarity index 100% rename from spring-security-sso/spring-security-sso-auth-server/src/main/resources/logback.xml rename to spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/main/resources/logback.xml diff --git a/spring-security-sso/spring-security-sso-auth-server/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-sso/spring-security-sso-auth-server/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-sso/spring-security-sso-auth-server/src/test/java/org/baeldung/UserInfoEndpointLiveTest.java b/spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/test/java/org/baeldung/UserInfoEndpointLiveTest.java similarity index 100% rename from spring-security-sso/spring-security-sso-auth-server/src/test/java/org/baeldung/UserInfoEndpointLiveTest.java rename to spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/test/java/org/baeldung/UserInfoEndpointLiveTest.java diff --git a/spring-security-sso/spring-security-sso-kerberos/.gitignore b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/.gitignore similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/.gitignore rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/.gitignore diff --git a/spring-security-sso/spring-security-sso-kerberos/README.md b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/README.md similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/README.md rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/README.md diff --git a/spring-security-sso/spring-security-sso-kerberos/pom.xml b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/pom.xml similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/pom.xml rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/pom.xml diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/KerberosClientApp.java b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/KerberosClientApp.java similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/KerberosClientApp.java rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/KerberosClientApp.java diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/SampleClient.java b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/SampleClient.java similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/SampleClient.java rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/SampleClient.java diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/config/AppConfig.java b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/config/AppConfig.java similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/config/AppConfig.java rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/config/AppConfig.java diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/config/KerberosConfig.java b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/config/KerberosConfig.java similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/config/KerberosConfig.java rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/config/KerberosConfig.java diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/kdc/KerberosMiniKdc.java b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/kdc/KerberosMiniKdc.java similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/kdc/KerberosMiniKdc.java rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/kdc/KerberosMiniKdc.java diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/kdc/MiniKdcConfigBuilder.java b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/kdc/MiniKdcConfigBuilder.java similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/kdc/MiniKdcConfigBuilder.java rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/kdc/MiniKdcConfigBuilder.java diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/KerberizedServerApp.java b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/KerberizedServerApp.java similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/KerberizedServerApp.java rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/KerberizedServerApp.java diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/config/MvcConfig.java b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/config/MvcConfig.java similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/config/MvcConfig.java rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/config/MvcConfig.java diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/config/WebSecurityConfig.java b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/config/WebSecurityConfig.java similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/config/WebSecurityConfig.java rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/config/WebSecurityConfig.java diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/controller/SampleController.java b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/controller/SampleController.java similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/controller/SampleController.java rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/controller/SampleController.java diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/service/DummyUserDetailsService.java b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/service/DummyUserDetailsService.java similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/service/DummyUserDetailsService.java rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/service/DummyUserDetailsService.java diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/resources/application.properties b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/resources/application.properties similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/resources/application.properties rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/resources/application.properties diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/resources/minikdc-krb5.conf b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/resources/minikdc-krb5.conf similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/resources/minikdc-krb5.conf rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/resources/minikdc-krb5.conf diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/resources/minikdc.ldiff b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/resources/minikdc.ldiff similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/resources/minikdc.ldiff rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/resources/minikdc.ldiff diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/resources/templates/hello.html b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/resources/templates/hello.html similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/resources/templates/hello.html rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/resources/templates/hello.html diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/resources/templates/home.html b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/resources/templates/home.html similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/resources/templates/home.html rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/resources/templates/home.html diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/resources/templates/login.html b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/resources/templates/login.html similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/resources/templates/login.html rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/resources/templates/login.html diff --git a/spring-security-sso/spring-security-sso-kerberos/src/test/java/kerberos/client/SampleClientManualTest.java b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/test/java/kerberos/client/SampleClientManualTest.java similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/test/java/kerberos/client/SampleClientManualTest.java rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/test/java/kerberos/client/SampleClientManualTest.java diff --git a/spring-security-sso/spring-security-sso-ui-2/pom.xml b/spring-security-modules/spring-security-sso/spring-security-sso-ui-2/pom.xml similarity index 100% rename from spring-security-sso/spring-security-sso-ui-2/pom.xml rename to spring-security-modules/spring-security-sso/spring-security-sso-ui-2/pom.xml diff --git a/spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiApplication.java b/spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiApplication.java similarity index 100% rename from spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiApplication.java rename to spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiApplication.java diff --git a/spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiSecurityConfig.java b/spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiSecurityConfig.java similarity index 100% rename from spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiSecurityConfig.java rename to spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiSecurityConfig.java diff --git a/spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiWebConfig.java b/spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiWebConfig.java similarity index 100% rename from spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiWebConfig.java rename to spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiWebConfig.java diff --git a/spring-security-sso/spring-security-sso-ui-2/src/main/resources/application.yml b/spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/resources/application.yml similarity index 100% rename from spring-security-sso/spring-security-sso-ui-2/src/main/resources/application.yml rename to spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/resources/application.yml diff --git a/spring-security-sso/spring-security-sso-ui-2/src/main/resources/logback.xml b/spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/resources/logback.xml similarity index 100% rename from spring-security-sso/spring-security-sso-ui-2/src/main/resources/logback.xml rename to spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/resources/logback.xml diff --git a/spring-security-sso/spring-security-sso-ui-2/src/main/resources/templates/index.html b/spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/resources/templates/index.html similarity index 100% rename from spring-security-sso/spring-security-sso-ui-2/src/main/resources/templates/index.html rename to spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/resources/templates/index.html diff --git a/spring-security-sso/spring-security-sso-ui-2/src/main/resources/templates/securedPage.html b/spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/resources/templates/securedPage.html similarity index 100% rename from spring-security-sso/spring-security-sso-ui-2/src/main/resources/templates/securedPage.html rename to spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/resources/templates/securedPage.html diff --git a/spring-security-sso/spring-security-sso-ui-2/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-sso/spring-security-sso-ui-2/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-sso/spring-security-sso-ui/pom.xml b/spring-security-modules/spring-security-sso/spring-security-sso-ui/pom.xml similarity index 100% rename from spring-security-sso/spring-security-sso-ui/pom.xml rename to spring-security-modules/spring-security-sso/spring-security-sso-ui/pom.xml diff --git a/spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiApplication.java b/spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiApplication.java similarity index 100% rename from spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiApplication.java rename to spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiApplication.java diff --git a/spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiSecurityConfig.java b/spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiSecurityConfig.java similarity index 100% rename from spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiSecurityConfig.java rename to spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiSecurityConfig.java diff --git a/spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiWebConfig.java b/spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiWebConfig.java similarity index 100% rename from spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiWebConfig.java rename to spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiWebConfig.java diff --git a/spring-security-sso/spring-security-sso-ui/src/main/resources/application.yml b/spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/resources/application.yml similarity index 100% rename from spring-security-sso/spring-security-sso-ui/src/main/resources/application.yml rename to spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/resources/application.yml diff --git a/spring-security-sso/spring-security-sso-ui/src/main/resources/logback.xml b/spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/resources/logback.xml similarity index 100% rename from spring-security-sso/spring-security-sso-ui/src/main/resources/logback.xml rename to spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/resources/logback.xml diff --git a/spring-security-sso/spring-security-sso-ui/src/main/resources/templates/index.html b/spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/resources/templates/index.html similarity index 100% rename from spring-security-sso/spring-security-sso-ui/src/main/resources/templates/index.html rename to spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/resources/templates/index.html diff --git a/spring-security-sso/spring-security-sso-ui/src/main/resources/templates/securedPage.html b/spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/resources/templates/securedPage.html similarity index 100% rename from spring-security-sso/spring-security-sso-ui/src/main/resources/templates/securedPage.html rename to spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/resources/templates/securedPage.html diff --git a/spring-security-sso/spring-security-sso-ui/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-sso/spring-security-sso-ui/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-sso/spring-security-sso-ui/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-sso/spring-security-sso-ui/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-stormpath/README.md b/spring-security-modules/spring-security-stormpath/README.md similarity index 100% rename from spring-security-stormpath/README.md rename to spring-security-modules/spring-security-stormpath/README.md diff --git a/spring-security-stormpath/pom.xml b/spring-security-modules/spring-security-stormpath/pom.xml similarity index 97% rename from spring-security-stormpath/pom.xml rename to spring-security-modules/spring-security-stormpath/pom.xml index 28e8736ca0..81a7c40aef 100644 --- a/spring-security-stormpath/pom.xml +++ b/spring-security-modules/spring-security-stormpath/pom.xml @@ -21,7 +21,7 @@ com.baeldung parent-boot-1 0.0.1-SNAPSHOT - ../parent-boot-1 + ../../parent-boot-1 diff --git a/spring-security-stormpath/src/main/java/com/baeldung/Application.java b/spring-security-modules/spring-security-stormpath/src/main/java/com/baeldung/Application.java similarity index 100% rename from spring-security-stormpath/src/main/java/com/baeldung/Application.java rename to spring-security-modules/spring-security-stormpath/src/main/java/com/baeldung/Application.java diff --git a/spring-security-stormpath/src/main/java/com/baeldung/security/SecurityConfiguration.java b/spring-security-modules/spring-security-stormpath/src/main/java/com/baeldung/security/SecurityConfiguration.java similarity index 100% rename from spring-security-stormpath/src/main/java/com/baeldung/security/SecurityConfiguration.java rename to spring-security-modules/spring-security-stormpath/src/main/java/com/baeldung/security/SecurityConfiguration.java diff --git a/spring-security-stormpath/src/main/resources/application.properties b/spring-security-modules/spring-security-stormpath/src/main/resources/application.properties similarity index 100% rename from spring-security-stormpath/src/main/resources/application.properties rename to spring-security-modules/spring-security-stormpath/src/main/resources/application.properties diff --git a/spring-security-stormpath/src/main/resources/logback.xml b/spring-security-modules/spring-security-stormpath/src/main/resources/logback.xml similarity index 100% rename from spring-security-stormpath/src/main/resources/logback.xml rename to spring-security-modules/spring-security-stormpath/src/main/resources/logback.xml diff --git a/spring-security-thymeleaf/README.MD b/spring-security-modules/spring-security-thymeleaf/README.MD similarity index 100% rename from spring-security-thymeleaf/README.MD rename to spring-security-modules/spring-security-thymeleaf/README.MD diff --git a/spring-security-thymeleaf/pom.xml b/spring-security-modules/spring-security-thymeleaf/pom.xml similarity index 97% rename from spring-security-thymeleaf/pom.xml rename to spring-security-modules/spring-security-thymeleaf/pom.xml index e6decbf0e5..a4ecbaff21 100644 --- a/spring-security-thymeleaf/pom.xml +++ b/spring-security-modules/spring-security-thymeleaf/pom.xml @@ -12,7 +12,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SecurityConfiguration.java b/spring-security-modules/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SecurityConfiguration.java similarity index 97% rename from spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SecurityConfiguration.java rename to spring-security-modules/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SecurityConfiguration.java index 0a4344db4d..f7f8cfb708 100644 --- a/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SecurityConfiguration.java +++ b/spring-security-modules/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SecurityConfiguration.java @@ -1,50 +1,50 @@ -package com.baeldung.springsecuritythymeleaf; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -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; -import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; -import org.springframework.security.web.util.matcher.AntPathRequestMatcher; - -@Configuration -@EnableWebSecurity -public class SecurityConfiguration extends WebSecurityConfigurerAdapter { - - @Override - protected void configure(HttpSecurity http) throws Exception { - http.authorizeRequests() - .anyRequest() - .authenticated() - .and() - .formLogin() - .loginPage("/login") - .permitAll() - .successForwardUrl("/index") - .and() - .logout() - .permitAll() - .logoutRequestMatcher(new AntPathRequestMatcher("/logout")) - .logoutSuccessUrl("/login"); - } - - @Autowired - public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { - auth.inMemoryAuthentication() - .withUser("user") - .password(passwordEncoder().encode("password")) - .roles("USER") - .and() - .withUser("admin") - .password(passwordEncoder().encode("admin")) - .roles("ADMIN"); - } - - @Bean - public BCryptPasswordEncoder passwordEncoder() { - return new BCryptPasswordEncoder(); - } -} +package com.baeldung.springsecuritythymeleaf; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +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; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.web.util.matcher.AntPathRequestMatcher; + +@Configuration +@EnableWebSecurity +public class SecurityConfiguration extends WebSecurityConfigurerAdapter { + + @Override + protected void configure(HttpSecurity http) throws Exception { + http.authorizeRequests() + .anyRequest() + .authenticated() + .and() + .formLogin() + .loginPage("/login") + .permitAll() + .successForwardUrl("/index") + .and() + .logout() + .permitAll() + .logoutRequestMatcher(new AntPathRequestMatcher("/logout")) + .logoutSuccessUrl("/login"); + } + + @Autowired + public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { + auth.inMemoryAuthentication() + .withUser("user") + .password(passwordEncoder().encode("password")) + .roles("USER") + .and() + .withUser("admin") + .password(passwordEncoder().encode("admin")) + .roles("ADMIN"); + } + + @Bean + public BCryptPasswordEncoder passwordEncoder() { + return new BCryptPasswordEncoder(); + } +} diff --git a/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SpringSecurityThymeleafApplication.java b/spring-security-modules/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SpringSecurityThymeleafApplication.java similarity index 100% rename from spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SpringSecurityThymeleafApplication.java rename to spring-security-modules/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SpringSecurityThymeleafApplication.java diff --git a/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/ViewController.java b/spring-security-modules/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/ViewController.java similarity index 95% rename from spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/ViewController.java rename to spring-security-modules/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/ViewController.java index a2337f9db5..bb8f04d965 100644 --- a/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/ViewController.java +++ b/spring-security-modules/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/ViewController.java @@ -1,18 +1,18 @@ -package com.baeldung.springsecuritythymeleaf; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - -@Controller -public class ViewController { - - @RequestMapping("/login") - public String login() { - return "login"; - } - - @RequestMapping({ "/index", "/" }) - public String index() { - return "index"; - } -} +package com.baeldung.springsecuritythymeleaf; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +@Controller +public class ViewController { + + @RequestMapping("/login") + public String login() { + return "login"; + } + + @RequestMapping({ "/index", "/" }) + public String index() { + return "index"; + } +} diff --git a/spring-security-thymeleaf/src/main/resources/application.properties b/spring-security-modules/spring-security-thymeleaf/src/main/resources/application.properties similarity index 100% rename from spring-security-thymeleaf/src/main/resources/application.properties rename to spring-security-modules/spring-security-thymeleaf/src/main/resources/application.properties diff --git a/spring-security-thymeleaf/src/main/resources/logback.xml b/spring-security-modules/spring-security-thymeleaf/src/main/resources/logback.xml similarity index 100% rename from spring-security-thymeleaf/src/main/resources/logback.xml rename to spring-security-modules/spring-security-thymeleaf/src/main/resources/logback.xml diff --git a/spring-security-thymeleaf/src/main/resources/templates/index.html b/spring-security-modules/spring-security-thymeleaf/src/main/resources/templates/index.html similarity index 97% rename from spring-security-thymeleaf/src/main/resources/templates/index.html rename to spring-security-modules/spring-security-thymeleaf/src/main/resources/templates/index.html index 27426ec496..a419655d9e 100644 --- a/spring-security-thymeleaf/src/main/resources/templates/index.html +++ b/spring-security-modules/spring-security-thymeleaf/src/main/resources/templates/index.html @@ -1,18 +1,18 @@ - - - -Welcome to Spring Security Thymeleaf tutorial - - -

Welcome

-

Spring Security Thymeleaf tutorial

-
Text visible to user.
-
Text visible to admin.
-
Text visible only to - authenticated users.
- Authenticated username: -
- Authenticated user roles: -
- + + + +Welcome to Spring Security Thymeleaf tutorial + + +

Welcome

+

Spring Security Thymeleaf tutorial

+
Text visible to user.
+
Text visible to admin.
+
Text visible only to + authenticated users.
+ Authenticated username: +
+ Authenticated user roles: +
+ \ No newline at end of file diff --git a/spring-security-thymeleaf/src/main/resources/templates/login.html b/spring-security-modules/spring-security-thymeleaf/src/main/resources/templates/login.html similarity index 97% rename from spring-security-thymeleaf/src/main/resources/templates/login.html rename to spring-security-modules/spring-security-thymeleaf/src/main/resources/templates/login.html index 0177f7d8e8..f4a32e0911 100644 --- a/spring-security-thymeleaf/src/main/resources/templates/login.html +++ b/spring-security-modules/spring-security-thymeleaf/src/main/resources/templates/login.html @@ -1,15 +1,15 @@ - - - -Custom Login Page - - -

Custom Login Page

-
- : : -
- + + + +Custom Login Page + + +

Custom Login Page

+
+ : : +
+ \ No newline at end of file diff --git a/spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/SpringSecurityThymeleafApplicationIntegrationTest.java b/spring-security-modules/spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/SpringSecurityThymeleafApplicationIntegrationTest.java similarity index 100% rename from spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/SpringSecurityThymeleafApplicationIntegrationTest.java rename to spring-security-modules/spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/SpringSecurityThymeleafApplicationIntegrationTest.java diff --git a/spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/ViewControllerIntegrationTest.java b/spring-security-modules/spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/ViewControllerIntegrationTest.java similarity index 97% rename from spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/ViewControllerIntegrationTest.java rename to spring-security-modules/spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/ViewControllerIntegrationTest.java index d2e7354d2d..c87d1bacc3 100644 --- a/spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/ViewControllerIntegrationTest.java +++ b/spring-security-modules/spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/ViewControllerIntegrationTest.java @@ -1,27 +1,27 @@ -package com.baeldung.springsecuritythymeleaf; - -import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.user; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.view; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.servlet.MockMvc; - -@RunWith(SpringRunner.class) -@WebMvcTest -public class ViewControllerIntegrationTest { - - @Autowired - MockMvc mockMvc; - - @Test - public void givenUser_whenPerformingGet_thenReturnsIndex() throws Exception { - mockMvc.perform(get("/index").with(user("user").password("password"))).andExpect(status().isOk()).andExpect(view().name("index")); - } - -} +package com.baeldung.springsecuritythymeleaf; + +import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.user; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.view; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; + +@RunWith(SpringRunner.class) +@WebMvcTest +public class ViewControllerIntegrationTest { + + @Autowired + MockMvc mockMvc; + + @Test + public void givenUser_whenPerformingGet_thenReturnsIndex() throws Exception { + mockMvc.perform(get("/index").with(user("user").password("password"))).andExpect(status().isOk()).andExpect(view().name("index")); + } + +} diff --git a/spring-security-x509/README.md b/spring-security-modules/spring-security-x509/README.md similarity index 100% rename from spring-security-x509/README.md rename to spring-security-modules/spring-security-x509/README.md diff --git a/spring-security-x509/keystore/Makefile b/spring-security-modules/spring-security-x509/keystore/Makefile similarity index 100% rename from spring-security-x509/keystore/Makefile rename to spring-security-modules/spring-security-x509/keystore/Makefile diff --git a/spring-security-x509/keystore/keystore.jks b/spring-security-modules/spring-security-x509/keystore/keystore.jks similarity index 100% rename from spring-security-x509/keystore/keystore.jks rename to spring-security-modules/spring-security-x509/keystore/keystore.jks diff --git a/spring-security-x509/pom.xml b/spring-security-modules/spring-security-x509/pom.xml similarity index 95% rename from spring-security-x509/pom.xml rename to spring-security-modules/spring-security-x509/pom.xml index 5b44a13bf5..a4ff908eed 100644 --- a/spring-security-x509/pom.xml +++ b/spring-security-modules/spring-security-x509/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-boot-1 0.0.1-SNAPSHOT - ../parent-boot-1 + ../../parent-boot-1 diff --git a/spring-security-x509/spring-security-x509-basic-auth/pom.xml b/spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/pom.xml similarity index 100% rename from spring-security-x509/spring-security-x509-basic-auth/pom.xml rename to spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/pom.xml diff --git a/spring-security-x509/spring-security-x509-basic-auth/src/main/java/com/baeldung/spring/security/x509/UserController.java b/spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/java/com/baeldung/spring/security/x509/UserController.java similarity index 100% rename from spring-security-x509/spring-security-x509-basic-auth/src/main/java/com/baeldung/spring/security/x509/UserController.java rename to spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/java/com/baeldung/spring/security/x509/UserController.java diff --git a/spring-security-x509/spring-security-x509-basic-auth/src/main/java/com/baeldung/spring/security/x509/X509AuthenticationServer.java b/spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/java/com/baeldung/spring/security/x509/X509AuthenticationServer.java similarity index 100% rename from spring-security-x509/spring-security-x509-basic-auth/src/main/java/com/baeldung/spring/security/x509/X509AuthenticationServer.java rename to spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/java/com/baeldung/spring/security/x509/X509AuthenticationServer.java diff --git a/spring-security-x509/spring-security-x509-basic-auth/src/main/resources/application.properties b/spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/resources/application.properties similarity index 100% rename from spring-security-x509/spring-security-x509-basic-auth/src/main/resources/application.properties rename to spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/resources/application.properties diff --git a/spring-security-x509/spring-security-x509-basic-auth/src/main/resources/logback.xml b/spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/resources/logback.xml similarity index 100% rename from spring-security-x509/spring-security-x509-basic-auth/src/main/resources/logback.xml rename to spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/resources/logback.xml diff --git a/spring-security-x509/spring-security-x509-basic-auth/src/main/resources/templates/user.html b/spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/resources/templates/user.html similarity index 100% rename from spring-security-x509/spring-security-x509-basic-auth/src/main/resources/templates/user.html rename to spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/resources/templates/user.html diff --git a/spring-security-x509/spring-security-x509-basic-auth/src/test/java/com/baeldung/spring/security/x509/X509AuthenticationServerIntegrationTest.java b/spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/test/java/com/baeldung/spring/security/x509/X509AuthenticationServerIntegrationTest.java similarity index 100% rename from spring-security-x509/spring-security-x509-basic-auth/src/test/java/com/baeldung/spring/security/x509/X509AuthenticationServerIntegrationTest.java rename to spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/test/java/com/baeldung/spring/security/x509/X509AuthenticationServerIntegrationTest.java diff --git a/spring-security-x509/spring-security-x509-basic-auth/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-x509/spring-security-x509-basic-auth/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-x509/spring-security-x509-client-auth/pom.xml b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/pom.xml similarity index 100% rename from spring-security-x509/spring-security-x509-client-auth/pom.xml rename to spring-security-modules/spring-security-x509/spring-security-x509-client-auth/pom.xml diff --git a/spring-security-x509/spring-security-x509-client-auth/src/main/java/com/baeldung/spring/security/x509/UserController.java b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/java/com/baeldung/spring/security/x509/UserController.java similarity index 100% rename from spring-security-x509/spring-security-x509-client-auth/src/main/java/com/baeldung/spring/security/x509/UserController.java rename to spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/java/com/baeldung/spring/security/x509/UserController.java diff --git a/spring-security-x509/spring-security-x509-client-auth/src/main/java/com/baeldung/spring/security/x509/X509AuthenticationServer.java b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/java/com/baeldung/spring/security/x509/X509AuthenticationServer.java similarity index 100% rename from spring-security-x509/spring-security-x509-client-auth/src/main/java/com/baeldung/spring/security/x509/X509AuthenticationServer.java rename to spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/java/com/baeldung/spring/security/x509/X509AuthenticationServer.java diff --git a/spring-security-x509/spring-security-x509-client-auth/src/main/resources/application.properties b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/resources/application.properties similarity index 100% rename from spring-security-x509/spring-security-x509-client-auth/src/main/resources/application.properties rename to spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/resources/application.properties diff --git a/spring-security-x509/spring-security-x509-client-auth/src/main/resources/keystore.jks b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/resources/keystore.jks similarity index 100% rename from spring-security-x509/spring-security-x509-client-auth/src/main/resources/keystore.jks rename to spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/resources/keystore.jks diff --git a/spring-security-x509/spring-security-x509-client-auth/src/main/resources/logback.xml b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/resources/logback.xml similarity index 100% rename from spring-security-x509/spring-security-x509-client-auth/src/main/resources/logback.xml rename to spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/resources/logback.xml diff --git a/spring-security-x509/spring-security-x509-client-auth/src/main/resources/templates/user.html b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/resources/templates/user.html similarity index 100% rename from spring-security-x509/spring-security-x509-client-auth/src/main/resources/templates/user.html rename to spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/resources/templates/user.html diff --git a/spring-security-x509/spring-security-x509-client-auth/src/test/java/com/baeldung/spring/security/x509/X509AuthenticationServerIntegrationTest.java b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/test/java/com/baeldung/spring/security/x509/X509AuthenticationServerIntegrationTest.java similarity index 100% rename from spring-security-x509/spring-security-x509-client-auth/src/test/java/com/baeldung/spring/security/x509/X509AuthenticationServerIntegrationTest.java rename to spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/test/java/com/baeldung/spring/security/x509/X509AuthenticationServerIntegrationTest.java diff --git a/spring-security-x509/spring-security-x509-client-auth/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-x509/spring-security-x509-client-auth/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/test/java/org/baeldung/SpringContextTest.java diff --git a/testing-modules/junit-4/README.md b/testing-modules/junit-4/README.md index 6cc3981ed4..d19a0a1e47 100644 --- a/testing-modules/junit-4/README.md +++ b/testing-modules/junit-4/README.md @@ -4,4 +4,3 @@ - [Custom JUnit 4 Test Runners](http://www.baeldung.com/junit-4-custom-runners) - [Introduction to JUnitParams](http://www.baeldung.com/junit-params) - [Running JUnit Tests Programmatically, from a Java Application](https://www.baeldung.com/junit-tests-run-programmatically-from-java) -- [Introduction to Lambda Behave](https://www.baeldung.com/lambda-behave)