diff --git a/akka-http/src/test/java/com/baeldung/akkahttp/UserServerUnitTest.java b/akka-http/src/test/java/com/baeldung/akkahttp/UserServerUnitTest.java index 33462d6171..0bb9dc1ef2 100644 --- a/akka-http/src/test/java/com/baeldung/akkahttp/UserServerUnitTest.java +++ b/akka-http/src/test/java/com/baeldung/akkahttp/UserServerUnitTest.java @@ -31,10 +31,10 @@ public class UserServerUnitTest extends JUnitRouteTest { .assertStatusCode(404); appRoute.run(HttpRequest.DELETE("/users/1")) - .assertStatusCode(200); + .assertStatusCode(405); appRoute.run(HttpRequest.DELETE("/users/42")) - .assertStatusCode(200); + .assertStatusCode(405); appRoute.run(HttpRequest.POST("/users") .withEntity(HttpEntities.create(ContentTypes.APPLICATION_JSON, zaphod()))) diff --git a/algorithms-miscellaneous-2/README.md b/algorithms-miscellaneous-2/README.md index 7560fc4fe7..26737b61f0 100644 --- a/algorithms-miscellaneous-2/README.md +++ b/algorithms-miscellaneous-2/README.md @@ -13,4 +13,5 @@ This module contains articles about algorithms. Some classes of algorithms, e.g. - [Create a Sudoku Solver in Java](https://www.baeldung.com/java-sudoku) - [Displaying Money Amounts in Words](https://www.baeldung.com/java-money-into-words) - [A Collaborative Filtering Recommendation System in Java](https://www.baeldung.com/java-collaborative-filtering-recommendations) +- [Implementing A* Pathfinding in Java](https://www.baeldung.com/java-a-star-pathfinding) - More articles: [[<-- prev]](/../algorithms-miscellaneous-1) [[next -->]](/../algorithms-miscellaneous-3) diff --git a/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/slope_one/SlopeOne.java b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/slope_one/SlopeOne.java index d5eea279de..bfcafdaef2 100644 --- a/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/slope_one/SlopeOne.java +++ b/algorithms-miscellaneous-2/src/main/java/com/baeldung/algorithms/slope_one/SlopeOne.java @@ -98,7 +98,7 @@ public class SlopeOne { for (Item j : InputData.items) { if (e.getValue().containsKey(j)) { clean.put(j, e.getValue().get(j)); - } else { + } else if (!clean.containsKey(j)) { clean.put(j, -1.0); } } diff --git a/algorithms-miscellaneous-5/README.md b/algorithms-miscellaneous-5/README.md index 3c49b5f01c..301d3ee8c5 100644 --- a/algorithms-miscellaneous-5/README.md +++ b/algorithms-miscellaneous-5/README.md @@ -12,4 +12,8 @@ This module contains articles about algorithms. Some classes of algorithms, e.g. - [How to Determine if a Binary Tree is Balanced](https://www.baeldung.com/java-balanced-binary-tree) - [The Caesar Cipher in Java](https://www.baeldung.com/java-caesar-cipher) - [Overview of Combinatorial Problems in Java](https://www.baeldung.com/java-combinatorial-algorithms) +- [Prim’s Algorithm](https://www.baeldung.com/java-prim-algorithm) +- [Maximum Subarray Problem](https://www.baeldung.com/java-maximum-subarray) +- [How to Merge Two Sorted Arrays](https://www.baeldung.com/java-merge-sorted-arrays) +- [Median of Stream of Integers using Heap](https://www.baeldung.com/java-stream-integers-median-using-heap) - More articles: [[<-- prev]](/../algorithms-miscellaneous-4) diff --git a/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/balancedbinarytree/AVLTree.java b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/balancedbinarytree/AVLTree.java new file mode 100644 index 0000000000..a0575c8be1 --- /dev/null +++ b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/balancedbinarytree/AVLTree.java @@ -0,0 +1,141 @@ +package com.baeldung.algorithms.balancedbinarytree; + +public class AVLTree { + + public class Node { + int key; + int height; + Node left; + Node right; + + Node(int key) { + this.key = key; + } + } + + private Node root; + + public Node find(int key) { + Node current = root; + while (current != null) { + if (current.key == key) { + break; + } + current = current.key < key ? current.right : current.left; + } + return current; + } + + public void insert(int key) { + root = insert(root, key); + } + + public void delete(int key) { + root = delete(root, key); + } + + public Node getRoot() { + return root; + } + + public int height() { + return root == null ? -1 : root.height; + } + + private Node insert(Node node, int key) { + if (node == null) { + return new Node(key); + } else if (node.key > key) { + node.left = insert(node.left, key); + } else if (node.key < key) { + node.right = insert(node.right, key); + } else { + throw new RuntimeException("duplicate Key!"); + } + return rebalance(node); + } + + private Node delete(Node node, int key) { + if (node == null) { + return node; + } else if (node.key > key) { + node.left = delete(node.left, key); + } else if (node.key < key) { + node.right = delete(node.right, key); + } else { + if (node.left == null || node.right == null) { + node = (node.left == null) ? node.right : node.left; + } else { + Node mostLeftChild = mostLeftChild(node.right); + node.key = mostLeftChild.key; + node.right = delete(node.right, node.key); + } + } + if (node != null) { + node = rebalance(node); + } + return node; + } + + private Node mostLeftChild(Node node) { + Node current = node; + /* loop down to find the leftmost leaf */ + while (current.left != null) { + current = current.left; + } + return current; + } + + private Node rebalance(Node z) { + updateHeight(z); + int balance = getBalance(z); + if (balance > 1) { + if (height(z.right.right) > height(z.right.left)) { + z = rotateLeft(z); + } else { + z.right = rotateRight(z.right); + z = rotateLeft(z); + } + } else if (balance < -1) { + if (height(z.left.left) > height(z.left.right)) { + z = rotateRight(z); + } else { + z.left = rotateLeft(z.left); + z = rotateRight(z); + } + } + return z; + } + + private Node rotateRight(Node y) { + Node x = y.left; + Node z = x.right; + x.right = y; + y.left = z; + updateHeight(y); + updateHeight(x); + return x; + } + + private Node rotateLeft(Node y) { + Node x = y.right; + Node z = x.left; + x.left = y; + y.right = z; + updateHeight(y); + updateHeight(x); + return x; + } + + private void updateHeight(Node n) { + n.height = 1 + Math.max(height(n.left), height(n.right)); + } + + private int height(Node n) { + return n == null ? -1 : n.height; + } + + public int getBalance(Node n) { + return (n == null) ? 0 : height(n.right) - height(n.left); + } +} diff --git a/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/balancedbrackets/BalancedBracketsUsingDeque.java b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/balancedbrackets/BalancedBracketsUsingDeque.java new file mode 100644 index 0000000000..4c220b4047 --- /dev/null +++ b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/balancedbrackets/BalancedBracketsUsingDeque.java @@ -0,0 +1,36 @@ +package com.baeldung.algorithms.balancedbrackets; + +import java.util.Deque; +import java.util.LinkedList; + +public class BalancedBracketsUsingDeque { + + public boolean isBalanced(String str) { + if (null == str || ((str.length() % 2) != 0)) { + return false; + } else { + char[] ch = str.toCharArray(); + for (char c : ch) { + if (!(c == '{' || c == '[' || c == '(' || c == '}' || c == ']' || c == ')')) { + return false; + } + + } + } + + Deque deque = new LinkedList<>(); + for (char ch : str.toCharArray()) { + if (ch == '{' || ch == '[' || ch == '(') { + deque.addFirst(ch); + } else { + if (!deque.isEmpty() && ((deque.peekFirst() == '{' && ch == '}') || (deque.peekFirst() == '[' && ch == ']') || (deque.peekFirst() == '(' && ch == ')'))) { + deque.removeFirst(); + } else { + return false; + } + } + } + + return true; + } +} \ No newline at end of file diff --git a/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/balancedbrackets/BalancedBracketsUsingString.java b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/balancedbrackets/BalancedBracketsUsingString.java new file mode 100644 index 0000000000..0418efbe79 --- /dev/null +++ b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/balancedbrackets/BalancedBracketsUsingString.java @@ -0,0 +1,27 @@ +package com.baeldung.algorithms.balancedbrackets; + +public class BalancedBracketsUsingString { + + public boolean isBalanced(String str) { + if (null == str || ((str.length() % 2) != 0)) { + return false; + } else { + char[] ch = str.toCharArray(); + for (char c : ch) { + if (!(c == '{' || c == '[' || c == '(' || c == '}' || c == ']' || c == ')')) { + return false; + } + + } + } + + while (str.contains("()") || str.contains("[]") || str.contains("{}")) { + str = str.replaceAll("\\(\\)", "") + .replaceAll("\\[\\]", "") + .replaceAll("\\{\\}", ""); + } + return (str.length() == 0); + + } + +} \ No newline at end of file diff --git a/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/balancedbinarytree/AVLTreeUnitTest.java b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/balancedbinarytree/AVLTreeUnitTest.java new file mode 100644 index 0000000000..ab001b6696 --- /dev/null +++ b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/balancedbinarytree/AVLTreeUnitTest.java @@ -0,0 +1,83 @@ +package com.baeldung.algorithms.balancedbinarytree; + +import org.junit.Assert; +import org.junit.Test; + +public class AVLTreeUnitTest { + + @Test + public void givenEmptyTree_whenHeightCalled_shouldReturnMinus1() { + AVLTree tree = new AVLTree(); + Assert.assertEquals(-1, tree.height()); + } + + @Test + public void givenEmptyTree_whenInsertCalled_heightShouldBeZero() { + AVLTree tree = new AVLTree(); + tree.insert(1); + Assert.assertEquals(0, tree.height()); + } + + @Test + public void givenEmptyTree_whenInsertCalled_treeShouldBeAvl() { + AVLTree tree = new AVLTree(); + tree.insert(1); + Assert.assertTrue(isAVL(tree)); + } + + @Test + public void givenSampleTree_whenInsertCalled_treeShouldBeAvl() { + AVLTree tree = getSampleAVLTree(); + int newKey = 11; + tree.insert(newKey); + Assert.assertTrue(isAVL(tree)); + } + + @Test + public void givenSampleTree_whenFindExistingKeyCalled_shouldReturnMatchedNode() { + AVLTree tree = getSampleAVLTree(); + int existingKey = 2; + AVLTree.Node result = tree.find(existingKey); + Assert.assertEquals(result.key, existingKey); + } + + @Test + public void givenSampleTree_whenFindNotExistingKeyCalled_shouldReturnNull() { + AVLTree tree = getSampleAVLTree(); + int notExistingKey = 11; + AVLTree.Node result = tree.find(notExistingKey); + Assert.assertNull(result); + } + + @Test + public void givenEmptyTree_whenDeleteCalled_treeShouldBeAvl() { + AVLTree tree = new AVLTree(); + tree.delete(1); + Assert.assertTrue(isAVL(tree)); + } + + @Test + public void givenSampleTree_whenDeleteCalled_treeShouldBeAvl() { + AVLTree tree = getSampleAVLTree(); + tree.delete(1); + Assert.assertTrue(isAVL(tree, tree.getRoot())); + } + + private boolean isAVL(AVLTree tree) { + return isAVL(tree, tree.getRoot()); + } + + private boolean isAVL(AVLTree tree, AVLTree.Node node) { + if ( node == null ) + return true; + int balance = tree.getBalance(node); + return (balance <= 1 && balance >= -1) && isAVL(tree, node.left) && isAVL(tree, node.right); + } + + private AVLTree getSampleAVLTree() { + AVLTree avlTree = new AVLTree(); + for (int i = 0; i < 10; i++) + avlTree.insert(i); + return avlTree; + } +} diff --git a/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/balancedbrackets/BalancedBracketsUsingDequeUnitTest.java b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/balancedbrackets/BalancedBracketsUsingDequeUnitTest.java new file mode 100644 index 0000000000..964c1ce11a --- /dev/null +++ b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/balancedbrackets/BalancedBracketsUsingDequeUnitTest.java @@ -0,0 +1,76 @@ +package com.baeldung.algorithms.balancedbrackets; + +import org.junit.Before; +import org.junit.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +public class BalancedBracketsUsingDequeUnitTest { + private BalancedBracketsUsingDeque balancedBracketsUsingDeque; + + @Before + public void setup() { + balancedBracketsUsingDeque = new BalancedBracketsUsingDeque(); + } + + @Test + public void givenNullInput_whenCheckingForBalance_shouldReturnFalse() { + boolean result = balancedBracketsUsingDeque.isBalanced(null); + assertThat(result).isFalse(); + } + + @Test + public void givenEmptyString_whenCheckingForBalance_shouldReturnTrue() { + boolean result = balancedBracketsUsingDeque.isBalanced(""); + assertThat(result).isTrue(); + } + + @Test + public void givenInvalidCharacterString_whenCheckingForBalance_shouldReturnFalse() { + boolean result = balancedBracketsUsingDeque.isBalanced("abc[](){}"); + assertThat(result).isFalse(); + } + + @Test + public void givenOddLengthString_whenCheckingForBalance_shouldReturnFalse() { + boolean result = balancedBracketsUsingDeque.isBalanced("{{[]()}}}"); + assertThat(result).isFalse(); + } + + @Test + public void givenEvenLengthString_whenCheckingForBalance_shouldReturnFalse() { + boolean result = balancedBracketsUsingDeque.isBalanced("{{[]()}}}}"); + assertThat(result).isFalse(); + } + + @Test + public void givenEvenLengthUnbalancedString_whenCheckingForBalance_shouldReturnFalse() { + boolean result = balancedBracketsUsingDeque.isBalanced("{[(])}"); + assertThat(result).isFalse(); + } + + @Test + public void givenEvenLengthBalancedString_whenCheckingForBalance_shouldReturnTrue() { + boolean result = balancedBracketsUsingDeque.isBalanced("{[()]}"); + assertThat(result).isTrue(); + } + + @Test + public void givenBalancedString_whenCheckingForBalance_shouldReturnTrue() { + boolean result = balancedBracketsUsingDeque.isBalanced("{{[[(())]]}}"); + assertThat(result).isTrue(); + } + + @Test + public void givenAnotherBalancedString_whenCheckingForBalance_shouldReturnTrue() { + boolean result = balancedBracketsUsingDeque.isBalanced("{{([])}}"); + assertThat(result).isTrue(); + } + + @Test + public void givenUnBalancedString_whenCheckingForBalance_shouldReturnFalse() { + boolean result = balancedBracketsUsingDeque.isBalanced("{{)[](}}"); + assertThat(result).isFalse(); + } + +} \ No newline at end of file diff --git a/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/balancedbrackets/BalancedBracketsUsingStringUnitTest.java b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/balancedbrackets/BalancedBracketsUsingStringUnitTest.java new file mode 100644 index 0000000000..69ce42b0f1 --- /dev/null +++ b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/balancedbrackets/BalancedBracketsUsingStringUnitTest.java @@ -0,0 +1,76 @@ +package com.baeldung.algorithms.balancedbrackets; + +import org.junit.Before; +import org.junit.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +public class BalancedBracketsUsingStringUnitTest { + private BalancedBracketsUsingString balancedBracketsUsingString; + + @Before + public void setup() { + balancedBracketsUsingString = new BalancedBracketsUsingString(); + } + + @Test + public void givenNullInput_whenCheckingForBalance_shouldReturnFalse() { + boolean result = balancedBracketsUsingString.isBalanced(null); + assertThat(result).isFalse(); + } + + @Test + public void givenEmptyString_whenCheckingForBalance_shouldReturnTrue() { + boolean result = balancedBracketsUsingString.isBalanced(""); + assertThat(result).isTrue(); + } + + @Test + public void givenInvalidCharacterString_whenCheckingForBalance_shouldReturnFalse() { + boolean result = balancedBracketsUsingString.isBalanced("abc[](){}"); + assertThat(result).isFalse(); + } + + @Test + public void givenOddLengthString_whenCheckingForBalance_shouldReturnFalse() { + boolean result = balancedBracketsUsingString.isBalanced("{{[]()}}}"); + assertThat(result).isFalse(); + } + + @Test + public void givenEvenLengthString_whenCheckingForBalance_shouldReturnFalse() { + boolean result = balancedBracketsUsingString.isBalanced("{{[]()}}}}"); + assertThat(result).isFalse(); + } + + @Test + public void givenEvenLengthUnbalancedString_whenCheckingForBalance_shouldReturnFalse() { + boolean result = balancedBracketsUsingString.isBalanced("{[(])}"); + assertThat(result).isFalse(); + } + + @Test + public void givenEvenLengthBalancedString_whenCheckingForBalance_shouldReturnTrue() { + boolean result = balancedBracketsUsingString.isBalanced("{[()]}"); + assertThat(result).isTrue(); + } + + @Test + public void givenBalancedString_whenCheckingForBalance_shouldReturnTrue() { + boolean result = balancedBracketsUsingString.isBalanced("{{[[(())]]}}"); + assertThat(result).isTrue(); + } + + @Test + public void givenAnotherBalancedString_whenCheckingForBalance_shouldReturnTrue() { + boolean result = balancedBracketsUsingString.isBalanced("{{([])}}"); + assertThat(result).isTrue(); + } + + @Test + public void givenUnBalancedString_whenCheckingForBalance_shouldReturnFalse() { + boolean result = balancedBracketsUsingString.isBalanced("{{)[](}}"); + assertThat(result).isFalse(); + } + +} \ No newline at end of file diff --git a/apache-poi/src/test/java/com/baeldung/poi/excel/ExcelCellMergerUnitTest.java b/apache-poi/src/test/java/com/baeldung/poi/excel/ExcelCellMergerUnitTest.java new file mode 100644 index 0000000000..f6af2b8576 --- /dev/null +++ b/apache-poi/src/test/java/com/baeldung/poi/excel/ExcelCellMergerUnitTest.java @@ -0,0 +1,53 @@ +package com.baeldung.poi.excel; + +import static org.junit.Assert.assertEquals; + +import java.io.IOException; +import java.net.URISyntaxException; +import java.nio.file.Paths; + +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.util.CellRangeAddress; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.junit.Before; +import org.junit.Test; + +public class ExcelCellMergerUnitTest { + private static final String FILE_NAME = "ExcelCellFormatterTest.xlsx"; + private String fileLocation; + + @Before + public void setup() throws IOException, URISyntaxException { + fileLocation = Paths.get(ClassLoader.getSystemResource(FILE_NAME).toURI()).toString(); + } + + @Test + public void givenCellIndex_whenAddMergeRegion_thenMergeRegionCreated() throws IOException { + Workbook workbook = new XSSFWorkbook(fileLocation); + Sheet sheet = workbook.getSheetAt(0); + + assertEquals(0, sheet.getNumMergedRegions()); + int firstRow = 0; + int lastRow = 0; + int firstCol = 0; + int lastCol = 2; + sheet.addMergedRegion(new CellRangeAddress(firstRow, lastRow, firstCol, lastCol)); + assertEquals(1, sheet.getNumMergedRegions()); + + workbook.close(); + } + + @Test + public void givenCellRefString_whenAddMergeRegion_thenMergeRegionCreated() throws IOException { + Workbook workbook = new XSSFWorkbook(fileLocation); + Sheet sheet = workbook.getSheetAt(0); + + assertEquals(0, sheet.getNumMergedRegions()); + sheet.addMergedRegion(CellRangeAddress.valueOf("A1:C1")); + assertEquals(1, sheet.getNumMergedRegions()); + + workbook.close(); + } + +} \ No newline at end of file diff --git a/apache-spark/README.md b/apache-spark/README.md index 52313d66bf..c60b556d51 100644 --- a/apache-spark/README.md +++ b/apache-spark/README.md @@ -7,4 +7,4 @@ This module contains articles about Apache Spark - [Introduction to Apache Spark](https://www.baeldung.com/apache-spark) - [Building a Data Pipeline with Kafka, Spark Streaming and Cassandra](https://www.baeldung.com/kafka-spark-data-pipeline) - [Machine Learning with Spark MLlib](https://www.baeldung.com/spark-mlib-machine-learning) - +- [Introduction to Spark Graph Processing with GraphFrames](https://www.baeldung.com/spark-graph-graphframes) diff --git a/apache-tapestry/README.md b/apache-tapestry/README.md new file mode 100644 index 0000000000..e41345bada --- /dev/null +++ b/apache-tapestry/README.md @@ -0,0 +1,3 @@ +### Relevant Articles + +- [Intro to Apache Tapestry](https://www.baeldung.com/apache-tapestry) diff --git a/aws-reactive/README.md b/aws-reactive/README.md new file mode 100644 index 0000000000..1abf987b52 --- /dev/null +++ b/aws-reactive/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [AWS S3 with Java – Reactive Support](https://www.baeldung.com/java-aws-s3-reactive) diff --git a/core-groovy-2/pom.xml b/core-groovy-2/pom.xml index 752b6945b3..1b26182ef4 100644 --- a/core-groovy-2/pom.xml +++ b/core-groovy-2/pom.xml @@ -77,7 +77,7 @@ org.codehaus.groovy groovy-eclipse-compiler - 3.3.0-01 + ${groovy.compiler.version} org.codehaus.groovy diff --git a/core-groovy-2/src/test/groovy/com/baeldung/category/CategoryUnitTest.groovy b/core-groovy-2/src/test/groovy/com/baeldung/category/CategoryUnitTest.groovy index 5ba7a2347c..a1f67b1e2e 100644 --- a/core-groovy-2/src/test/groovy/com/baeldung/category/CategoryUnitTest.groovy +++ b/core-groovy-2/src/test/groovy/com/baeldung/category/CategoryUnitTest.groovy @@ -28,17 +28,16 @@ class CategoryUnitTest extends GroovyTestCase { } } -// http://team.baeldung.com/browse/BAEL-20687 -// void test_whenUsingTimeCategory_thenOperationOnNumber() { -// SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy") -// use (TimeCategory) { -// assert sdf.format(5.days.from.now) == sdf.format(new Date() + 5.days) -// -// sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss") -// assert sdf.format(10.minutes.from.now) == sdf.format(new Date() + 10.minutes) -// assert sdf.format(2.hours.ago) == sdf.format(new Date() - 2.hours) -// } -// } + void test_whenUsingTimeCategory_thenOperationOnNumber() { + SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy") + use (TimeCategory) { + assert sdf.format(5.days.from.now) == sdf.format(new Date() + 5.days) + + sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss") + assert sdf.format(10.minutes.from.now) == sdf.format(new Date() + 10.minutes) + assert sdf.format(2.hours.ago) == sdf.format(new Date() - 2.hours) + } + } void test_whenUsingDOMCategory_thenOperationOnXML() { diff --git a/core-groovy-2/src/test/groovy/com/baeldung/webservice/WebserviceUnitTest.groovy b/core-groovy-2/src/test/groovy/com/baeldung/webservice/WebserviceUnitTest.groovy index 144d5720c8..b8417b8ac1 100644 --- a/core-groovy-2/src/test/groovy/com/baeldung/webservice/WebserviceUnitTest.groovy +++ b/core-groovy-2/src/test/groovy/com/baeldung/webservice/WebserviceUnitTest.groovy @@ -75,7 +75,6 @@ class WebserviceManualTest extends GroovyTestCase { assert stories.size() == 5 } - /* see BAEL-3753 void test_whenConsumingSoap_thenReceiveResponse() { def url = "http://www.dataaccess.com/webservicesserver/numberconversion.wso" def soapClient = new SOAPClient(url) @@ -90,7 +89,6 @@ class WebserviceManualTest extends GroovyTestCase { def words = response.NumberToWordsResponse assert words == "one thousand two hundred and thirty four " } - */ void test_whenConsumingRestGet_thenReceiveResponse() { def path = "/get" diff --git a/core-groovy/src/test/groovy/com/baeldung/file/ReadFileUnitTest.groovy b/core-groovy/src/test/groovy/com/baeldung/file/ReadFileUnitTest.groovy index b969f0d1ab..da1dfc10ba 100644 --- a/core-groovy/src/test/groovy/com/baeldung/file/ReadFileUnitTest.groovy +++ b/core-groovy/src/test/groovy/com/baeldung/file/ReadFileUnitTest.groovy @@ -33,7 +33,6 @@ class ReadFileUnitTest extends Specification { assert lines.size(), 3 } - @Ignore def 'Should return file content in string using ReadFile.readFileString given filePath' () { given: def filePath = "src/main/resources/fileContent.txt" diff --git a/core-java-modules/core-java-11/README.md b/core-java-modules/core-java-11/README.md index 7ca81e901a..70e2e66737 100644 --- a/core-java-modules/core-java-11/README.md +++ b/core-java-modules/core-java-11/README.md @@ -13,3 +13,4 @@ This module contains articles about Java 11 core features - [Guide to jlink](https://www.baeldung.com/jlink) - [Negate a Predicate Method Reference with Java 11](https://www.baeldung.com/java-negate-predicate-method-reference) - [Benchmark JDK Collections vs Eclipse Collections](https://www.baeldung.com/jdk-collections-vs-eclipse-collections) +- [Pre-compile Regex Patterns Into Pattern Objects](https://www.baeldung.com/java-regex-pre-compile) diff --git a/core-java-modules/core-java-11/pom.xml b/core-java-modules/core-java-11/pom.xml index 32bc68fa66..2dfc72db09 100644 --- a/core-java-modules/core-java-11/pom.xml +++ b/core-java-modules/core-java-11/pom.xml @@ -65,7 +65,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.2.1 + ${shade.plugin.version} package @@ -109,6 +109,7 @@ benchmarks 1.22 10.0.0 + 10.0.0 diff --git a/core-java-modules/core-java-13/README.md b/core-java-modules/core-java-13/README.md new file mode 100644 index 0000000000..c339520a19 --- /dev/null +++ b/core-java-modules/core-java-13/README.md @@ -0,0 +1,3 @@ +### Relevant articles: + +- [Java Switch Statement](https://www.baeldung.com/java-switch) diff --git a/core-java-modules/core-java-14/.mvn/jvm.config b/core-java-modules/core-java-14/.mvn/jvm.config new file mode 100644 index 0000000000..50f549be0a --- /dev/null +++ b/core-java-modules/core-java-14/.mvn/jvm.config @@ -0,0 +1 @@ +--enable-preview \ No newline at end of file diff --git a/core-java-modules/core-java-14/README.md b/core-java-modules/core-java-14/README.md new file mode 100644 index 0000000000..0648d087be --- /dev/null +++ b/core-java-modules/core-java-14/README.md @@ -0,0 +1,7 @@ +## Core Java 14 + +This module contains articles about Java 14. + +### Relevant articles + +- [Guide to the @Serial Annotation in Java 14](https://www.baeldung.com/java-14-serial-annotation) diff --git a/core-java-modules/core-java-14/pom.xml b/core-java-modules/core-java-14/pom.xml index b985ada5e6..4f89e87d02 100644 --- a/core-java-modules/core-java-14/pom.xml +++ b/core-java-modules/core-java-14/pom.xml @@ -1,53 +1,66 @@ - 4.0.0 - com.baeldung - core-java-14 - 1.0.0-SNAPSHOT - core-java-14 - jar - http://maven.apache.org + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + core-java-14 + core-java-14 + jar + http://maven.apache.org - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - ../../ - + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + ../../ + + + + org.assertj + assertj-core + ${assertj.version} + test + + + org.junit.jupiter + junit-jupiter-engine + ${junit-jupiter.version} + test + + + org.junit.jupiter + junit-jupiter-api + ${junit-jupiter.version} + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${maven.compiler.release} + --enable-preview + + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.plugin.version} + + --enable-preview + + + + - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - ${maven.compiler.source.version} - ${maven.compiler.target.version} - - - --enable-preview - - - - - - org.apache.maven.plugins - maven-surefire-plugin - ${surefire.plugin.version} - - --enable-preview - - - - - - - 14 - 14 + + 14 + 3.6.1 + 3.8.1 3.0.0-M3 - + \ No newline at end of file diff --git a/core-java-modules/core-java-14/src/main/java/com/baeldung/java14/textblocks/TextBlocks13.java b/core-java-modules/core-java-14/src/main/java/com/baeldung/java14/textblocks/TextBlocks13.java new file mode 100644 index 0000000000..58d4cf44f3 --- /dev/null +++ b/core-java-modules/core-java-14/src/main/java/com/baeldung/java14/textblocks/TextBlocks13.java @@ -0,0 +1,46 @@ +package com.baeldung.java14.textblocks; + +public class TextBlocks13 { + public String getBlockOfHtml() { + return """ + + + + example text + + """; + } + + public String getNonStandardIndent() { + return """ + Indent + """; + } + + public String getQuery() { + return """ + select "id", "user" + from "table" + """; + } + + public String getTextWithCarriageReturns() { + return """ + separated with\r + carriage returns"""; + } + + public String getTextWithEscapes() { + return """ + fun with\n + whitespace\t\r + and other escapes \""" + """; + } + + public String getFormattedText(String parameter) { + return """ + Some parameter: %s + """.formatted(parameter); + } +} diff --git a/core-java-modules/core-java-14/src/main/java/com/baeldung/java14/textblocks/TextBlocks14.java b/core-java-modules/core-java-14/src/main/java/com/baeldung/java14/textblocks/TextBlocks14.java new file mode 100644 index 0000000000..90fc15e884 --- /dev/null +++ b/core-java-modules/core-java-14/src/main/java/com/baeldung/java14/textblocks/TextBlocks14.java @@ -0,0 +1,16 @@ +package com.baeldung.java14.textblocks; + +public class TextBlocks14 { + public String getIgnoredNewLines() { + return """ + This is a long test which looks to \ + have a newline but actually does not"""; + } + + public String getEscapedSpaces() { + return """ + line 1 + line 2 \s + """; + } +} diff --git a/core-java-modules/core-java-14/src/main/java/com/baeldung/serial/MySerialClass.java b/core-java-modules/core-java-14/src/main/java/com/baeldung/serial/MySerialClass.java index 6a013d7b59..b28e53bdaa 100644 --- a/core-java-modules/core-java-14/src/main/java/com/baeldung/serial/MySerialClass.java +++ b/core-java-modules/core-java-14/src/main/java/com/baeldung/serial/MySerialClass.java @@ -10,41 +10,41 @@ import java.io.Serializable; /** * Class showcasing the usage of the Java 14 @Serial annotation. - * + * * @author Donato Rimenti */ public class MySerialClass implements Serializable { - - @Serial - private static final ObjectStreamField[] serialPersistentFields = null; - - @Serial - private static final long serialVersionUID = 1; - @Serial - private void writeObject(ObjectOutputStream stream) throws IOException { - // ... - } + @Serial + private static final ObjectStreamField[] serialPersistentFields = null; - @Serial - private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { - // ... - } + @Serial + private static final long serialVersionUID = 1; - @Serial - private void readObjectNoData() throws ObjectStreamException { - // ... - } + @Serial + private void writeObject(ObjectOutputStream stream) throws IOException { + // ... + } - @Serial - private Object writeReplace() throws ObjectStreamException { - // ... - return null; - } + @Serial + private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { + // ... + } - @Serial - private Object readResolve() throws ObjectStreamException { - // ... - return null; - } + @Serial + private void readObjectNoData() throws ObjectStreamException { + // ... + } + + @Serial + private Object writeReplace() throws ObjectStreamException { + // ... + return null; + } + + @Serial + private Object readResolve() throws ObjectStreamException { + // ... + return null; + } } \ No newline at end of file diff --git a/core-java-modules/core-java-14/src/test/java/com/baeldung/java14/textblocks/TextBlocks13UnitTest.java b/core-java-modules/core-java-14/src/test/java/com/baeldung/java14/textblocks/TextBlocks13UnitTest.java new file mode 100644 index 0000000000..f5fef9be57 --- /dev/null +++ b/core-java-modules/core-java-14/src/test/java/com/baeldung/java14/textblocks/TextBlocks13UnitTest.java @@ -0,0 +1,58 @@ +package com.baeldung.java14.textblocks; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.junit.jupiter.api.Test; + +class TextBlocks13UnitTest { + private TextBlocks13 subject = new TextBlocks13(); + + @Test + void givenAnOldStyleMultilineString_whenComparing_thenEqualsTextBlock() { + String expected = "\n" + + "\n" + + " \n" + + " example text\n" + + " \n" + + ""; + assertThat(subject.getBlockOfHtml()).isEqualTo(expected); + } + + @Test + void givenAnOldStyleString_whenComparing_thenEqualsTextBlock() { + String expected = "\n\n \n example text\n \n"; + assertThat(subject.getBlockOfHtml()).isEqualTo(expected); + } + + @Test + void givenAnIndentedString_thenMatchesIndentedOldStyle() { + assertThat(subject.getNonStandardIndent()).isEqualTo(" Indent\n"); + } + + @Test + void givenAMultilineQuery_thenItCanContainUnescapedQuotes() { + assertThat(subject.getQuery()).contains("select \"id\", \"user\""); + } + + @Test + void givenAMultilineQuery_thenItEndWithANewline() { + assertThat(subject.getQuery()).endsWith("\n"); + } + + @Test + void givenATextWithCarriageReturns_thenItContainsBoth() { + assertThat(subject.getTextWithCarriageReturns()).isEqualTo("separated with\r\ncarriage returns"); + } + + @Test + void givenAStringWithEscapedWhitespace_thenItAppearsInTheResultingString() { + assertThat(subject.getTextWithEscapes()).contains("fun with\n\n") + .contains("whitespace\t\r\n") + .contains("and other escapes \"\"\""); + } + + @Test + void givenAFormattedString_thenTheParameterIsReplaced() { + assertThat(subject.getFormattedText("parameter")).contains("Some parameter: parameter"); + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-14/src/test/java/com/baeldung/java14/textblocks/TextBlocks14UnitTest.java b/core-java-modules/core-java-14/src/test/java/com/baeldung/java14/textblocks/TextBlocks14UnitTest.java new file mode 100644 index 0000000000..fe671e8638 --- /dev/null +++ b/core-java-modules/core-java-14/src/test/java/com/baeldung/java14/textblocks/TextBlocks14UnitTest.java @@ -0,0 +1,21 @@ +package com.baeldung.java14.textblocks; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.junit.jupiter.api.Test; + +class TextBlocks14UnitTest { + private TextBlocks14 subject = new TextBlocks14(); + + @Test + void givenAStringWithEscapedNewLines_thenTheResultHasNoNewLines() { + String expected = "This is a long test which looks to have a newline but actually does not"; + assertThat(subject.getIgnoredNewLines()).isEqualTo(expected); + } + + @Test + void givenAStringWithEscapesSpaces_thenTheResultHasLinesEndingWithSpaces() { + String expected = "line 1\nline 2 \n"; + assertThat(subject.getEscapedSpaces()).isEqualTo(expected); + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-8/pom.xml b/core-java-modules/core-java-8/pom.xml index c2c84a5407..889c30b76e 100644 --- a/core-java-modules/core-java-8/pom.xml +++ b/core-java-modules/core-java-8/pom.xml @@ -61,7 +61,7 @@ spring-boot - org.baeldung.executable.ExecutableMavenJar + com.baeldung.executable.ExecutableMavenJar diff --git a/core-java-modules/core-java-9/README.md b/core-java-modules/core-java-9/README.md index e2bea5f7e2..bfd426b9c1 100644 --- a/core-java-modules/core-java-9/README.md +++ b/core-java-modules/core-java-9/README.md @@ -9,6 +9,7 @@ This module contains articles about Java 9 core features - [Iterate Through a Range of Dates in Java](https://www.baeldung.com/java-iterate-date-range) - [Initialize a HashMap in Java](https://www.baeldung.com/java-initialize-hashmap) - [Immutable Set in Java](https://www.baeldung.com/java-immutable-set) +- [Immutable ArrayList in Java](https://www.baeldung.com/java-immutable-list) Note: also contains part of the code for the article [How to Filter a Collection in Java](https://www.baeldung.com/java-collection-filtering). diff --git a/core-java-modules/core-java-9/pom.xml b/core-java-modules/core-java-9/pom.xml index 23a465caa1..a90ad0a740 100644 --- a/core-java-modules/core-java-9/pom.xml +++ b/core-java-modules/core-java-9/pom.xml @@ -37,6 +37,11 @@ ${junit.platform.version} test + + org.apache.commons + commons-collections4 + ${commons-collections4.version} + @@ -69,6 +74,7 @@ 1.9 1.9 25.1-jre + 4.1 diff --git a/core-java-modules/core-java-collections-array-list/src/test/java/org/baeldung/java/collections/CoreJavaCollectionsUnitTest.java b/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/list/immutable/ImmutableArrayListUnitTest.java similarity index 51% rename from core-java-modules/core-java-collections-array-list/src/test/java/org/baeldung/java/collections/CoreJavaCollectionsUnitTest.java rename to core-java-modules/core-java-9/src/test/java/com/baeldung/java9/list/immutable/ImmutableArrayListUnitTest.java index 5f7fe356c5..f148b66dad 100644 --- a/core-java-modules/core-java-collections-array-list/src/test/java/org/baeldung/java/collections/CoreJavaCollectionsUnitTest.java +++ b/core-java-modules/core-java-9/src/test/java/com/baeldung/java9/list/immutable/ImmutableArrayListUnitTest.java @@ -1,56 +1,48 @@ -package org.baeldung.java.collections; +package com.baeldung.java9.list.immutable; import com.google.common.collect.ImmutableList; import org.apache.commons.collections4.ListUtils; import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; -public class CoreJavaCollectionsUnitTest { - - private static final Logger LOG = LoggerFactory.getLogger(CoreJavaCollectionsUnitTest.class); - - - // tests - - - @Test - public final void givenUsingTheJdk_whenArrayListIsSynchronized_thenCorrect() { - final List list = new ArrayList(Arrays.asList("one", "two", "three")); - final List synchronizedList = Collections.synchronizedList(list); - LOG.debug("Synchronized List is: " + synchronizedList); - } +public class ImmutableArrayListUnitTest { @Test(expected = UnsupportedOperationException.class) - public final void givenUsingTheJdk_whenUnmodifiableListIsCreatedFromOriginal_thenNoLongerModifiable() { - final List list = new ArrayList(Arrays.asList("one", "two", "three")); + public final void givenUsingTheJdk_whenUnmodifiableListIsCreated_thenNotModifiable() { + final List list = new ArrayList<>(Arrays.asList("one", "two", "three")); final List unmodifiableList = Collections.unmodifiableList(list); unmodifiableList.add("four"); } @Test(expected = UnsupportedOperationException.class) - public final void givenUsingGuava_whenUnmodifiableListIsCreatedFromOriginal_thenNoLongerModifiable() { - final List list = new ArrayList(Arrays.asList("one", "two", "three")); + public final void givenUsingTheJava9_whenUnmodifiableListIsCreated_thenNotModifiable() { + final List list = new ArrayList<>(Arrays.asList("one", "two", "three")); + final List unmodifiableList = List.of(list.toArray(new String[]{})); + unmodifiableList.add("four"); + } + + @Test(expected = UnsupportedOperationException.class) + public final void givenUsingGuava_whenUnmodifiableListIsCreated_thenNotModifiable() { + final List list = new ArrayList<>(Arrays.asList("one", "two", "three")); final List unmodifiableList = ImmutableList.copyOf(list); unmodifiableList.add("four"); } @Test(expected = UnsupportedOperationException.class) - public final void givenUsingGuavaBuilder_whenUnmodifiableListIsCreatedFromOriginal_thenNoLongerModifiable() { - final List list = new ArrayList(Arrays.asList("one", "two", "three")); + public final void givenUsingGuavaBuilder_whenUnmodifiableListIsCreated_thenNoLongerModifiable() { + final List list = new ArrayList<>(Arrays.asList("one", "two", "three")); final ImmutableList unmodifiableList = ImmutableList.builder().addAll(list).build(); unmodifiableList.add("four"); } @Test(expected = UnsupportedOperationException.class) - public final void givenUsingCommonsCollections_whenUnmodifiableListIsCreatedFromOriginal_thenNoLongerModifiable() { - final List list = new ArrayList(Arrays.asList("one", "two", "three")); + public final void givenUsingCommonsCollections_whenUnmodifiableListIsCreated_thenNotModifiable() { + final List list = new ArrayList<>(Arrays.asList("one", "two", "three")); final List unmodifiableList = ListUtils.unmodifiableList(list); unmodifiableList.add("four"); } - } diff --git a/core-java-modules/core-java-arrays/pom.xml b/core-java-modules/core-java-arrays/pom.xml index 02d82e4af6..a70ab2d791 100644 --- a/core-java-modules/core-java-arrays/pom.xml +++ b/core-java-modules/core-java-arrays/pom.xml @@ -75,7 +75,7 @@ true libs/ - org.baeldung.executable.ExecutableMavenJar + com.baeldung.executable.ExecutableMavenJar @@ -94,7 +94,7 @@ ${project.basedir} - org.baeldung.executable.ExecutableMavenJar + com.baeldung.executable.ExecutableMavenJar @@ -118,7 +118,7 @@ true - org.baeldung.executable.ExecutableMavenJar + com.baeldung.executable.ExecutableMavenJar @@ -133,7 +133,7 @@ - org.baeldung.executable.ExecutableMavenJar + com.baeldung.executable.ExecutableMavenJar true ${project.build.finalName}-onejar.${project.packaging} @@ -155,7 +155,7 @@ spring-boot - org.baeldung.executable.ExecutableMavenJar + com.baeldung.executable.ExecutableMavenJar diff --git a/core-java-modules/core-java-collections-array-list/README.md b/core-java-modules/core-java-collections-array-list/README.md index 302ea82130..3637f835cf 100644 --- a/core-java-modules/core-java-collections-array-list/README.md +++ b/core-java-modules/core-java-collections-array-list/README.md @@ -3,9 +3,8 @@ This module contains articles about the Java ArrayList collection ### Relevant Articles: -- [Immutable ArrayList in Java](http://www.baeldung.com/java-immutable-list) -- [Guide to the Java ArrayList](http://www.baeldung.com/java-arraylist) -- [Add Multiple Items to an Java ArrayList](http://www.baeldung.com/java-add-items-array-list) +- [Guide to the Java ArrayList](https://www.baeldung.com/java-arraylist) +- [Add Multiple Items to an Java ArrayList](https://www.baeldung.com/java-add-items-array-list) - [ClassCastException: Arrays$ArrayList cannot be cast to ArrayList](https://www.baeldung.com/java-classcastexception-arrays-arraylist) - [Multi Dimensional ArrayList in Java](https://www.baeldung.com/java-multi-dimensional-arraylist) - [Removing an Element From an ArrayList](https://www.baeldung.com/java-arraylist-remove-element) diff --git a/core-java-modules/core-java-collections-array-list/src/test/java/org/baeldung/java/collections/ArrayListUnitTest.java b/core-java-modules/core-java-collections-array-list/src/test/java/com/baeldung/collections/ArrayListUnitTest.java similarity index 99% rename from core-java-modules/core-java-collections-array-list/src/test/java/org/baeldung/java/collections/ArrayListUnitTest.java rename to core-java-modules/core-java-collections-array-list/src/test/java/com/baeldung/collections/ArrayListUnitTest.java index 5d07628a96..9d14a63295 100644 --- a/core-java-modules/core-java-collections-array-list/src/test/java/org/baeldung/java/collections/ArrayListUnitTest.java +++ b/core-java-modules/core-java-collections-array-list/src/test/java/com/baeldung/collections/ArrayListUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.collections; +package com.baeldung.collections; import com.google.common.collect.Sets; import org.junit.Before; diff --git a/core-java-modules/core-java-collections-array-list/src/test/java/com/baeldung/collections/CoreJavaCollectionsUnitTest.java b/core-java-modules/core-java-collections-array-list/src/test/java/com/baeldung/collections/CoreJavaCollectionsUnitTest.java new file mode 100644 index 0000000000..5fd0e605dd --- /dev/null +++ b/core-java-modules/core-java-collections-array-list/src/test/java/com/baeldung/collections/CoreJavaCollectionsUnitTest.java @@ -0,0 +1,25 @@ +package com.baeldung.collections; + +import com.google.common.collect.ImmutableList; +import org.apache.commons.collections4.ListUtils; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +public class CoreJavaCollectionsUnitTest { + + private static final Logger LOG = LoggerFactory.getLogger(CoreJavaCollectionsUnitTest.class); + + @Test + public final void givenUsingTheJdk_whenArrayListIsSynchronized_thenCorrect() { + final List list = new ArrayList<>(Arrays.asList("one", "two", "three")); + final List synchronizedList = Collections.synchronizedList(list); + LOG.debug("Synchronized List is: " + synchronizedList); + } + +} diff --git a/core-java-modules/core-java-collections-list-2/README.md b/core-java-modules/core-java-collections-list-2/README.md index 0d2da41b41..2e43f610a9 100644 --- a/core-java-modules/core-java-collections-list-2/README.md +++ b/core-java-modules/core-java-collections-list-2/README.md @@ -3,13 +3,13 @@ This module contains articles about the Java List collection ### Relevant Articles: -- [Check If Two Lists are Equal in Java](http://www.baeldung.com/java-test-a-list-for-ordinality-and-equality) +- [Check If Two Lists are Equal in Java](https://www.baeldung.com/java-test-a-list-for-ordinality-and-equality) - [Java 8 Streams: Find Items From One List Based On Values From Another List](https://www.baeldung.com/java-streams-find-list-items) -- [A Guide to the Java LinkedList](http://www.baeldung.com/java-linkedlist) -- [Java List UnsupportedOperationException](http://www.baeldung.com/java-list-unsupported-operation-exception) +- [A Guide to the Java LinkedList](https://www.baeldung.com/java-linkedlist) +- [Java List UnsupportedOperationException](https://www.baeldung.com/java-list-unsupported-operation-exception) - [Java List Initialization in One Line](https://www.baeldung.com/java-init-list-one-line) - [Ways to Iterate Over a List in Java](https://www.baeldung.com/java-iterate-list) -- [Flattening Nested Collections in Java](http://www.baeldung.com/java-flatten-nested-collections) +- [Flattening Nested Collections in Java](https://www.baeldung.com/java-flatten-nested-collections) - [Intersection of Two Lists in Java](https://www.baeldung.com/java-lists-intersection) - [Searching for a String in an ArrayList](https://www.baeldung.com/java-search-string-arraylist) - [[<-- Prev]](/core-java-modules/core-java-collections-list)[[Next -->]](/core-java-modules/core-java-collections-list-3) diff --git a/core-java-modules/core-java-collections-list-2/src/test/java/org/baeldung/java/lists/ListAssertJUnitTest.java b/core-java-modules/core-java-collections-list-2/src/test/java/com/baeldung/java/list/ListAssertJUnitTest.java similarity index 95% rename from core-java-modules/core-java-collections-list-2/src/test/java/org/baeldung/java/lists/ListAssertJUnitTest.java rename to core-java-modules/core-java-collections-list-2/src/test/java/com/baeldung/java/list/ListAssertJUnitTest.java index c609f5badb..fd15d92dac 100644 --- a/core-java-modules/core-java-collections-list-2/src/test/java/org/baeldung/java/lists/ListAssertJUnitTest.java +++ b/core-java-modules/core-java-collections-list-2/src/test/java/com/baeldung/java/list/ListAssertJUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.lists; +package com.baeldung.java.list; import org.junit.Test; diff --git a/core-java-modules/core-java-collections-list-2/src/test/java/org/baeldung/java/lists/ListJUnitTest.java b/core-java-modules/core-java-collections-list-2/src/test/java/com/baeldung/java/list/ListJUnitTest.java similarity index 97% rename from core-java-modules/core-java-collections-list-2/src/test/java/org/baeldung/java/lists/ListJUnitTest.java rename to core-java-modules/core-java-collections-list-2/src/test/java/com/baeldung/java/list/ListJUnitTest.java index f9c9d3fda8..6537e2d153 100644 --- a/core-java-modules/core-java-collections-list-2/src/test/java/org/baeldung/java/lists/ListJUnitTest.java +++ b/core-java-modules/core-java-collections-list-2/src/test/java/com/baeldung/java/list/ListJUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.lists; +package com.baeldung.java.list; import org.junit.Assert; import org.junit.Test; diff --git a/core-java-modules/core-java-collections-list-2/src/test/java/org/baeldung/java/lists/ListTestNgUnitTest.java b/core-java-modules/core-java-collections-list-2/src/test/java/com/baeldung/java/list/ListTestNgUnitTest.java similarity index 94% rename from core-java-modules/core-java-collections-list-2/src/test/java/org/baeldung/java/lists/ListTestNgUnitTest.java rename to core-java-modules/core-java-collections-list-2/src/test/java/com/baeldung/java/list/ListTestNgUnitTest.java index 86493f6e5d..07002b5613 100644 --- a/core-java-modules/core-java-collections-list-2/src/test/java/org/baeldung/java/lists/ListTestNgUnitTest.java +++ b/core-java-modules/core-java-collections-list-2/src/test/java/com/baeldung/java/list/ListTestNgUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.lists; +package com.baeldung.java.list; import org.junit.Test; diff --git a/core-java-modules/core-java-collections-list-2/src/test/java/org/baeldung/java/lists/README.md b/core-java-modules/core-java-collections-list-2/src/test/java/org/baeldung/java/lists/README.md deleted file mode 100644 index 2a1e8aeeaa..0000000000 --- a/core-java-modules/core-java-collections-list-2/src/test/java/org/baeldung/java/lists/README.md +++ /dev/null @@ -1,2 +0,0 @@ -### Relevant Articles: -- [Check If Two Lists are Equal in Java](http://www.baeldung.com/java-test-a-list-for-ordinality-and-equality) diff --git a/core-java-modules/core-java-collections-list/src/test/java/org/baeldung/java/collections/JavaCollectionCleanupUnitTest.java b/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/collections/JavaCollectionCleanupUnitTest.java similarity index 98% rename from core-java-modules/core-java-collections-list/src/test/java/org/baeldung/java/collections/JavaCollectionCleanupUnitTest.java rename to core-java-modules/core-java-collections-list/src/test/java/com/baeldung/collections/JavaCollectionCleanupUnitTest.java index 537262607a..96813df862 100644 --- a/core-java-modules/core-java-collections-list/src/test/java/org/baeldung/java/collections/JavaCollectionCleanupUnitTest.java +++ b/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/collections/JavaCollectionCleanupUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.collections; +package com.baeldung.collections; import static org.hamcrest.Matchers.hasSize; import static org.junit.Assert.assertThat; diff --git a/core-java-modules/core-java-collections-list/src/test/java/org/baeldung/RandomListElementUnitTest.java b/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/list/random/RandomListElementUnitTest.java similarity index 98% rename from core-java-modules/core-java-collections-list/src/test/java/org/baeldung/RandomListElementUnitTest.java rename to core-java-modules/core-java-collections-list/src/test/java/com/baeldung/list/random/RandomListElementUnitTest.java index 4f5ba0f82f..95e013b481 100644 --- a/core-java-modules/core-java-collections-list/src/test/java/org/baeldung/RandomListElementUnitTest.java +++ b/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/list/random/RandomListElementUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung; +package com.baeldung.list.random; import com.google.common.collect.Lists; import org.junit.Test; diff --git a/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/threadlocalrandom/ThreadLocalRandomBenchMarkRunner.java b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/threadlocalrandom/ThreadLocalRandomBenchMarkRunner.java index e9c8056ff5..a04994d558 100644 --- a/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/threadlocalrandom/ThreadLocalRandomBenchMarkRunner.java +++ b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/threadlocalrandom/ThreadLocalRandomBenchMarkRunner.java @@ -1,22 +1,27 @@ package com.baeldung.threadlocalrandom; import org.openjdk.jmh.runner.Runner; -import org.openjdk.jmh.runner.options.Options; +import org.openjdk.jmh.runner.options.ChainedOptionsBuilder; import org.openjdk.jmh.runner.options.OptionsBuilder; +import com.google.common.collect.ImmutableList; + public class ThreadLocalRandomBenchMarkRunner { public static void main(String[] args) throws Exception { - Options options = new OptionsBuilder().include(ThreadLocalRandomBenchMarker.class.getSimpleName()) - .threads(1) + ChainedOptionsBuilder options = new OptionsBuilder().include(ThreadLocalRandomBenchMarker.class.getSimpleName()) .forks(1) .shouldFailOnError(true) .shouldDoGC(true) - .jvmArgs("-server") - .build(); - - new Runner(options).run(); + .jvmArgs("-server"); + for (Integer i : ImmutableList.of(1, 2, 8, 32)) { + new Runner( + options + .threads(i) + .build()) + .run(); + } } } diff --git a/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/threadlocalrandom/ThreadLocalRandomBenchMarker.java b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/threadlocalrandom/ThreadLocalRandomBenchMarker.java index 8a0e2d2826..b0852bc40d 100644 --- a/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/threadlocalrandom/ThreadLocalRandomBenchMarker.java +++ b/core-java-modules/core-java-concurrency-advanced-2/src/main/java/com/baeldung/threadlocalrandom/ThreadLocalRandomBenchMarker.java @@ -1,64 +1,34 @@ package com.baeldung.threadlocalrandom; -import java.util.ArrayList; -import java.util.List; import java.util.Random; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.TimeUnit; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; -import org.openjdk.jmh.annotations.Level; import org.openjdk.jmh.annotations.Mode; import org.openjdk.jmh.annotations.OutputTimeUnit; import org.openjdk.jmh.annotations.Scope; -import org.openjdk.jmh.annotations.Setup; import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.Warmup; -@BenchmarkMode(Mode.AverageTime) +@BenchmarkMode(Mode.Throughput) @Warmup(iterations = 1) @OutputTimeUnit(TimeUnit.MICROSECONDS) @State(Scope.Benchmark) public class ThreadLocalRandomBenchMarker { + private final Random random = new Random(); - List> randomCallables = new ArrayList<>(); - List> threadLocalRandomCallables = new ArrayList<>(); - - @Setup(Level.Iteration) - public void init() { - Random random = new Random(); - randomCallables = new ArrayList<>(); - threadLocalRandomCallables = new ArrayList<>(); - for (int i = 0; i < 1000; i++) { - randomCallables.add(() -> { - return random.nextInt(); - }); - } - - for (int i = 0; i < 1000; i++) { - threadLocalRandomCallables.add(() -> { - return ThreadLocalRandom.current() - .nextInt(); - }); - } + @Benchmark + public int randomValuesUsingRandom() { + return random.nextInt(); } @Benchmark - public void randomValuesUsingRandom() throws InterruptedException { - ExecutorService executor = Executors.newWorkStealingPool(); - executor.invokeAll(randomCallables); - executor.shutdown(); - } - - @Benchmark - public void randomValuesUsingThreadLocalRandom() throws InterruptedException { - ExecutorService executor = Executors.newWorkStealingPool(); - executor.invokeAll(threadLocalRandomCallables); - executor.shutdown(); + public int randomValuesUsingThreadLocalRandom() { + return ThreadLocalRandom + .current() + .nextInt(); } } diff --git a/core-java-modules/core-java-concurrency-advanced-3/src/main/java/com/baeldung/workstealing/PrimeNumbers.java b/core-java-modules/core-java-concurrency-advanced-3/src/main/java/com/baeldung/workstealing/PrimeNumbers.java new file mode 100644 index 0000000000..b31ec85cd4 --- /dev/null +++ b/core-java-modules/core-java-concurrency-advanced-3/src/main/java/com/baeldung/workstealing/PrimeNumbers.java @@ -0,0 +1,85 @@ +package com.baeldung.workstealing; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.ForkJoinTask; +import java.util.concurrent.RecursiveAction; +import java.util.concurrent.atomic.AtomicInteger; + +public class PrimeNumbers extends RecursiveAction { + + private int lowerBound; + private int upperBound; + private int granularity; + static final List GRANULARITIES + = Arrays.asList(1, 10, 100, 1000, 10000); + private AtomicInteger noOfPrimeNumbers; + + PrimeNumbers(int lowerBound, int upperBound, int granularity, AtomicInteger noOfPrimeNumbers) { + this.lowerBound = lowerBound; + this.upperBound = upperBound; + this.granularity = granularity; + this.noOfPrimeNumbers = noOfPrimeNumbers; + } + + PrimeNumbers(int upperBound) { + this(1, upperBound, 100, new AtomicInteger(0)); + } + + private PrimeNumbers(int lowerBound, int upperBound, AtomicInteger noOfPrimeNumbers) { + this(lowerBound, upperBound, 100, noOfPrimeNumbers); + } + + private List subTasks() { + List subTasks = new ArrayList<>(); + + for (int i = 1; i <= this.upperBound / granularity; i++) { + int upper = i * granularity; + int lower = (upper - granularity) + 1; + subTasks.add(new PrimeNumbers(lower, upper, noOfPrimeNumbers)); + } + return subTasks; + } + + @Override + protected void compute() { + if (((upperBound + 1) - lowerBound) > granularity) { + ForkJoinTask.invokeAll(subTasks()); + } else { + findPrimeNumbers(); + } + } + + void findPrimeNumbers() { + for (int num = lowerBound; num <= upperBound; num++) { + if (isPrime(num)) { + noOfPrimeNumbers.getAndIncrement(); + } + } + } + + private boolean isPrime(int number) { + if (number == 2) { + return true; + } + + if (number == 1 || number % 2 == 0) { + return false; + } + + int noOfNaturalNumbers = 0; + + for (int i = 1; i <= number; i++) { + if (number % i == 0) { + noOfNaturalNumbers++; + } + } + + return noOfNaturalNumbers == 2; + } + + public int noOfPrimeNumbers() { + return noOfPrimeNumbers.intValue(); + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-concurrency-advanced-3/src/test/java/com/baeldung/rejection/SaturationPolicyUnitTest.java b/core-java-modules/core-java-concurrency-advanced-3/src/test/java/com/baeldung/rejection/SaturationPolicyUnitTest.java index b0b065813f..1301fe2778 100644 --- a/core-java-modules/core-java-concurrency-advanced-3/src/test/java/com/baeldung/rejection/SaturationPolicyUnitTest.java +++ b/core-java-modules/core-java-concurrency-advanced-3/src/test/java/com/baeldung/rejection/SaturationPolicyUnitTest.java @@ -33,7 +33,7 @@ public class SaturationPolicyUnitTest { @Test public void givenAbortPolicy_WhenSaturated_ThenShouldThrowRejectedExecutionException() { executor = new ThreadPoolExecutor(1, 1, 0, MILLISECONDS, new SynchronousQueue<>(), new AbortPolicy()); - executor.execute(() -> waitFor(100)); + executor.execute(() -> waitFor(250)); assertThatThrownBy(() -> executor.execute(() -> System.out.println("Will be rejected"))).isInstanceOf(RejectedExecutionException.class); } @@ -42,13 +42,13 @@ public class SaturationPolicyUnitTest { @Test public void givenCallerRunsPolicy_WhenSaturated_ThenTheCallerThreadRunsTheTask() { executor = new ThreadPoolExecutor(1, 1, 0, MILLISECONDS, new SynchronousQueue<>(), new CallerRunsPolicy()); - executor.execute(() -> waitFor(100)); + executor.execute(() -> waitFor(250)); - long startTime = System.nanoTime(); - executor.execute(() -> waitFor(100)); - double blockedDuration = (System.nanoTime() - startTime) / 1_000_000.0; + long startTime = System.currentTimeMillis(); + executor.execute(() -> waitFor(500)); + long blockedDuration = System.currentTimeMillis() - startTime; - assertThat(blockedDuration).isGreaterThanOrEqualTo(100); + assertThat(blockedDuration).isGreaterThanOrEqualTo(500); } @Test diff --git a/core-java-modules/core-java-concurrency-advanced-3/src/test/java/com/baeldung/workstealing/PrimeNumbersUnitTest.java b/core-java-modules/core-java-concurrency-advanced-3/src/test/java/com/baeldung/workstealing/PrimeNumbersUnitTest.java new file mode 100644 index 0000000000..66bc677345 --- /dev/null +++ b/core-java-modules/core-java-concurrency-advanced-3/src/test/java/com/baeldung/workstealing/PrimeNumbersUnitTest.java @@ -0,0 +1,101 @@ +package com.baeldung.workstealing; + +import org.junit.Test; +import org.openjdk.jmh.annotations.*; +import org.openjdk.jmh.runner.Runner; +import org.openjdk.jmh.runner.RunnerException; +import org.openjdk.jmh.runner.options.Options; +import org.openjdk.jmh.runner.options.OptionsBuilder; + +import java.util.concurrent.Executors; +import java.util.concurrent.ForkJoinPool; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.logging.Logger; + +import static org.junit.Assert.fail; + +public class PrimeNumbersUnitTest { + + private static Logger logger = Logger.getAnonymousLogger(); + + @Test + public void givenPrimesCalculated_whenUsingPoolsAndOneThread_thenOneThreadSlowest() { + Options opt = new OptionsBuilder() + .include(Benchmarker.class.getSimpleName()) + .forks(1) + .build(); + + try { + new Runner(opt).run(); + } catch (RunnerException e) { + fail(); + } + } + + @Test + public void givenNewWorkStealingPool_whenGettingPrimes_thenStealCountChanges() { + StringBuilder info = new StringBuilder(); + + for (int granularity : PrimeNumbers.GRANULARITIES) { + int parallelism = ForkJoinPool.getCommonPoolParallelism(); + ForkJoinPool pool = + (ForkJoinPool) Executors.newWorkStealingPool(parallelism); + + stealCountInfo(info, granularity, pool); + } + logger.info("\nExecutors.newWorkStealingPool ->" + info.toString()); + } + + @Test + public void givenCommonPool_whenGettingPrimes_thenStealCountChangesSlowly() { + StringBuilder info = new StringBuilder(); + + for (int granularity : PrimeNumbers.GRANULARITIES) { + ForkJoinPool pool = ForkJoinPool.commonPool(); + stealCountInfo(info, granularity, pool); + } + logger.info("\nForkJoinPool.commonPool ->" + info.toString()); + } + + private void stealCountInfo(StringBuilder info, int granularity, ForkJoinPool forkJoinPool) { + PrimeNumbers primes = new PrimeNumbers(1, 10000, granularity, new AtomicInteger(0)); + forkJoinPool.invoke(primes); + forkJoinPool.shutdown(); + + long steals = forkJoinPool.getStealCount(); + String output = "\nGranularity: [" + granularity + "], Steals: [" + steals + "]"; + info.append(output); + } + + + @BenchmarkMode(Mode.AverageTime) + @OutputTimeUnit(TimeUnit.MILLISECONDS) + @State(Scope.Benchmark) + @Fork(value = 2, warmups = 1, jvmArgs = {"-Xms2G", "-Xmx2G"}) + public static class Benchmarker { + + @Benchmark + public void singleThread() { + PrimeNumbers primes = new PrimeNumbers(10000); + primes.findPrimeNumbers(); // get prime numbers using a single thread + } + + @Benchmark + public void commonPoolBenchmark() { + PrimeNumbers primes = new PrimeNumbers(10000); + ForkJoinPool pool = ForkJoinPool.commonPool(); + pool.invoke(primes); + pool.shutdown(); + } + + @Benchmark + public void newWorkStealingPoolBenchmark() { + PrimeNumbers primes = new PrimeNumbers(10000); + int parallelism = ForkJoinPool.getCommonPoolParallelism(); + ForkJoinPool stealer = (ForkJoinPool) Executors.newWorkStealingPool(parallelism); + stealer.invoke(primes); + stealer.shutdown(); + } + } +} diff --git a/core-java-modules/core-java-concurrency-collections/src/test/java/org/baeldung/java/streams/ThreadPoolInParallelStreamIntegrationTest.java b/core-java-modules/core-java-concurrency-collections/src/test/java/com/baeldung/java/stream/ThreadPoolInParallelStreamIntegrationTest.java similarity index 97% rename from core-java-modules/core-java-concurrency-collections/src/test/java/org/baeldung/java/streams/ThreadPoolInParallelStreamIntegrationTest.java rename to core-java-modules/core-java-concurrency-collections/src/test/java/com/baeldung/java/stream/ThreadPoolInParallelStreamIntegrationTest.java index 502672dea1..7ee849b0a2 100644 --- a/core-java-modules/core-java-concurrency-collections/src/test/java/org/baeldung/java/streams/ThreadPoolInParallelStreamIntegrationTest.java +++ b/core-java-modules/core-java-concurrency-collections/src/test/java/com/baeldung/java/stream/ThreadPoolInParallelStreamIntegrationTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.streams; +package com.baeldung.java.stream; import org.junit.Test; diff --git a/core-java-modules/core-java-date-operations-2/src/test/java/com/baeldung/offsetdatetime/ConvertToOffsetDateTimeUnitTest.java b/core-java-modules/core-java-date-operations-2/src/test/java/com/baeldung/offsetdatetime/ConvertToOffsetDateTimeUnitTest.java index a6fd6c03c2..fa9ceca173 100644 --- a/core-java-modules/core-java-date-operations-2/src/test/java/com/baeldung/offsetdatetime/ConvertToOffsetDateTimeUnitTest.java +++ b/core-java-modules/core-java-date-operations-2/src/test/java/com/baeldung/offsetdatetime/ConvertToOffsetDateTimeUnitTest.java @@ -4,6 +4,7 @@ import org.junit.Test; import java.time.OffsetDateTime; import java.util.Date; +import java.util.TimeZone; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -18,12 +19,19 @@ public class ConvertToOffsetDateTimeUnitTest { @Test public void givenDate_whenHasOffset_thenConvertWithOffset() { + TimeZone prevTimezone = TimeZone.getDefault(); + TimeZone.setDefault(TimeZone.getTimeZone("UTC")); + Date date = new Date(); date.setHours(6); date.setMinutes(30); + OffsetDateTime odt = ConvertToOffsetDateTime.convert(date, 3, 30); assertEquals(10, odt.getHour()); assertEquals(0, odt.getMinute()); + + // Reset the timezone to its original value to prevent side effects + TimeZone.setDefault(prevTimezone); } } diff --git a/core-java-modules/core-java-exceptions-2/README.md b/core-java-modules/core-java-exceptions-2/README.md index 3ad5189b5e..f36d0b24b9 100644 --- a/core-java-modules/core-java-exceptions-2/README.md +++ b/core-java-modules/core-java-exceptions-2/README.md @@ -2,4 +2,7 @@ This module contains articles about core java exceptions -### +### Relevant Articles: + +- [Is It a Bad Practice to Catch Throwable?](https://www.baeldung.com/java-catch-throwable-bad-practice) +- [Wrapping vs Rethrowing Exceptions in Java](https://www.baeldung.com/java-wrapping-vs-rethrowing-exceptions) diff --git a/core-java-modules/core-java-exceptions-2/pom.xml b/core-java-modules/core-java-exceptions-2/pom.xml index 2f7f613faf..955d7153fa 100644 --- a/core-java-modules/core-java-exceptions-2/pom.xml +++ b/core-java-modules/core-java-exceptions-2/pom.xml @@ -13,12 +13,24 @@ 0.0.1-SNAPSHOT ../../parent-java + + + + + org.assertj + assertj-core + ${assertj-core.version} + test + + http://maven.apache.org UTF-8 + + 3.10.0 diff --git a/core-java-modules/core-java-exceptions-2/src/main/java/com/baeldung/exceptions/UnknownHostExceptionHandling.java b/core-java-modules/core-java-exceptions-2/src/main/java/com/baeldung/exceptions/UnknownHostExceptionHandling.java new file mode 100644 index 0000000000..0e1c36f64c --- /dev/null +++ b/core-java-modules/core-java-exceptions-2/src/main/java/com/baeldung/exceptions/UnknownHostExceptionHandling.java @@ -0,0 +1,28 @@ +package com.baeldung.exceptions; + +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.UnknownHostException; + +public class UnknownHostExceptionHandling { + + public static int getResponseCode(String hostname) throws IOException { + URL url = new URL(hostname.trim()); + HttpURLConnection con = (HttpURLConnection) url.openConnection(); + int resCode = -1; + try { + resCode = con.getResponseCode(); + } catch (UnknownHostException e){ + con.disconnect(); + } + return resCode; + } + + public static int getResponseCodeUnhandled(String hostname) throws IOException { + URL url = new URL(hostname.trim()); + HttpURLConnection con = (HttpURLConnection) url.openConnection(); + int resCode = con.getResponseCode(); + return resCode; + } +} diff --git a/core-java-modules/core-java-exceptions-2/src/test/java/com/baeldung/exceptions/UnknownHostExceptionHandlingUnitTest.java b/core-java-modules/core-java-exceptions-2/src/test/java/com/baeldung/exceptions/UnknownHostExceptionHandlingUnitTest.java new file mode 100644 index 0000000000..d4b53e2dce --- /dev/null +++ b/core-java-modules/core-java-exceptions-2/src/test/java/com/baeldung/exceptions/UnknownHostExceptionHandlingUnitTest.java @@ -0,0 +1,15 @@ +package com.baeldung.exceptions; + +import java.io.IOException; +import java.net.UnknownHostException; + +import org.junit.Test; + +public class UnknownHostExceptionHandlingUnitTest { + + @Test(expected = UnknownHostException.class) + public void givenUnknownHost_whenResolve_thenUnknownHostException() throws IOException { + UnknownHostExceptionHandling.getResponseCodeUnhandled("http://locaihost"); + } + +} diff --git a/core-java-modules/core-java-io/README.md b/core-java-modules/core-java-io/README.md index 5c4978722f..2c6c3363cb 100644 --- a/core-java-modules/core-java-io/README.md +++ b/core-java-modules/core-java-io/README.md @@ -13,4 +13,5 @@ This module contains articles about core Java input and output (IO) - [Getting a File’s Mime Type in Java](https://www.baeldung.com/java-file-mime-type) - [How to Write to a CSV File in Java](https://www.baeldung.com/java-csv) - [How to Avoid the Java FileNotFoundException When Loading Resources](https://www.baeldung.com/java-classpath-resource-cannot-be-opened) +- [Create a Directory in Java](https://www.baeldung.com/java-create-directory) - [[More -->]](/core-java-modules/core-java-io-2) diff --git a/core-java-modules/core-java-jar/pom.xml b/core-java-modules/core-java-jar/pom.xml index fe94a6d8a8..d035ee33e2 100644 --- a/core-java-modules/core-java-jar/pom.xml +++ b/core-java-modules/core-java-jar/pom.xml @@ -99,7 +99,7 @@ true libs/ - org.baeldung.executable.ExecutableMavenJar + com.baeldung.executable.ExecutableMavenJar @@ -118,7 +118,7 @@ ${project.basedir} - org.baeldung.executable.ExecutableMavenJar + com.baeldung.executable.ExecutableMavenJar @@ -142,7 +142,7 @@ true - org.baeldung.executable.ExecutableMavenJar + com.baeldung.executable.ExecutableMavenJar @@ -157,7 +157,7 @@ - org.baeldung.executable.ExecutableMavenJar + com.baeldung.executable.ExecutableMavenJar true ${project.build.finalName}-onejar.${project.packaging} @@ -179,7 +179,7 @@ spring-boot - org.baeldung.executable.ExecutableMavenJar + com.baeldung.executable.ExecutableMavenJar diff --git a/core-java-modules/core-java-jndi/pom.xml b/core-java-modules/core-java-jndi/pom.xml index bb4299ae75..482d07a999 100644 --- a/core-java-modules/core-java-jndi/pom.xml +++ b/core-java-modules/core-java-jndi/pom.xml @@ -24,9 +24,14 @@ org.junit.jupiter junit-jupiter-api - 5.5.1 + ${jupiter.version} test + + org.junit.jupiter + junit-jupiter-engine + ${jupiter.version} + org.springframework spring-core diff --git a/core-java-modules/core-java-jndi/src/test/java/com/baeldung/jndi/exceptions/JndiExceptionsUnitTest.java b/core-java-modules/core-java-jndi/src/test/java/com/baeldung/jndi/exceptions/JndiExceptionsUnitTest.java index 434fa41252..218807568c 100644 --- a/core-java-modules/core-java-jndi/src/test/java/com/baeldung/jndi/exceptions/JndiExceptionsUnitTest.java +++ b/core-java-modules/core-java-jndi/src/test/java/com/baeldung/jndi/exceptions/JndiExceptionsUnitTest.java @@ -17,7 +17,6 @@ import org.springframework.mock.jndi.SimpleNamingContextBuilder; @TestMethodOrder(MethodOrderer.OrderAnnotation.class) public class JndiExceptionsUnitTest { - @Disabled @Test @Order(1) void givenNoContext_whenLookupObject_thenThrowNoInitialContext() { diff --git a/core-java-modules/core-java-jvm/README.md b/core-java-modules/core-java-jvm/README.md index 89600ad924..2f80ea7372 100644 --- a/core-java-modules/core-java-jvm/README.md +++ b/core-java-modules/core-java-jvm/README.md @@ -10,3 +10,5 @@ This module contains articles about working with the Java Virtual Machine (JVM). - [Class Loaders in Java](https://www.baeldung.com/java-classloaders) - [A Guide to System.exit()](https://www.baeldung.com/java-system-exit) - [Guide to System.gc()](https://www.baeldung.com/java-system-gc) +- [Runtime.getRuntime().halt() vs System.exit() in Java](https://www.baeldung.com/java-runtime-halt-vs-system-exit) +- [Adding Shutdown Hooks for JVM Applications](https://www.baeldung.com/jvm-shutdown-hooks) diff --git a/core-java-modules/core-java-lang-2/README.md b/core-java-modules/core-java-lang-2/README.md index 5d51f3cea4..ce3589e2be 100644 --- a/core-java-modules/core-java-lang-2/README.md +++ b/core-java-modules/core-java-lang-2/README.md @@ -6,4 +6,5 @@ This module contains articles about core features in the Java language - [Java Primitives versus Objects](https://www.baeldung.com/java-primitives-vs-objects) - [Command-Line Arguments in Java](https://www.baeldung.com/java-command-line-arguments) - [What is a POJO Class?](https://www.baeldung.com/java-pojo-class) +- [Java Default Parameters Using Method Overloading](https://www.baeldung.com/java-default-parameters-method-overloading) - [[<-- Prev]](/core-java-modules/core-java-lang) diff --git a/core-java-modules/core-java-lang-2/pom.xml b/core-java-modules/core-java-lang-2/pom.xml index 4702b7350b..a5fb5ca859 100644 --- a/core-java-modules/core-java-lang-2/pom.xml +++ b/core-java-modules/core-java-lang-2/pom.xml @@ -15,6 +15,11 @@ + + org.apache.commons + commons-lang3 + 3.9 + commons-beanutils commons-beanutils diff --git a/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/methodmultiplereturnvalues/MultipleReturnValuesUsingApacheCommonsPair.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/methodmultiplereturnvalues/MultipleReturnValuesUsingApacheCommonsPair.java new file mode 100644 index 0000000000..2f505443c2 --- /dev/null +++ b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/methodmultiplereturnvalues/MultipleReturnValuesUsingApacheCommonsPair.java @@ -0,0 +1,20 @@ +package com.baeldung.methodmultiplereturnvalues; + +import org.apache.commons.lang3.tuple.ImmutablePair; +import org.apache.commons.lang3.tuple.Pair; + +import java.util.Comparator; +import java.util.List; + +class MultipleReturnValuesUsingApacheCommonsPair { + + static ImmutablePair getMostDistantPoint( + List coordinatesList, + Coordinates target) { + return coordinatesList.stream() + .map(coordinates -> ImmutablePair.of(coordinates, coordinates.calculateDistance(target))) + .max(Comparator.comparingDouble(Pair::getRight)) + .get(); + + } +} diff --git a/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/methodmultiplereturnvalues/MultipleReturnValuesUsingApacheCommonsTriple.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/methodmultiplereturnvalues/MultipleReturnValuesUsingApacheCommonsTriple.java new file mode 100644 index 0000000000..4da297a51f --- /dev/null +++ b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/methodmultiplereturnvalues/MultipleReturnValuesUsingApacheCommonsTriple.java @@ -0,0 +1,23 @@ +package com.baeldung.methodmultiplereturnvalues; + +import org.apache.commons.lang3.tuple.ImmutableTriple; + +import java.util.List; +import java.util.stream.Collectors; + +class MultipleReturnValuesUsingApacheCommonsTriple { + + static ImmutableTriple getMinAvgMaxTriple( + List coordinatesList, + Coordinates target) { + + List distanceList = coordinatesList.stream() + .map(coordinates -> coordinates.calculateDistance(target)) + .collect(Collectors.toList()); + Double minDistance = distanceList.stream().mapToDouble(Double::doubleValue).min().getAsDouble(); + Double avgDistance = distanceList.stream().mapToDouble(Double::doubleValue).average().orElse(0.0D); + Double maxDistance = distanceList.stream().mapToDouble(Double::doubleValue).max().getAsDouble(); + + return ImmutableTriple.of(minDistance, avgDistance, maxDistance); + } +} diff --git a/core-java-modules/core-java-lang-2/src/test/java/com/baeldung/methodmultiplereturnvalues/MultipleReturnValuesUsingApacheCommonsPairUnitTest.java b/core-java-modules/core-java-lang-2/src/test/java/com/baeldung/methodmultiplereturnvalues/MultipleReturnValuesUsingApacheCommonsPairUnitTest.java new file mode 100644 index 0000000000..ca5736fe50 --- /dev/null +++ b/core-java-modules/core-java-lang-2/src/test/java/com/baeldung/methodmultiplereturnvalues/MultipleReturnValuesUsingApacheCommonsPairUnitTest.java @@ -0,0 +1,34 @@ +package com.baeldung.methodmultiplereturnvalues; + +import org.apache.commons.lang3.tuple.ImmutablePair; +import org.junit.jupiter.api.Test; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.ArrayList; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +class MultipleReturnValuesUsingApacheCommonsPairUnitTest { + + @Test + void whenUsingPair_thenMultipleFieldsAreReturned() { + + List coordinatesList = new ArrayList<>(); + coordinatesList.add(new Coordinates(1, 1, "home")); + coordinatesList.add(new Coordinates(2, 2, "school")); + coordinatesList.add(new Coordinates(3, 3, "hotel")); + + Coordinates target = new Coordinates(5, 5, "gym"); + + ImmutablePair mostDistantPoint = MultipleReturnValuesUsingApacheCommonsPair.getMostDistantPoint(coordinatesList, target); + + assertEquals(1, mostDistantPoint.getLeft().getLongitude()); + assertEquals(1, mostDistantPoint.getLeft().getLatitude()); + assertEquals("home", mostDistantPoint.getLeft().getPlaceName()); + assertEquals(5.66, BigDecimal.valueOf(mostDistantPoint.getRight()).setScale(2, RoundingMode.HALF_UP).doubleValue()); + + } + +} diff --git a/core-java-modules/core-java-lang-2/src/test/java/com/baeldung/methodmultiplereturnvalues/MultipleReturnValuesUsingApacheCommonsTripleUnitTest.java b/core-java-modules/core-java-lang-2/src/test/java/com/baeldung/methodmultiplereturnvalues/MultipleReturnValuesUsingApacheCommonsTripleUnitTest.java new file mode 100644 index 0000000000..d23036f5e6 --- /dev/null +++ b/core-java-modules/core-java-lang-2/src/test/java/com/baeldung/methodmultiplereturnvalues/MultipleReturnValuesUsingApacheCommonsTripleUnitTest.java @@ -0,0 +1,35 @@ +package com.baeldung.methodmultiplereturnvalues; + +import org.apache.commons.lang3.tuple.ImmutableTriple; +import org.junit.jupiter.api.Test; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.ArrayList; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +class MultipleReturnValuesUsingApacheCommonsTripleUnitTest { + + @Test + void whenUsingTriple_thenMultipleFieldsAreReturned() { + + List coordinatesList = new ArrayList<>(); + coordinatesList.add(new Coordinates(1, 1, "home")); + coordinatesList.add(new Coordinates(2, 2, "school")); + coordinatesList.add(new Coordinates(3, 3, "hotel")); + + Coordinates target = new Coordinates(5, 5, "gym"); + + ImmutableTriple minAvgMax = MultipleReturnValuesUsingApacheCommonsTriple.getMinAvgMaxTriple(coordinatesList, target); + + assertEquals(2.83, scaleDouble(minAvgMax.left)); //min + assertEquals(4.24, scaleDouble(minAvgMax.middle)); //avg + assertEquals(5.66, scaleDouble(minAvgMax.right)); //max + } + + private double scaleDouble(Double d) { + return BigDecimal.valueOf(d).setScale(2, RoundingMode.HALF_UP).doubleValue(); + } +} diff --git a/core-java-modules/core-java-lang-oop-3/README.md b/core-java-modules/core-java-lang-oop-3/README.md index b1ca877ae0..3a0e588ad4 100644 --- a/core-java-modules/core-java-lang-oop-3/README.md +++ b/core-java-modules/core-java-lang-oop-3/README.md @@ -8,9 +8,9 @@ This module contains articles about Object-oriented programming (OOP) in Java - [Guide to the super Java Keyword](https://www.baeldung.com/java-super) - [Guide to the this Java Keyword](https://www.baeldung.com/java-this) - [Java ‘public’ Access Modifier](https://www.baeldung.com/java-public-keyword) -- [Composition, Aggregation and Association in Java](https://www.baeldung.com/java-composition-aggregation-association) +- [Composition, Aggregation, and Association in Java](https://www.baeldung.com/java-composition-aggregation-association) - [Nested Classes in Java](https://www.baeldung.com/java-nested-classes) - [A Guide to Inner Interfaces in Java](https://www.baeldung.com/java-inner-interfaces) - [Java Classes and Objects](https://www.baeldung.com/java-classes-objects) - [Java Interfaces](https://www.baeldung.com/java-interfaces) -- [[<-- Prev]](/core-java-modules/core-java-lang-oop-2)[[More -->]](/core-java-modules/core-java-lang-oop-4) \ No newline at end of file +- [[<-- Prev]](/core-java-modules/core-java-lang-oop-2)[[More -->]](/core-java-modules/core-java-lang-oop-4) diff --git a/core-java-modules/core-java-lang-oop/README.md b/core-java-modules/core-java-lang-oop/README.md index 0fb044138d..2be3d0cab1 100644 --- a/core-java-modules/core-java-lang-oop/README.md +++ b/core-java-modules/core-java-lang-oop/README.md @@ -13,4 +13,5 @@ This module contains articles about Object-oriented programming (OOP) in Java - [The “final” Keyword in Java](https://www.baeldung.com/java-final) - [Type Erasure in Java Explained](https://www.baeldung.com/java-type-erasure) - [Variable and Method Hiding in Java](https://www.baeldung.com/java-variable-method-hiding) +- [Object-Oriented-Programming Concepts in Java](https://www.baeldung.com/java-oop) - [[More -->]](/core-java-modules/core-java-lang-oop-2) diff --git a/core-java-modules/core-java-perf/README.md b/core-java-modules/core-java-perf/README.md index d1d646ac7f..4204c2b012 100644 --- a/core-java-modules/core-java-perf/README.md +++ b/core-java-modules/core-java-perf/README.md @@ -9,3 +9,4 @@ This module contains articles about performance of Java applications - [OutOfMemoryError: GC Overhead Limit Exceeded](http://www.baeldung.com/java-gc-overhead-limit-exceeded) - [Basic Introduction to JMX](http://www.baeldung.com/java-management-extensions) - [Monitoring Java Applications with Flight Recorder](https://www.baeldung.com/java-flight-recorder-monitoring) +- [Branch Prediction in Java](https://www.baeldung.com/java-branch-prediction) diff --git a/core-java-modules/core-java-string-algorithms-3/README.md b/core-java-modules/core-java-string-algorithms-3/README.md index 3aa31cea53..c7b17a6720 100644 --- a/core-java-modules/core-java-string-algorithms-3/README.md +++ b/core-java-modules/core-java-string-algorithms-3/README.md @@ -3,3 +3,5 @@ This module contains articles about string-related algorithms. ### Relevant Articles: + +- [Check if Two Strings are Anagrams in Java](https://www.baeldung.com/java-strings-anagrams) diff --git a/core-java-modules/core-java-string-operations-2/README.md b/core-java-modules/core-java-string-operations-2/README.md index 50f40ac2af..6e88eda122 100644 --- a/core-java-modules/core-java-string-operations-2/README.md +++ b/core-java-modules/core-java-string-operations-2/README.md @@ -8,4 +8,5 @@ This module contains articles about string operations. - [String Initialization in Java](https://www.baeldung.com/java-string-initialization) - [String toLowerCase and toUpperCase Methods in Java](https://www.baeldung.com/java-string-convert-case) - [Java String equalsIgnoreCase()](https://www.baeldung.com/java-string-equalsignorecase) +- [How to avoid String contains() Case Insensitive in Java](https://www.baeldung.com/how-to-avoid-string-contains-case-insensitive-in-java) - More articles: [[<-- prev]](../core-java-string-operations) diff --git a/core-java-modules/core-java-string-operations-2/pom.xml b/core-java-modules/core-java-string-operations-2/pom.xml index bd1a34f89f..7bb687ea2b 100644 --- a/core-java-modules/core-java-string-operations-2/pom.xml +++ b/core-java-modules/core-java-string-operations-2/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 core-java-string-operations-2 0.1.0-SNAPSHOT @@ -51,6 +52,18 @@ ${org.hamcrest.version} test + + org.openjdk.jmh + jmh-core + ${jmh-core.version} + + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh-generator.version} + + org.assertj assertj-core @@ -61,6 +74,29 @@ core-java-string-operations-2 + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.0 + + + package + + shade + + + + + org.openjdk.jmh.Main + + + + + + + src/main/resources diff --git a/core-java-modules/core-java-string-operations-2/src/main/java/com/baeldung/contains/CaseInsensitiveWorkarounds.java b/core-java-modules/core-java-string-operations-2/src/main/java/com/baeldung/contains/CaseInsensitiveWorkarounds.java new file mode 100644 index 0000000000..e4089a4f53 --- /dev/null +++ b/core-java-modules/core-java-string-operations-2/src/main/java/com/baeldung/contains/CaseInsensitiveWorkarounds.java @@ -0,0 +1,78 @@ +package com.baeldung.contains; + +import java.util.concurrent.TimeUnit; +import java.util.regex.Pattern; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; + +/** + * Based on https://github.com/tedyoung/indexof-contains-benchmark + */ +@Fork(5) +@State(Scope.Benchmark) +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.NANOSECONDS) +public class CaseInsensitiveWorkarounds { + + private String src; + private String dest; + private Pattern pattern; + + public static void main(String[] args) throws Exception { + org.openjdk.jmh.Main.main(args); + } + + @Setup + public void setup() { + src = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"; + dest = "eiusmod"; + pattern = Pattern.compile(Pattern.quote(dest), Pattern.CASE_INSENSITIVE); + } + + // toLowerCase() and contains() + @Benchmark + public boolean lowerCaseContains() { + return src.toLowerCase() + .contains(dest.toLowerCase()); + } + + // matches() with Regular Expressions + @Benchmark + public boolean matchesRegularExpression() { + return src.matches("(?i).*" + dest + ".*"); + } + + public boolean processRegionMatches(String localSrc, String localDest) { + for (int i = localSrc.length() - localDest.length(); i >= 0; i--) + if (localSrc.regionMatches(true, i, localDest, 0, localDest.length())) + return true; + return false; + } + + // String regionMatches() + @Benchmark + public boolean regionMatches() { + return processRegionMatches(src, dest); + } + + // Pattern CASE_INSENSITIVE with regexp + @Benchmark + public boolean patternCaseInsensitiveRegexp() { + return pattern.matcher(src) + .find(); + } + + // Apache Commons StringUtils containsIgnoreCase + @Benchmark + public boolean apacheCommonsStringUtils() { + return org.apache.commons.lang3.StringUtils.containsIgnoreCase(src, dest); + } + +} diff --git a/core-java-modules/core-java-string-operations-2/src/test/java/com/baeldung/contains/CaseInsensitiveWorkaroundsUnitTest.java b/core-java-modules/core-java-string-operations-2/src/test/java/com/baeldung/contains/CaseInsensitiveWorkaroundsUnitTest.java new file mode 100644 index 0000000000..30b2ca9fa5 --- /dev/null +++ b/core-java-modules/core-java-string-operations-2/src/test/java/com/baeldung/contains/CaseInsensitiveWorkaroundsUnitTest.java @@ -0,0 +1,53 @@ +package com.baeldung.contains; + +import org.apache.commons.lang3.StringUtils; +import org.junit.Assert; +import org.junit.Test; + +import java.util.regex.Pattern; + +/** + * BAEL-3739: Different ways to solve the contains() case insensitive behavior. + */ +public class CaseInsensitiveWorkaroundsUnitTest { + + private String src = "Lorem ipsum dolor sit amet"; + private String dest = "lorem"; + + @Test + public void givenString_whenCallingContainsWithToLowerOrUpperCase_shouldReturnTrue() { + // Use toLowerCase to avoid case insensitive issues + Assert.assertTrue(src.toLowerCase().contains(dest.toLowerCase())); + + // Use toUpperCase to avoid case insensitive issues + Assert.assertTrue(src.toUpperCase().contains(dest.toUpperCase())); + } + + @Test + public void givenString_whenCallingStringMatches_thenReturnsTrue() { + // Use String Matches to avoid case insensitive issues + Assert.assertTrue(src.matches("(?i).*" + dest + ".*")); + } + + @Test + public void givenString_whenCallingStringRegionMatches_thenReturnsTrue() { + // Use String Region Matches to avoid case insensitive issues + CaseInsensitiveWorkarounds comparator = new CaseInsensitiveWorkarounds(); + Assert.assertTrue(comparator.processRegionMatches(src, dest)); + } + + + @Test + public void givenString_whenCallingPaternCompileMatcherFind_thenReturnsTrue() { + // Use Pattern Compile Matcher and Find to avoid case insensitive issues + Assert.assertTrue(Pattern.compile(Pattern.quote(dest), + Pattern.CASE_INSENSITIVE) .matcher(src) .find()); + } + + @Test + public void givenString_whenCallingStringUtilsContainsIgnoreCase_thenReturnsTrue() { + // Use StringUtils containsIgnoreCase to avoid case insensitive issues + Assert.assertTrue(StringUtils.containsIgnoreCase(src, dest)); + } + +} diff --git a/core-java-modules/core-java-sun/pom.xml b/core-java-modules/core-java-sun/pom.xml index 03b6646fec..c17bb6b8fc 100644 --- a/core-java-modules/core-java-sun/pom.xml +++ b/core-java-modules/core-java-sun/pom.xml @@ -49,7 +49,7 @@ true libs/ - org.baeldung.executable.ExecutableMavenJar + com.baeldung.executable.ExecutableMavenJar diff --git a/core-java-modules/core-java-text/README.md b/core-java-modules/core-java-text/README.md index 5a6db4e8fd..936396b004 100644 --- a/core-java-modules/core-java-text/README.md +++ b/core-java-modules/core-java-text/README.md @@ -3,4 +3,5 @@ ## Core Java 8 Cookbooks and Examples ### Relevant Articles: -- [An Overview of Regular Expressions Performance in Java](https://www.baeldung.com/java-regex-performance) \ No newline at end of file +- [An Overview of Regular Expressions Performance in Java](https://www.baeldung.com/java-regex-performance) +- [Pre-compile Regex Patterns Into Pattern Objects](https://www.baeldung.com/java-regex-pre-compile) diff --git a/core-java-modules/core-java/pom.xml b/core-java-modules/core-java/pom.xml index 2442d81559..5f60b43f79 100644 --- a/core-java-modules/core-java/pom.xml +++ b/core-java-modules/core-java/pom.xml @@ -99,7 +99,7 @@ true libs/ - org.baeldung.executable.ExecutableMavenJar + com.baeldung.executable.ExecutableMavenJar @@ -118,7 +118,7 @@ ${project.basedir} - org.baeldung.executable.ExecutableMavenJar + com.baeldung.executable.ExecutableMavenJar @@ -142,7 +142,7 @@ true - org.baeldung.executable.ExecutableMavenJar + com.baeldung.executable.ExecutableMavenJar @@ -157,7 +157,7 @@ - org.baeldung.executable.ExecutableMavenJar + com.baeldung.executable.ExecutableMavenJar true ${project.build.finalName}-onejar.${project.packaging} @@ -179,7 +179,7 @@ spring-boot - org.baeldung.executable.ExecutableMavenJar + com.baeldung.executable.ExecutableMavenJar diff --git a/core-java-modules/core-java/src/main/java/org/baeldung/executable/ExecutableMavenJar.java b/core-java-modules/core-java/src/main/java/org/baeldung/executable/ExecutableMavenJar.java deleted file mode 100644 index d291ac0d3b..0000000000 --- a/core-java-modules/core-java/src/main/java/org/baeldung/executable/ExecutableMavenJar.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.baeldung.executable; - -import javax.swing.*; - -public class ExecutableMavenJar { - - public static void main(String[] args) { - JOptionPane.showMessageDialog(null, "It worked!", "Executable Jar with Maven", 1); - } -} diff --git a/core-java-modules/core-java/src/test/java/org/baeldung/java/JavaTimerLongRunningUnitTest.java b/core-java-modules/core-java/src/test/java/com/baeldung/JavaTimerLongRunningUnitTest.java similarity index 99% rename from core-java-modules/core-java/src/test/java/org/baeldung/java/JavaTimerLongRunningUnitTest.java rename to core-java-modules/core-java/src/test/java/com/baeldung/JavaTimerLongRunningUnitTest.java index 826106a09e..7063bafb1d 100644 --- a/core-java-modules/core-java/src/test/java/org/baeldung/java/JavaTimerLongRunningUnitTest.java +++ b/core-java-modules/core-java/src/test/java/com/baeldung/JavaTimerLongRunningUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java; +package com.baeldung; import org.junit.Test; import org.slf4j.Logger; diff --git a/core-java-modules/core-java/src/test/java/org/baeldung/java/arrays/ArraysJoinAndSplitJUnitTest.java b/core-java-modules/core-java/src/test/java/com/baeldung/arrays/ArraysJoinAndSplitJUnitTest.java similarity index 97% rename from core-java-modules/core-java/src/test/java/org/baeldung/java/arrays/ArraysJoinAndSplitJUnitTest.java rename to core-java-modules/core-java/src/test/java/com/baeldung/arrays/ArraysJoinAndSplitJUnitTest.java index 885c3bcd6c..b31a829f34 100644 --- a/core-java-modules/core-java/src/test/java/org/baeldung/java/arrays/ArraysJoinAndSplitJUnitTest.java +++ b/core-java-modules/core-java/src/test/java/com/baeldung/arrays/ArraysJoinAndSplitJUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.arrays; +package com.baeldung.arrays; import java.util.Arrays; diff --git a/core-java-modules/core-java/src/test/java/org/baeldung/java/rawtypes/RawTypesUnitTest.java b/core-java-modules/core-java/src/test/java/com/baeldung/rawtypes/RawTypesUnitTest.java similarity index 90% rename from core-java-modules/core-java/src/test/java/org/baeldung/java/rawtypes/RawTypesUnitTest.java rename to core-java-modules/core-java/src/test/java/com/baeldung/rawtypes/RawTypesUnitTest.java index 161c053cea..3871368c07 100644 --- a/core-java-modules/core-java/src/test/java/org/baeldung/java/rawtypes/RawTypesUnitTest.java +++ b/core-java-modules/core-java/src/test/java/com/baeldung/rawtypes/RawTypesUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.rawtypes; +package com.baeldung.rawtypes; import java.util.ArrayList; import java.util.List; diff --git a/core-java-modules/core-java/src/test/java/org/baeldung/java/sandbox/SandboxJavaManualTest.java b/core-java-modules/core-java/src/test/java/com/baeldung/sandbox/SandboxJavaManualTest.java similarity index 98% rename from core-java-modules/core-java/src/test/java/org/baeldung/java/sandbox/SandboxJavaManualTest.java rename to core-java-modules/core-java/src/test/java/com/baeldung/sandbox/SandboxJavaManualTest.java index 877122ce40..a58c2d4e6c 100644 --- a/core-java-modules/core-java/src/test/java/org/baeldung/java/sandbox/SandboxJavaManualTest.java +++ b/core-java-modules/core-java/src/test/java/com/baeldung/sandbox/SandboxJavaManualTest.java @@ -1,4 +1,4 @@ -package org.baeldung.java.sandbox; +package com.baeldung.sandbox; import org.junit.Test; import org.slf4j.Logger; diff --git a/core-kotlin-2/.gitignore b/core-kotlin-2/.gitignore deleted file mode 100644 index 0c017e8f8c..0000000000 --- a/core-kotlin-2/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -/bin/ - -#ignore gradle -.gradle/ - - -#ignore build and generated files -build/ -node/ -out/ - -#ignore installed node modules and package lock file -node_modules/ -package-lock.json diff --git a/core-kotlin-2/README.md b/core-kotlin-2/README.md deleted file mode 100644 index 5249262fa3..0000000000 --- a/core-kotlin-2/README.md +++ /dev/null @@ -1,14 +0,0 @@ -## Core Kotlin - -This module contains articles about core Kotlin. - -### Relevant articles: - -- [Kotlin Scope Functions](https://www.baeldung.com/kotlin-scope-functions) -- [Kotlin Annotations](https://www.baeldung.com/kotlin-annotations) -- [Split a List into Parts in Kotlin](https://www.baeldung.com/kotlin-split-list-into-parts) -- [String Comparison in Kotlin](https://www.baeldung.com/kotlin-string-comparison) -- [Guide to JVM Platform Annotations in Kotlin](https://www.baeldung.com/kotlin-jvm-annotations) -- [Finding an Element in a List Using Kotlin](https://www.baeldung.com/kotlin-finding-element-in-list) -- [Kotlin Ternary Conditional Operator](https://www.baeldung.com/kotlin-ternary-conditional-operator) -- More articles: [[<-- prev]](/core-kotlin) diff --git a/core-kotlin-2/build.gradle b/core-kotlin-2/build.gradle deleted file mode 100644 index 1c52172404..0000000000 --- a/core-kotlin-2/build.gradle +++ /dev/null @@ -1,58 +0,0 @@ - - -group 'com.baeldung.ktor' -version '1.0-SNAPSHOT' - - -buildscript { - ext.kotlin_version = '1.3.30' - - repositories { - mavenCentral() - } - dependencies { - - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -apply plugin: 'java' -apply plugin: 'kotlin' -apply plugin: 'application' - -mainClassName = 'APIServer.kt' - -sourceCompatibility = 1.8 -compileKotlin { kotlinOptions.jvmTarget = "1.8" } -compileTestKotlin { kotlinOptions.jvmTarget = "1.8" } - -repositories { - mavenCentral() - jcenter() - maven { url "https://dl.bintray.com/kotlin/ktor" } -} -sourceSets { - main{ - kotlin{ - srcDirs 'com/baeldung/ktor' - } - } -} - -test { - useJUnitPlatform() - testLogging { - events "passed", "skipped", "failed" - } -} - -dependencies { - implementation "ch.qos.logback:logback-classic:1.2.1" - implementation "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}" - testImplementation 'org.junit.jupiter:junit-jupiter:5.4.2' - testImplementation 'junit:junit:4.12' - testImplementation 'org.assertj:assertj-core:3.12.2' - testImplementation 'org.mockito:mockito-core:2.27.0' - testImplementation "org.jetbrains.kotlin:kotlin-test:${kotlin_version}" - testImplementation "org.jetbrains.kotlin:kotlin-test-junit5:${kotlin_version}" -} diff --git a/core-kotlin-2/gradle/wrapper/gradle-wrapper.jar b/core-kotlin-2/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 5c2d1cf016..0000000000 Binary files a/core-kotlin-2/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/core-kotlin-2/gradle/wrapper/gradle-wrapper.properties b/core-kotlin-2/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 5f1b1201a7..0000000000 --- a/core-kotlin-2/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.4-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/core-kotlin-2/gradlew b/core-kotlin-2/gradlew deleted file mode 100644 index b0d6d0ab5d..0000000000 --- a/core-kotlin-2/gradlew +++ /dev/null @@ -1,188 +0,0 @@ -#!/usr/bin/env sh - -# -# Copyright 2015 the original author or authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "$*" -} - -die () { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=$(save "$@") - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - -exec "$JAVACMD" "$@" diff --git a/core-kotlin-2/gradlew.bat b/core-kotlin-2/gradlew.bat deleted file mode 100644 index 9991c50326..0000000000 --- a/core-kotlin-2/gradlew.bat +++ /dev/null @@ -1,100 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem http://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/core-kotlin-2/pom.xml b/core-kotlin-2/pom.xml deleted file mode 100644 index be2f5fa68f..0000000000 --- a/core-kotlin-2/pom.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - 4.0.0 - core-kotlin-2 - core-kotlin-2 - jar - - - com.baeldung - parent-kotlin - 1.0.0-SNAPSHOT - ../parent-kotlin - - - - - org.jetbrains.kotlin - kotlin-stdlib-jdk8 - ${kotlin.version} - - - org.junit.jupiter - junit-jupiter - ${junit.jupiter.version} - test - - - org.mockito - mockito-core - ${mockito.version} - test - - - net.bytebuddy - byte-buddy - ${byte-buddy.version} - test - - - org.assertj - assertj-core - ${assertj.version} - test - - - org.jetbrains.kotlin - kotlin-test - ${kotlin.version} - test - - - org.jetbrains.kotlin - kotlin-test-junit5 - ${kotlin.version} - test - - - - - - - org.jetbrains.kotlin - kotlin-maven-plugin - ${kotlin.version} - - - compile - compile - - compile - - - - test-compile - test-compile - - test-compile - - - - - 1.8 - - - - - - - 1.3.30 - 5.4.2 - 2.27.0 - 1.9.12 - 3.10.0 - - - diff --git a/core-kotlin-2/resources/logback.xml b/core-kotlin-2/resources/logback.xml deleted file mode 100644 index 9452207268..0000000000 --- a/core-kotlin-2/resources/logback.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - %d{YYYY-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - \ No newline at end of file diff --git a/core-kotlin-2/settings.gradle b/core-kotlin-2/settings.gradle deleted file mode 100644 index c91c993971..0000000000 --- a/core-kotlin-2/settings.gradle +++ /dev/null @@ -1,2 +0,0 @@ -rootProject.name = 'KtorWithKotlin' - diff --git a/core-kotlin-2/src/test/resources/Kotlin.in b/core-kotlin-2/src/test/resources/Kotlin.in deleted file mode 100644 index d140d4429e..0000000000 --- a/core-kotlin-2/src/test/resources/Kotlin.in +++ /dev/null @@ -1,5 +0,0 @@ -Hello to Kotlin. Its: -1. Concise -2. Safe -3. Interoperable -4. Tool-friendly \ No newline at end of file diff --git a/core-kotlin-2/src/test/resources/Kotlin.out b/core-kotlin-2/src/test/resources/Kotlin.out deleted file mode 100644 index 63d15d2528..0000000000 --- a/core-kotlin-2/src/test/resources/Kotlin.out +++ /dev/null @@ -1,2 +0,0 @@ -Kotlin -Concise, Safe, Interoperable, Tool-friendly \ No newline at end of file diff --git a/core-kotlin-modules/core-kotlin-2/README.md b/core-kotlin-modules/core-kotlin-2/README.md new file mode 100644 index 0000000000..11593062c5 --- /dev/null +++ b/core-kotlin-modules/core-kotlin-2/README.md @@ -0,0 +1,8 @@ +## Core Kotlin 2 + +This module contains articles about Kotlin core features. + +### Relevant articles: +- [Working with Dates in Kotlin](https://www.baeldung.com/kotlin-dates) +- [Kotlin Ternary Conditional Operator](https://www.baeldung.com/kotlin-ternary-conditional-operator) +- [[<-- Prev]](/core-kotlin-modules/core-kotlin) diff --git a/core-kotlin-modules/core-kotlin-2/pom.xml b/core-kotlin-modules/core-kotlin-2/pom.xml new file mode 100644 index 0000000000..ae6e2d175a --- /dev/null +++ b/core-kotlin-modules/core-kotlin-2/pom.xml @@ -0,0 +1,25 @@ + + + 4.0.0 + core-kotlin-2 + core-kotlin-2 + jar + + + com.baeldung.core-kotlin-modules + core-kotlin-modules + 1.0.0-SNAPSHOT + + + + + org.assertj + assertj-core + ${assertj.version} + test + + + + \ No newline at end of file diff --git a/core-kotlin/src/main/kotlin/com/baeldung/datetime/UseDuration.kt b/core-kotlin-modules/core-kotlin-2/src/main/kotlin/com/baeldung/dates/datetime/UseDuration.kt similarity index 90% rename from core-kotlin/src/main/kotlin/com/baeldung/datetime/UseDuration.kt rename to core-kotlin-modules/core-kotlin-2/src/main/kotlin/com/baeldung/dates/datetime/UseDuration.kt index 40fb161c08..922c3a1988 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/datetime/UseDuration.kt +++ b/core-kotlin-modules/core-kotlin-2/src/main/kotlin/com/baeldung/dates/datetime/UseDuration.kt @@ -1,4 +1,4 @@ -package com.baeldung.datetime +package com.baeldung.dates.datetime import java.time.Duration import java.time.LocalTime diff --git a/core-kotlin/src/main/kotlin/com/baeldung/datetime/UseLocalDate.kt b/core-kotlin-modules/core-kotlin-2/src/main/kotlin/com/baeldung/dates/datetime/UseLocalDate.kt similarity index 96% rename from core-kotlin/src/main/kotlin/com/baeldung/datetime/UseLocalDate.kt rename to core-kotlin-modules/core-kotlin-2/src/main/kotlin/com/baeldung/dates/datetime/UseLocalDate.kt index 250c071bbe..81d50a70b2 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/datetime/UseLocalDate.kt +++ b/core-kotlin-modules/core-kotlin-2/src/main/kotlin/com/baeldung/dates/datetime/UseLocalDate.kt @@ -1,4 +1,4 @@ -package com.baeldung.datetime +package com.baeldung.dates.datetime import java.time.DayOfWeek import java.time.LocalDate diff --git a/core-kotlin/src/main/kotlin/com/baeldung/datetime/UseLocalDateTime.kt b/core-kotlin-modules/core-kotlin-2/src/main/kotlin/com/baeldung/dates/datetime/UseLocalDateTime.kt similarity index 84% rename from core-kotlin/src/main/kotlin/com/baeldung/datetime/UseLocalDateTime.kt rename to core-kotlin-modules/core-kotlin-2/src/main/kotlin/com/baeldung/dates/datetime/UseLocalDateTime.kt index ab7bbfcee1..5d0eb6a911 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/datetime/UseLocalDateTime.kt +++ b/core-kotlin-modules/core-kotlin-2/src/main/kotlin/com/baeldung/dates/datetime/UseLocalDateTime.kt @@ -1,4 +1,4 @@ -package com.baeldung.datetime +package com.baeldung.dates.datetime import java.time.LocalDateTime diff --git a/core-kotlin/src/main/kotlin/com/baeldung/datetime/UseLocalTime.kt b/core-kotlin-modules/core-kotlin-2/src/main/kotlin/com/baeldung/dates/datetime/UseLocalTime.kt similarity index 92% rename from core-kotlin/src/main/kotlin/com/baeldung/datetime/UseLocalTime.kt rename to core-kotlin-modules/core-kotlin-2/src/main/kotlin/com/baeldung/dates/datetime/UseLocalTime.kt index 152515621f..24402467e8 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/datetime/UseLocalTime.kt +++ b/core-kotlin-modules/core-kotlin-2/src/main/kotlin/com/baeldung/dates/datetime/UseLocalTime.kt @@ -1,6 +1,5 @@ -package com.baeldung.datetime +package com.baeldung.dates.datetime -import java.time.LocalDateTime import java.time.LocalTime import java.time.temporal.ChronoUnit diff --git a/core-kotlin/src/main/kotlin/com/baeldung/datetime/UsePeriod.kt b/core-kotlin-modules/core-kotlin-2/src/main/kotlin/com/baeldung/dates/datetime/UsePeriod.kt similarity index 90% rename from core-kotlin/src/main/kotlin/com/baeldung/datetime/UsePeriod.kt rename to core-kotlin-modules/core-kotlin-2/src/main/kotlin/com/baeldung/dates/datetime/UsePeriod.kt index df66a3d546..d15e02eb37 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/datetime/UsePeriod.kt +++ b/core-kotlin-modules/core-kotlin-2/src/main/kotlin/com/baeldung/dates/datetime/UsePeriod.kt @@ -1,4 +1,4 @@ -package com.baeldung.datetime +package com.baeldung.dates.datetime import java.time.LocalDate import java.time.Period diff --git a/core-kotlin/src/main/kotlin/com/baeldung/datetime/UseZonedDateTime.kt b/core-kotlin-modules/core-kotlin-2/src/main/kotlin/com/baeldung/dates/datetime/UseZonedDateTime.kt similarity index 88% rename from core-kotlin/src/main/kotlin/com/baeldung/datetime/UseZonedDateTime.kt rename to core-kotlin-modules/core-kotlin-2/src/main/kotlin/com/baeldung/dates/datetime/UseZonedDateTime.kt index fd1838bd2d..e2f3a207c4 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/datetime/UseZonedDateTime.kt +++ b/core-kotlin-modules/core-kotlin-2/src/main/kotlin/com/baeldung/dates/datetime/UseZonedDateTime.kt @@ -1,4 +1,4 @@ -package com.baeldung.datetime +package com.baeldung.dates.datetime import java.time.LocalDateTime import java.time.ZoneId diff --git a/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/CreateDateUnitTest.kt b/core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/dates/CreateDateUnitTest.kt similarity index 96% rename from kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/CreateDateUnitTest.kt rename to core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/dates/CreateDateUnitTest.kt index d52a2f0f19..af5e08ea2d 100644 --- a/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/CreateDateUnitTest.kt +++ b/core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/dates/CreateDateUnitTest.kt @@ -1,34 +1,34 @@ -package com.baeldung.kotlin.dates - -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class CreateDateUnitTest { - - @Test - fun givenString_whenDefaultFormat_thenCreated() { - - var date = LocalDate.parse("2018-12-31") - - assertThat(date).isEqualTo("2018-12-31") - } - - @Test - fun givenString_whenCustomFormat_thenCreated() { - - var formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy") - var date = LocalDate.parse("31-12-2018", formatter) - - assertThat(date).isEqualTo("2018-12-31") - } - - @Test - fun givenYMD_whenUsingOf_thenCreated() { - var date = LocalDate.of(2018, 12, 31) - - assertThat(date).isEqualTo("2018-12-31") - } - +package com.baeldung.kotlin.dates + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test +import java.time.LocalDate +import java.time.format.DateTimeFormatter + +class CreateDateUnitTest { + + @Test + fun givenString_whenDefaultFormat_thenCreated() { + + var date = LocalDate.parse("2018-12-31") + + assertThat(date).isEqualTo("2018-12-31") + } + + @Test + fun givenString_whenCustomFormat_thenCreated() { + + var formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy") + var date = LocalDate.parse("31-12-2018", formatter) + + assertThat(date).isEqualTo("2018-12-31") + } + + @Test + fun givenYMD_whenUsingOf_thenCreated() { + var date = LocalDate.of(2018, 12, 31) + + assertThat(date).isEqualTo("2018-12-31") + } + } \ No newline at end of file diff --git a/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/ExtractDateUnitTest.kt b/core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/dates/ExtractDateUnitTest.kt similarity index 96% rename from kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/ExtractDateUnitTest.kt rename to core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/dates/ExtractDateUnitTest.kt index ef3841752b..d297f4b6c3 100644 --- a/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/ExtractDateUnitTest.kt +++ b/core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/dates/ExtractDateUnitTest.kt @@ -1,29 +1,29 @@ -package com.baeldung.kotlin.dates - -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test -import java.time.DayOfWeek -import java.time.LocalDate -import java.time.Month - -class ExtractDateUnitTest { - - @Test - fun givenDate_thenExtractedYMD() { - var date = LocalDate.parse("2018-12-31") - - assertThat(date.year).isEqualTo(2018) - assertThat(date.month).isEqualTo(Month.DECEMBER) - assertThat(date.dayOfMonth).isEqualTo(31) - } - - @Test - fun givenDate_thenExtractedEraDowDoy() { - var date = LocalDate.parse("2018-12-31") - - assertThat(date.era.toString()).isEqualTo("CE") - assertThat(date.dayOfWeek).isEqualTo(DayOfWeek.MONDAY) - assertThat(date.dayOfYear).isEqualTo(365) - } - +package com.baeldung.kotlin.dates + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test +import java.time.DayOfWeek +import java.time.LocalDate +import java.time.Month + +class ExtractDateUnitTest { + + @Test + fun givenDate_thenExtractedYMD() { + var date = LocalDate.parse("2018-12-31") + + assertThat(date.year).isEqualTo(2018) + assertThat(date.month).isEqualTo(Month.DECEMBER) + assertThat(date.dayOfMonth).isEqualTo(31) + } + + @Test + fun givenDate_thenExtractedEraDowDoy() { + var date = LocalDate.parse("2018-12-31") + + assertThat(date.era.toString()).isEqualTo("CE") + assertThat(date.dayOfWeek).isEqualTo(DayOfWeek.MONDAY) + assertThat(date.dayOfYear).isEqualTo(365) + } + } \ No newline at end of file diff --git a/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/FormatDateUnitTest.kt b/core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/dates/FormatDateUnitTest.kt similarity index 96% rename from kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/FormatDateUnitTest.kt rename to core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/dates/FormatDateUnitTest.kt index 11ff6ec9f0..f7ca414aee 100644 --- a/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/FormatDateUnitTest.kt +++ b/core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/dates/FormatDateUnitTest.kt @@ -1,29 +1,29 @@ -package com.baeldung.kotlin.dates - -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class FormatDateUnitTest { - - @Test - fun givenDate_whenDefaultFormat_thenFormattedString() { - - var date = LocalDate.parse("2018-12-31") - - assertThat(date.toString()).isEqualTo("2018-12-31") - } - - @Test - fun givenDate_whenCustomFormat_thenFormattedString() { - - var date = LocalDate.parse("2018-12-31") - - var formatter = DateTimeFormatter.ofPattern("dd-MMMM-yyyy") - var formattedDate = date.format(formatter) - - assertThat(formattedDate).isEqualTo("31-December-2018") - } - +package com.baeldung.kotlin.dates + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test +import java.time.LocalDate +import java.time.format.DateTimeFormatter + +class FormatDateUnitTest { + + @Test + fun givenDate_whenDefaultFormat_thenFormattedString() { + + var date = LocalDate.parse("2018-12-31") + + assertThat(date.toString()).isEqualTo("2018-12-31") + } + + @Test + fun givenDate_whenCustomFormat_thenFormattedString() { + + var date = LocalDate.parse("2018-12-31") + + var formatter = DateTimeFormatter.ofPattern("dd-MMMM-yyyy") + var formattedDate = date.format(formatter) + + assertThat(formattedDate).isEqualTo("31-December-2018") + } + } \ No newline at end of file diff --git a/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/PeriodDateUnitTest.kt b/core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/dates/PeriodDateUnitTest.kt similarity index 96% rename from kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/PeriodDateUnitTest.kt rename to core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/dates/PeriodDateUnitTest.kt index e6b66634d3..e8ca2971e8 100644 --- a/kotlin-libraries/src/test/kotlin/com/baeldung/kotlin/dates/PeriodDateUnitTest.kt +++ b/core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/dates/PeriodDateUnitTest.kt @@ -1,48 +1,48 @@ -package com.baeldung.kotlin.dates - -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test -import java.time.LocalDate -import java.time.Period - -class PeriodDateUnitTest { - - @Test - fun givenYMD_thenCreatePeriod() { - var period = Period.of(1, 2, 3) - - assertThat(period.toString()).isEqualTo("P1Y2M3D") - } - - @Test - fun givenPeriod_whenAdd_thenModifiedDate() { - var period = Period.of(1, 2, 3) - - var date = LocalDate.of(2018, 6, 25) - var modifiedDate = date.plus(period) - - assertThat(modifiedDate).isEqualTo("2019-08-28") - } - - @Test - fun givenPeriod_whenSubtracted_thenModifiedDate() { - var period = Period.of(1, 2, 3) - - var date = LocalDate.of(2018, 6, 25) - var modifiedDate = date.minus(period) - - assertThat(modifiedDate).isEqualTo("2017-04-22") - } - - @Test - fun givenTwoDate_whenUsingBetween_thenDiffOfDates() { - - var date1 = LocalDate.parse("2018-06-25") - var date2 = LocalDate.parse("2018-12-25") - - var period = Period.between(date1, date2) - - assertThat(period.toString()).isEqualTo("P6M") - } - +package com.baeldung.kotlin.dates + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test +import java.time.LocalDate +import java.time.Period + +class PeriodDateUnitTest { + + @Test + fun givenYMD_thenCreatePeriod() { + var period = Period.of(1, 2, 3) + + assertThat(period.toString()).isEqualTo("P1Y2M3D") + } + + @Test + fun givenPeriod_whenAdd_thenModifiedDate() { + var period = Period.of(1, 2, 3) + + var date = LocalDate.of(2018, 6, 25) + var modifiedDate = date.plus(period) + + assertThat(modifiedDate).isEqualTo("2019-08-28") + } + + @Test + fun givenPeriod_whenSubtracted_thenModifiedDate() { + var period = Period.of(1, 2, 3) + + var date = LocalDate.of(2018, 6, 25) + var modifiedDate = date.minus(period) + + assertThat(modifiedDate).isEqualTo("2017-04-22") + } + + @Test + fun givenTwoDate_whenUsingBetween_thenDiffOfDates() { + + var date1 = LocalDate.parse("2018-06-25") + var date2 = LocalDate.parse("2018-12-25") + + var period = Period.between(date1, date2) + + assertThat(period.toString()).isEqualTo("P6M") + } + } \ No newline at end of file diff --git a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/datetime/UseLocalDateTimeUnitTest.kt b/core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/dates/datetime/UseLocalDateTimeUnitTest.kt similarity index 92% rename from core-kotlin/src/test/kotlin/com/baeldung/kotlin/datetime/UseLocalDateTimeUnitTest.kt rename to core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/dates/datetime/UseLocalDateTimeUnitTest.kt index 8f9f8374ed..f3615a527c 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/datetime/UseLocalDateTimeUnitTest.kt +++ b/core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/dates/datetime/UseLocalDateTimeUnitTest.kt @@ -1,14 +1,12 @@ package com.baeldung.kotlin.datetime -import com.baeldung.datetime.UseLocalDateTime +import com.baeldung.dates.datetime.UseLocalDateTime +import org.junit.Assert.assertEquals +import org.junit.Test import java.time.LocalDate import java.time.LocalTime import java.time.Month -import org.junit.Test - -import org.junit.Assert.assertEquals - class UseLocalDateTimeUnitTest { var useLocalDateTime = UseLocalDateTime() diff --git a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/datetime/UseLocalDateUnitTest.kt b/core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/dates/datetime/UseLocalDateUnitTest.kt similarity index 97% rename from core-kotlin/src/test/kotlin/com/baeldung/kotlin/datetime/UseLocalDateUnitTest.kt rename to core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/dates/datetime/UseLocalDateUnitTest.kt index ac42e91c6c..e6353c9dab 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/datetime/UseLocalDateUnitTest.kt +++ b/core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/dates/datetime/UseLocalDateUnitTest.kt @@ -1,6 +1,6 @@ package com.baeldung.kotlin.datetime -import com.baeldung.datetime.UseLocalDate +import com.baeldung.dates.datetime.UseLocalDate import org.junit.Assert import org.junit.Test import java.time.DayOfWeek diff --git a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/datetime/UseLocalTimeUnitTest.kt b/core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/dates/datetime/UseLocalTimeUnitTest.kt similarity index 95% rename from core-kotlin/src/test/kotlin/com/baeldung/kotlin/datetime/UseLocalTimeUnitTest.kt rename to core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/dates/datetime/UseLocalTimeUnitTest.kt index 83fc57f850..1afe03ca48 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/datetime/UseLocalTimeUnitTest.kt +++ b/core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/dates/datetime/UseLocalTimeUnitTest.kt @@ -1,10 +1,9 @@ package com.baeldung.kotlin.datetime -import com.baeldung.datetime.UseLocalTime -import java.time.LocalTime - +import com.baeldung.dates.datetime.UseLocalTime import org.junit.Assert import org.junit.Test +import java.time.LocalTime class UseLocalTimeUnitTest { diff --git a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/datetime/UsePeriodUnitTest.kt b/core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/dates/datetime/UsePeriodUnitTest.kt similarity index 94% rename from core-kotlin/src/test/kotlin/com/baeldung/kotlin/datetime/UsePeriodUnitTest.kt rename to core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/dates/datetime/UsePeriodUnitTest.kt index 48be72feb0..36e1e5533a 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/datetime/UsePeriodUnitTest.kt +++ b/core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/dates/datetime/UsePeriodUnitTest.kt @@ -1,11 +1,10 @@ package com.baeldung.kotlin.datetime -import com.baeldung.datetime.UsePeriod -import java.time.LocalDate -import java.time.Period - +import com.baeldung.dates.datetime.UsePeriod import org.junit.Assert import org.junit.Test +import java.time.LocalDate +import java.time.Period class UsePeriodUnitTest { diff --git a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/datetime/UseZonedDateTimeUnitTest.kt b/core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/dates/datetime/UseZonedDateTimeUnitTest.kt similarity index 90% rename from core-kotlin/src/test/kotlin/com/baeldung/kotlin/datetime/UseZonedDateTimeUnitTest.kt rename to core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/dates/datetime/UseZonedDateTimeUnitTest.kt index a9d7d973ef..aa2cdaa4f3 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/datetime/UseZonedDateTimeUnitTest.kt +++ b/core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/dates/datetime/UseZonedDateTimeUnitTest.kt @@ -1,6 +1,6 @@ package com.baeldung.kotlin.datetime -import com.baeldung.datetime.UseZonedDateTime +import com.baeldung.dates.datetime.UseZonedDateTime import org.junit.Assert import org.junit.Test import java.time.LocalDateTime diff --git a/core-kotlin-2/src/test/kotlin/com/baeldung/sequences/SequencesTest.kt b/core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/sequences/SequencesTest.kt similarity index 100% rename from core-kotlin-2/src/test/kotlin/com/baeldung/sequences/SequencesTest.kt rename to core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/sequences/SequencesTest.kt diff --git a/core-kotlin-2/src/test/kotlin/com/baeldung/ternary/TernaryOperatorTest.kt b/core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/ternary/TernaryOperatorTest.kt similarity index 100% rename from core-kotlin-2/src/test/kotlin/com/baeldung/ternary/TernaryOperatorTest.kt rename to core-kotlin-modules/core-kotlin-2/src/test/kotlin/com/baeldung/ternary/TernaryOperatorTest.kt diff --git a/core-kotlin-modules/core-kotlin-lang-oop-2/README.md b/core-kotlin-modules/core-kotlin-lang-oop-2/README.md index 83d8f6f38a..27536273dc 100644 --- a/core-kotlin-modules/core-kotlin-lang-oop-2/README.md +++ b/core-kotlin-modules/core-kotlin-lang-oop-2/README.md @@ -1,4 +1,4 @@ -## Core Kotlin +## Core Kotlin Lang OOP This module contains articles about Object-Oriented Programming in Kotlin @@ -7,4 +7,4 @@ This module contains articles about Object-Oriented Programming in Kotlin - [Generics in Kotlin](https://www.baeldung.com/kotlin-generics) - [Delegated Properties in Kotlin](https://www.baeldung.com/kotlin-delegated-properties) - [Delegation Pattern in Kotlin](https://www.baeldung.com/kotlin-delegation-pattern) -- [[<-- Prev]](/core-kotlin-lang-oop) +- [[<-- Prev]](/core-kotlin-modules/core-kotlin-lang-oop) diff --git a/core-kotlin-modules/core-kotlin-lang-oop/README.md b/core-kotlin-modules/core-kotlin-lang-oop/README.md index 461635f1b5..0c1aeb7850 100644 --- a/core-kotlin-modules/core-kotlin-lang-oop/README.md +++ b/core-kotlin-modules/core-kotlin-lang-oop/README.md @@ -14,4 +14,4 @@ This module contains articles about Object-Oriented Programming in Kotlin - [Guide to Kotlin Interfaces](https://www.baeldung.com/kotlin-interfaces) - [Inline Classes in Kotlin](https://www.baeldung.com/kotlin-inline-classes) - [Static Methods Behavior in Kotlin](https://www.baeldung.com/kotlin-static-methods) -- More articles: [[next -->]](/core-kotlin-lang-oop-2) +- More articles: [[next -->]](/core-kotlin-modules/core-kotlin-lang-oop-2) diff --git a/core-kotlin-modules/core-kotlin/README.md b/core-kotlin-modules/core-kotlin/README.md new file mode 100644 index 0000000000..8815b0fadd --- /dev/null +++ b/core-kotlin-modules/core-kotlin/README.md @@ -0,0 +1,16 @@ +## Core Kotlin + +This module contains articles about Kotlin core features. + +### Relevant articles: +- [Introduction to the Kotlin Language](https://www.baeldung.com/kotlin) +- [Kotlin Java Interoperability](https://www.baeldung.com/kotlin-java-interoperability) +- [Get a Random Number in Kotlin](https://www.baeldung.com/kotlin-random-number) +- [Create a Java and Kotlin Project with Maven](https://www.baeldung.com/kotlin-maven-java-project) +- [Guide to Sorting in Kotlin](https://www.baeldung.com/kotlin-sort) +- [Creational Design Patterns in Kotlin: Builder](https://www.baeldung.com/kotlin-builder-pattern) +- [Kotlin Scope Functions](https://www.baeldung.com/kotlin-scope-functions) +- [Implementing a Binary Tree in Kotlin](https://www.baeldung.com/kotlin-binary-tree) +- [JUnit 5 for Kotlin Developers](https://www.baeldung.com/junit-5-kotlin) +- [Converting Kotlin Data Class from JSON using GSON](https://www.baeldung.com/kotlin-json-convert-data-class) +- [[More --> ]](/core-kotlin-modules/core-kotlin-2) diff --git a/core-kotlin-modules/core-kotlin/pom.xml b/core-kotlin-modules/core-kotlin/pom.xml new file mode 100644 index 0000000000..6e36b7c8ef --- /dev/null +++ b/core-kotlin-modules/core-kotlin/pom.xml @@ -0,0 +1,29 @@ + + + 4.0.0 + core-kotlin + core-kotlin + jar + + + com.baeldung.core-kotlin-modules + core-kotlin-modules + 1.0.0-SNAPSHOT + + + + + org.junit.platform + junit-platform-runner + ${junit.platform.version} + test + + + + + 1.1.1 + + + \ No newline at end of file diff --git a/core-kotlin/src/main/java/com/baeldung/java/ArrayExample.java b/core-kotlin-modules/core-kotlin/src/main/java/com/baeldung/interoperability/ArrayExample.java similarity index 91% rename from core-kotlin/src/main/java/com/baeldung/java/ArrayExample.java rename to core-kotlin-modules/core-kotlin/src/main/java/com/baeldung/interoperability/ArrayExample.java index ef91db517b..93b9a3984a 100644 --- a/core-kotlin/src/main/java/com/baeldung/java/ArrayExample.java +++ b/core-kotlin-modules/core-kotlin/src/main/java/com/baeldung/interoperability/ArrayExample.java @@ -1,4 +1,4 @@ -package com.baeldung.java; +package com.baeldung.interoperability; import java.io.File; import java.io.FileReader; diff --git a/core-kotlin/src/main/java/com/baeldung/java/Customer.java b/core-kotlin-modules/core-kotlin/src/main/java/com/baeldung/interoperability/Customer.java similarity index 91% rename from core-kotlin/src/main/java/com/baeldung/java/Customer.java rename to core-kotlin-modules/core-kotlin/src/main/java/com/baeldung/interoperability/Customer.java index 0156bf7b44..4a070a0f97 100644 --- a/core-kotlin/src/main/java/com/baeldung/java/Customer.java +++ b/core-kotlin-modules/core-kotlin/src/main/java/com/baeldung/interoperability/Customer.java @@ -1,4 +1,4 @@ -package com.baeldung.java; +package com.baeldung.interoperability; public class Customer { diff --git a/core-kotlin/src/main/java/com/baeldung/java/StringUtils.java b/core-kotlin-modules/core-kotlin/src/main/java/com/baeldung/introduction/StringUtils.java similarity index 77% rename from core-kotlin/src/main/java/com/baeldung/java/StringUtils.java rename to core-kotlin-modules/core-kotlin/src/main/java/com/baeldung/introduction/StringUtils.java index f405924cdf..1c477ce039 100644 --- a/core-kotlin/src/main/java/com/baeldung/java/StringUtils.java +++ b/core-kotlin-modules/core-kotlin/src/main/java/com/baeldung/introduction/StringUtils.java @@ -1,4 +1,4 @@ -package com.baeldung.java; +package com.baeldung.introduction; public class StringUtils { public static String toUpperCase(String name) { diff --git a/core-kotlin/src/main/java/com/baeldung/mavenjavakotlin/Application.java b/core-kotlin-modules/core-kotlin/src/main/java/com/baeldung/mavenjavakotlin/Application.java similarity index 91% rename from core-kotlin/src/main/java/com/baeldung/mavenjavakotlin/Application.java rename to core-kotlin-modules/core-kotlin/src/main/java/com/baeldung/mavenjavakotlin/Application.java index e2cc0f1e01..ac933d6228 100644 --- a/core-kotlin/src/main/java/com/baeldung/mavenjavakotlin/Application.java +++ b/core-kotlin-modules/core-kotlin/src/main/java/com/baeldung/mavenjavakotlin/Application.java @@ -1,7 +1,6 @@ package com.baeldung.mavenjavakotlin; import com.baeldung.mavenjavakotlin.services.JavaService; -import com.baeldung.mavenjavakotlin.services.KotlinService; public class Application { diff --git a/core-kotlin/src/main/java/com/baeldung/mavenjavakotlin/services/JavaService.java b/core-kotlin-modules/core-kotlin/src/main/java/com/baeldung/mavenjavakotlin/services/JavaService.java similarity index 100% rename from core-kotlin/src/main/java/com/baeldung/mavenjavakotlin/services/JavaService.java rename to core-kotlin-modules/core-kotlin/src/main/java/com/baeldung/mavenjavakotlin/services/JavaService.java diff --git a/core-kotlin/src/main/kotlin/com/baeldung/datastructures/Main.kt b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/binarytree/Main.kt similarity index 93% rename from core-kotlin/src/main/kotlin/com/baeldung/datastructures/Main.kt rename to core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/binarytree/Main.kt index 4fd8aa27c7..eee10fbd8b 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/datastructures/Main.kt +++ b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/binarytree/Main.kt @@ -1,4 +1,4 @@ -package com.baeldung.datastructures +package com.baeldung.binarytree /** * Example of how to use the {@link Node} class. diff --git a/core-kotlin/src/main/kotlin/com/baeldung/datastructures/Node.kt b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/binarytree/Node.kt similarity index 99% rename from core-kotlin/src/main/kotlin/com/baeldung/datastructures/Node.kt rename to core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/binarytree/Node.kt index b81afe1e4c..77bb98f828 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/datastructures/Node.kt +++ b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/binarytree/Node.kt @@ -1,4 +1,4 @@ -package com.baeldung.datastructures +package com.baeldung.binarytree /** * An ADT for a binary search tree. diff --git a/core-kotlin/src/main/kotlin/com/baeldung/builder/FoodOrder.kt b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/builder/FoodOrder.kt similarity index 100% rename from core-kotlin/src/main/kotlin/com/baeldung/builder/FoodOrder.kt rename to core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/builder/FoodOrder.kt diff --git a/core-kotlin/src/main/kotlin/com/baeldung/builder/FoodOrderApply.kt b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/builder/FoodOrderApply.kt similarity index 100% rename from core-kotlin/src/main/kotlin/com/baeldung/builder/FoodOrderApply.kt rename to core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/builder/FoodOrderApply.kt diff --git a/core-kotlin/src/main/kotlin/com/baeldung/builder/FoodOrderNamed.kt b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/builder/FoodOrderNamed.kt similarity index 100% rename from core-kotlin/src/main/kotlin/com/baeldung/builder/FoodOrderNamed.kt rename to core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/builder/FoodOrderNamed.kt diff --git a/core-kotlin/src/main/kotlin/com/baeldung/builder/Main.kt b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/builder/Main.kt similarity index 100% rename from core-kotlin/src/main/kotlin/com/baeldung/builder/Main.kt rename to core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/builder/Main.kt diff --git a/core-kotlin/src/main/kotlin/com/baeldung/kotlin/Example1.kt b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/introduction/Example1.kt similarity index 63% rename from core-kotlin/src/main/kotlin/com/baeldung/kotlin/Example1.kt rename to core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/introduction/Example1.kt index bca1e54a6c..aacd8f7915 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/kotlin/Example1.kt +++ b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/introduction/Example1.kt @@ -1,4 +1,4 @@ -package com.baeldung.kotlin +package com.baeldung.introduction fun main(args: Array){ println("hello word") diff --git a/core-kotlin/src/main/kotlin/com/baeldung/kotlin/Item.kt b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/introduction/Item.kt similarity index 89% rename from core-kotlin/src/main/kotlin/com/baeldung/kotlin/Item.kt rename to core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/introduction/Item.kt index 36994e4994..bb91dd1eae 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/kotlin/Item.kt +++ b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/introduction/Item.kt @@ -1,4 +1,4 @@ -package com.baeldung.kotlin +package com.baeldung.introduction open class Item(val id: String, val name: String = "unknown_name") { open fun getIdOfItem(): String { diff --git a/core-kotlin/src/main/kotlin/com/baeldung/kotlin/ItemService.kt b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/introduction/ItemService.kt similarity index 98% rename from core-kotlin/src/main/kotlin/com/baeldung/kotlin/ItemService.kt rename to core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/introduction/ItemService.kt index 88de1aa9be..dfcf17df7c 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/kotlin/ItemService.kt +++ b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/introduction/ItemService.kt @@ -1,4 +1,4 @@ -package com.baeldung.kotlin +package com.baeldung.introduction import java.util.* diff --git a/core-kotlin-modules/core-kotlin-lang-oop/src/main/kotlin/com/baeldung/kotlin/ListExtension.kt b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/introduction/ListExtension.kt similarity index 90% rename from core-kotlin-modules/core-kotlin-lang-oop/src/main/kotlin/com/baeldung/kotlin/ListExtension.kt rename to core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/introduction/ListExtension.kt index da1773b7c9..e71292c60a 100644 --- a/core-kotlin-modules/core-kotlin-lang-oop/src/main/kotlin/com/baeldung/kotlin/ListExtension.kt +++ b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/introduction/ListExtension.kt @@ -1,4 +1,4 @@ -package com.baeldung.kotlin +package com.baeldung.introduction import java.util.concurrent.ThreadLocalRandom diff --git a/core-kotlin/src/main/kotlin/com/baeldung/kotlin/MathematicsOperations.kt b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/introduction/MathematicsOperations.kt similarity index 75% rename from core-kotlin/src/main/kotlin/com/baeldung/kotlin/MathematicsOperations.kt rename to core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/introduction/MathematicsOperations.kt index 924f9d2323..0ed30ed5b4 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/kotlin/MathematicsOperations.kt +++ b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/introduction/MathematicsOperations.kt @@ -1,4 +1,4 @@ -package com.baeldung.kotlin +package com.baeldung.introduction class MathematicsOperations { fun addTwoNumbers(a: Int, b: Int): Int { diff --git a/core-kotlin/src/main/kotlin/com/baeldung/mavenjavakotlin/services/KotlinService.kt b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/mavenjavakotlin/KotlinService.kt similarity index 70% rename from core-kotlin/src/main/kotlin/com/baeldung/mavenjavakotlin/services/KotlinService.kt rename to core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/mavenjavakotlin/KotlinService.kt index 114b1c88df..10d6a792d8 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/mavenjavakotlin/services/KotlinService.kt +++ b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/mavenjavakotlin/KotlinService.kt @@ -1,4 +1,4 @@ -package com.baeldung.mavenjavakotlin.services +package com.baeldung.mavenjavakotlin class KotlinService { diff --git a/core-kotlin-2/src/main/kotlin/com/baeldung/scope/ScopeFunctions.kt b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/scope/ScopeFunctions.kt similarity index 100% rename from core-kotlin-2/src/main/kotlin/com/baeldung/scope/ScopeFunctions.kt rename to core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/scope/ScopeFunctions.kt diff --git a/core-kotlin/src/main/kotlin/com/baeldung/sorting/SortingExample.kt b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/sorting/SortingExample.kt similarity index 97% rename from core-kotlin/src/main/kotlin/com/baeldung/sorting/SortingExample.kt rename to core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/sorting/SortingExample.kt index 2309d23c36..bf3163bc8f 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/sorting/SortingExample.kt +++ b/core-kotlin-modules/core-kotlin/src/main/kotlin/com/baeldung/sorting/SortingExample.kt @@ -1,7 +1,5 @@ package com.baeldung.sorting -import kotlin.comparisons.* - fun sortMethodUsage() { val sortedValues = mutableListOf(1, 2, 7, 6, 5, 6) sortedValues.sort() diff --git a/core-kotlin/src/test/java/com/baeldung/kotlin/JavaCallToKotlinUnitTest.java b/core-kotlin-modules/core-kotlin/src/test/java/com/baeldung/introduction/JavaCallToKotlinUnitTest.java similarity index 90% rename from core-kotlin/src/test/java/com/baeldung/kotlin/JavaCallToKotlinUnitTest.java rename to core-kotlin-modules/core-kotlin/src/test/java/com/baeldung/introduction/JavaCallToKotlinUnitTest.java index 370f24785a..2c386eaad3 100644 --- a/core-kotlin/src/test/java/com/baeldung/kotlin/JavaCallToKotlinUnitTest.java +++ b/core-kotlin-modules/core-kotlin/src/test/java/com/baeldung/introduction/JavaCallToKotlinUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.kotlin; +package com.baeldung.introduction; import org.junit.Test; diff --git a/core-kotlin/src/test/kotlin/com/baeldung/datastructures/NodeTest.kt b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/binarytree/NodeTest.kt similarity index 98% rename from core-kotlin/src/test/kotlin/com/baeldung/datastructures/NodeTest.kt rename to core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/binarytree/NodeTest.kt index 8a46c5f6ec..9414d7dde9 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/datastructures/NodeTest.kt +++ b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/binarytree/NodeTest.kt @@ -1,7 +1,8 @@ -package com.baeldung.datastructures +package com.baeldung.binarytree import org.junit.After -import org.junit.Assert.* +import org.junit.Assert.assertEquals +import org.junit.Assert.assertNull import org.junit.Before import org.junit.Test diff --git a/core-kotlin/src/test/kotlin/com/baeldung/builder/BuilderPatternUnitTest.kt b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/builder/BuilderPatternUnitTest.kt similarity index 100% rename from core-kotlin/src/test/kotlin/com/baeldung/builder/BuilderPatternUnitTest.kt rename to core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/builder/BuilderPatternUnitTest.kt diff --git a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/gson/GsonUnitTest.kt b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/gson/GsonUnitTest.kt similarity index 87% rename from core-kotlin/src/test/kotlin/com/baeldung/kotlin/gson/GsonUnitTest.kt rename to core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/gson/GsonUnitTest.kt index bdf44d3b49..9159be96be 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/gson/GsonUnitTest.kt +++ b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/gson/GsonUnitTest.kt @@ -1,4 +1,4 @@ -package com.baeldung.kotlin.gson +package com.baeldung.gson import com.google.gson.Gson @@ -11,7 +11,7 @@ class GsonUnitTest { @Test fun givenObject_thenGetJSONString() { - var jsonString = gson.toJson(TestModel(1,"Test")) + var jsonString = gson.toJson(TestModel(1, "Test")) Assert.assertEquals(jsonString, "{\"id\":1,\"description\":\"Test\"}") } diff --git a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/ArrayTest.kt b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/interoperability/ArrayTest.kt similarity index 82% rename from core-kotlin/src/test/kotlin/com/baeldung/kotlin/ArrayTest.kt rename to core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/interoperability/ArrayTest.kt index f7d1c53b13..8e9467f92a 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/ArrayTest.kt +++ b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/interoperability/ArrayTest.kt @@ -1,7 +1,5 @@ -package com.baeldung.kotlin +package com.baeldung.interoperability -import com.baeldung.java.ArrayExample -import com.baeldung.java.Customer import org.junit.Test import kotlin.test.assertEquals @@ -29,7 +27,7 @@ class ArrayTest { val constructors = instance.constructors assertEquals(constructors.size, 1) - assertEquals(constructors[0].name, "com.baeldung.java.Customer") + assertEquals(constructors[0].name, "com.baeldung.interoperability.Customer") } fun makeReadFile() { diff --git a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/CustomerTest.kt b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/interoperability/CustomerTest.kt similarity index 88% rename from core-kotlin/src/test/kotlin/com/baeldung/kotlin/CustomerTest.kt rename to core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/interoperability/CustomerTest.kt index 6395dfcfed..c1b09cd0c1 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/CustomerTest.kt +++ b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/interoperability/CustomerTest.kt @@ -1,6 +1,5 @@ -package com.baeldung.kotlin +package com.baeldung.interoperability -import com.baeldung.java.Customer import org.junit.Test import kotlin.test.assertEquals diff --git a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/ItemServiceTest.kt b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/introduction/ItemServiceTest.kt similarity index 92% rename from core-kotlin/src/test/kotlin/com/baeldung/kotlin/ItemServiceTest.kt rename to core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/introduction/ItemServiceTest.kt index 3d730b1283..2ba14a7462 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/ItemServiceTest.kt +++ b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/introduction/ItemServiceTest.kt @@ -1,9 +1,10 @@ -package com.baeldung.kotlin +package com.baeldung.introduction import org.junit.Test import kotlin.test.assertNotNull class ItemServiceTest { + @Test fun givenItemId_whenGetForOptionalItem_shouldMakeActionOnNonNullValue() { //given diff --git a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/KotlinJavaInteroperabilityTest.kt b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/introduction/KotlinJavaInteroperabilityTest.kt similarity index 84% rename from core-kotlin/src/test/kotlin/com/baeldung/kotlin/KotlinJavaInteroperabilityTest.kt rename to core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/introduction/KotlinJavaInteroperabilityTest.kt index 91ccaabf6f..5dddf9bfc9 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/KotlinJavaInteroperabilityTest.kt +++ b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/introduction/KotlinJavaInteroperabilityTest.kt @@ -1,6 +1,5 @@ -package com.baeldung.kotlin +package com.baeldung.introduction -import com.baeldung.java.StringUtils import org.junit.Test import kotlin.test.assertEquals diff --git a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/LambdaTest.kt b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/introduction/LambdaTest.kt similarity index 91% rename from core-kotlin/src/test/kotlin/com/baeldung/kotlin/LambdaTest.kt rename to core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/introduction/LambdaTest.kt index 34217336a0..5e5166074e 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/LambdaTest.kt +++ b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/introduction/LambdaTest.kt @@ -1,10 +1,11 @@ -package com.baeldung.kotlin +package com.baeldung.introduction import org.junit.Test import kotlin.test.assertEquals class LambdaTest { + @Test fun givenListOfNumber_whenDoingOperationsUsingLambda_shouldReturnProperResult() { //given diff --git a/core-kotlin-modules/core-kotlin-lang-oop/src/test/kotlin/com/baeldung/kotlin/ListExtensionTest.kt b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/introduction/ListExtensionTest.kt similarity index 79% rename from core-kotlin-modules/core-kotlin-lang-oop/src/test/kotlin/com/baeldung/kotlin/ListExtensionTest.kt rename to core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/introduction/ListExtensionTest.kt index 7a496e7437..38f244297b 100644 --- a/core-kotlin-modules/core-kotlin-lang-oop/src/test/kotlin/com/baeldung/kotlin/ListExtensionTest.kt +++ b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/introduction/ListExtensionTest.kt @@ -1,12 +1,12 @@ -package com.baeldung.kotlin +package com.baeldung.introduction -import com.baeldung.kotlin.ListExtension import org.junit.Test import kotlin.test.assertTrue class ListExtensionTest { + @Test - fun givenList_whenExecuteExtensionFunctionOnList_shouldReturnRandomElementOfList(){ + fun givenList_whenExecuteExtensionFunctionOnList_shouldReturnRandomElementOfList() { //given val elements = listOf("a", "b", "c") diff --git a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/junit5/Calculator.kt b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/junit5/Calculator.kt similarity index 91% rename from core-kotlin/src/test/kotlin/com/baeldung/kotlin/junit5/Calculator.kt rename to core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/junit5/Calculator.kt index 1b61c05887..9f6e3ab2b9 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/junit5/Calculator.kt +++ b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/junit5/Calculator.kt @@ -1,4 +1,4 @@ -package com.baeldung.kotlin.junit5 +package com.baeldung.junit5 class Calculator { fun add(a: Int, b: Int) = a + b diff --git a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/junit5/CalculatorTest5.kt b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/junit5/CalculatorUnitTest.kt similarity index 97% rename from core-kotlin/src/test/kotlin/com/baeldung/kotlin/junit5/CalculatorTest5.kt rename to core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/junit5/CalculatorUnitTest.kt index daaedca5a3..07cab3b76e 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/junit5/CalculatorTest5.kt +++ b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/junit5/CalculatorUnitTest.kt @@ -1,9 +1,9 @@ -package com.baeldung.kotlin.junit5 +package com.baeldung.junit5 import org.junit.jupiter.api.* import org.junit.jupiter.api.function.Executable -class CalculatorTest5 { +class CalculatorUnitTest { private val calculator = Calculator() @Test diff --git a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/junit5/DivideByZeroException.kt b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/junit5/DivideByZeroException.kt similarity index 64% rename from core-kotlin/src/test/kotlin/com/baeldung/kotlin/junit5/DivideByZeroException.kt rename to core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/junit5/DivideByZeroException.kt index 60bc4e2944..5675367fd5 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/junit5/DivideByZeroException.kt +++ b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/junit5/DivideByZeroException.kt @@ -1,3 +1,3 @@ -package com.baeldung.kotlin.junit5 +package com.baeldung.junit5 class DivideByZeroException(val numerator: Int) : Exception() diff --git a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/junit5/SimpleTest5.kt b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/junit5/SimpleUnitTest.kt similarity index 88% rename from core-kotlin/src/test/kotlin/com/baeldung/kotlin/junit5/SimpleTest5.kt rename to core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/junit5/SimpleUnitTest.kt index 15ff201430..e3fe998efd 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/junit5/SimpleTest5.kt +++ b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/junit5/SimpleUnitTest.kt @@ -1,10 +1,10 @@ -package com.baeldung.kotlin.junit5 +package com.baeldung.junit5 import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test -class SimpleTest5 { +class SimpleUnitTest { @Test fun `isEmpty should return true for empty lists`() { diff --git a/core-kotlin/src/test/kotlin/com/baeldung/random/RandomNumberTest.kt b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/random/RandomNumberTest.kt similarity index 100% rename from core-kotlin/src/test/kotlin/com/baeldung/random/RandomNumberTest.kt rename to core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/random/RandomNumberTest.kt diff --git a/core-kotlin-2/src/test/kotlin/com/baeldung/scope/ScopeFunctionsUnitTest.kt b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/scope/ScopeFunctionsUnitTest.kt similarity index 100% rename from core-kotlin-2/src/test/kotlin/com/baeldung/scope/ScopeFunctionsUnitTest.kt rename to core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/scope/ScopeFunctionsUnitTest.kt diff --git a/core-kotlin/src/test/kotlin/com/baeldung/sorting/SortingExampleKtTest.kt b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/sorting/SortingExampleKtTest.kt similarity index 86% rename from core-kotlin/src/test/kotlin/com/baeldung/sorting/SortingExampleKtTest.kt rename to core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/sorting/SortingExampleKtTest.kt index 8a94e29c2f..7ac0efa4ef 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/sorting/SortingExampleKtTest.kt +++ b/core-kotlin-modules/core-kotlin/src/test/kotlin/com/baeldung/sorting/SortingExampleKtTest.kt @@ -1,9 +1,8 @@ package com.baeldung.sorting +import org.junit.jupiter.api.Assertions.assertTrue import org.junit.jupiter.api.Test -import org.junit.jupiter.api.Assertions.* - class SortingExampleKtTest { @Test diff --git a/core-kotlin-modules/pom.xml b/core-kotlin-modules/pom.xml index e49b5fb85d..24bdc189be 100644 --- a/core-kotlin-modules/pom.xml +++ b/core-kotlin-modules/pom.xml @@ -15,6 +15,8 @@ + core-kotlin + core-kotlin-2 core-kotlin-advanced core-kotlin-annotations core-kotlin-collections diff --git a/core-kotlin/.gitignore b/core-kotlin/.gitignore deleted file mode 100644 index 0c017e8f8c..0000000000 --- a/core-kotlin/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -/bin/ - -#ignore gradle -.gradle/ - - -#ignore build and generated files -build/ -node/ -out/ - -#ignore installed node modules and package lock file -node_modules/ -package-lock.json diff --git a/core-kotlin/README.md b/core-kotlin/README.md deleted file mode 100644 index 89e1b7287e..0000000000 --- a/core-kotlin/README.md +++ /dev/null @@ -1,32 +0,0 @@ -## Core Kotlin - -This module contains articles about core Kotlin. - -### Relevant articles: - -- [Introduction to the Kotlin Language](https://www.baeldung.com/kotlin) -- [Kotlin Java Interoperability](https://www.baeldung.com/kotlin-java-interoperability) -- [Generics in Kotlin](https://www.baeldung.com/kotlin-generics) -- [Data Classes in Kotlin](https://www.baeldung.com/kotlin-data-classes) -- [Delegated Properties in Kotlin](https://www.baeldung.com/kotlin-delegated-properties) -- [Sealed Classes in Kotlin](https://www.baeldung.com/kotlin-sealed-classes) -- [JUnit 5 for Kotlin Developers](https://www.baeldung.com/junit-5-kotlin) -- [Extension Methods in Kotlin](https://www.baeldung.com/kotlin-extension-methods) -- [Objects in Kotlin](https://www.baeldung.com/kotlin-objects) -- [Working with Enums in Kotlin](https://www.baeldung.com/kotlin-enum) -- [Create a Java and Kotlin Project with Maven](https://www.baeldung.com/kotlin-maven-java-project) -- [Get a Random Number in Kotlin](https://www.baeldung.com/kotlin-random-number) -- [Kotlin Constructors](https://www.baeldung.com/kotlin-constructors) -- [Creational Design Patterns in Kotlin: Builder](https://www.baeldung.com/kotlin-builder-pattern) -- [Kotlin Nested and Inner Classes](https://www.baeldung.com/kotlin-inner-classes) -- [Fuel HTTP Library with Kotlin](https://www.baeldung.com/kotlin-fuel) -- [Introduction to Kovenant Library for Kotlin](https://www.baeldung.com/kotlin-kovenant) -- [Converting Kotlin Data Class from JSON using GSON](https://www.baeldung.com/kotlin-json-convert-data-class) -- [Guide to Kotlin Interfaces](https://www.baeldung.com/kotlin-interfaces) -- [Guide to Sorting in Kotlin](https://www.baeldung.com/kotlin-sort) -- [Dependency Injection for Kotlin with Injekt](https://www.baeldung.com/kotlin-dependency-injection-with-injekt) -- [Implementing a Binary Tree in Kotlin](https://www.baeldung.com/kotlin-binary-tree) -- [Inline Classes in Kotlin](https://www.baeldung.com/kotlin-inline-classes) -- [Static Methods Behavior in Kotlin](https://www.baeldung.com/kotlin-static-methods) -- [Delegation Pattern in Kotlin](https://www.baeldung.com/kotlin-delegation-pattern) -- More articles: [[next -->]](/core-kotlin-2) diff --git a/core-kotlin/build.gradle b/core-kotlin/build.gradle deleted file mode 100755 index 2b6527fca7..0000000000 --- a/core-kotlin/build.gradle +++ /dev/null @@ -1,48 +0,0 @@ - - -group 'com.baeldung.ktor' -version '1.0-SNAPSHOT' - - -buildscript { - ext.kotlin_version = '1.2.41' - - repositories { - mavenCentral() - } - dependencies { - - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -apply plugin: 'java' -apply plugin: 'kotlin' -apply plugin: 'application' - -mainClassName = 'APIServer.kt' - -sourceCompatibility = 1.8 -compileKotlin { kotlinOptions.jvmTarget = "1.8" } -compileTestKotlin { kotlinOptions.jvmTarget = "1.8" } - -kotlin { experimental { coroutines "enable" } } - -repositories { - mavenCentral() - jcenter() - maven { url "https://dl.bintray.com/kotlin/ktor" } -} -sourceSets { - main{ - kotlin{ - srcDirs 'com/baeldung/ktor' - } - } - -} - -dependencies { - compile "ch.qos.logback:logback-classic:1.2.1" - testCompile group: 'junit', name: 'junit', version: '4.12' -} \ No newline at end of file diff --git a/core-kotlin/gradle/wrapper/gradle-wrapper.jar b/core-kotlin/gradle/wrapper/gradle-wrapper.jar deleted file mode 100755 index 01b8bf6b1f..0000000000 Binary files a/core-kotlin/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/core-kotlin/gradle/wrapper/gradle-wrapper.properties b/core-kotlin/gradle/wrapper/gradle-wrapper.properties deleted file mode 100755 index 0b83b5a3e3..0000000000 --- a/core-kotlin/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-bin.zip diff --git a/core-kotlin/gradlew b/core-kotlin/gradlew deleted file mode 100755 index cccdd3d517..0000000000 --- a/core-kotlin/gradlew +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/env sh - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "$*" -} - -die () { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=$(save "$@") - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - -exec "$JAVACMD" "$@" diff --git a/core-kotlin/gradlew.bat b/core-kotlin/gradlew.bat deleted file mode 100755 index e95643d6a2..0000000000 --- a/core-kotlin/gradlew.bat +++ /dev/null @@ -1,84 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/core-kotlin/pom.xml b/core-kotlin/pom.xml deleted file mode 100644 index 5fe8a47f62..0000000000 --- a/core-kotlin/pom.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - 4.0.0 - core-kotlin - core-kotlin - jar - - - com.baeldung - parent-kotlin - 1.0.0-SNAPSHOT - ../parent-kotlin - - - - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - - - org.junit.platform - junit-platform-runner - ${junit.platform.version} - test - - - org.assertj - assertj-core - ${assertj.version} - test - - - com.h2database - h2 - ${h2.version} - - - com.github.kittinunf.fuel - fuel - ${fuel.version} - - - com.github.kittinunf.fuel - fuel-gson - ${fuel.version} - - - com.github.kittinunf.fuel - fuel-rxjava - ${fuel.version} - - - com.github.kittinunf.fuel - fuel-coroutines - ${fuel.version} - - - nl.komponents.kovenant - kovenant - ${kovenant.version} - pom - - - uy.kohesive.injekt - injekt-core - ${injekt-core.version} - - - - - 1.1.1 - 5.2.0 - 3.10.0 - 1.15.0 - 3.3.0 - 1.16.1 - - - diff --git a/core-kotlin/resources/logback.xml b/core-kotlin/resources/logback.xml deleted file mode 100755 index 274cdcdb02..0000000000 --- a/core-kotlin/resources/logback.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - %d{YYYY-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - \ No newline at end of file diff --git a/core-kotlin/settings.gradle b/core-kotlin/settings.gradle deleted file mode 100755 index 13bbce9583..0000000000 --- a/core-kotlin/settings.gradle +++ /dev/null @@ -1,2 +0,0 @@ -rootProject.name = 'KtorWithKotlin' - diff --git a/data-structures/README.md b/data-structures/README.md index 7eeda7c64f..3e83fa7312 100644 --- a/data-structures/README.md +++ b/data-structures/README.md @@ -6,3 +6,5 @@ This module contains articles about data structures in Java - [The Trie Data Structure in Java](https://www.baeldung.com/trie-java) - [Implementing a Binary Tree in Java](https://www.baeldung.com/java-binary-tree) +- [Circular Linked List Java Implementation](https://www.baeldung.com/java-circular-linked-list) +- [How to Print a Binary Tree Diagram](https://www.baeldung.com/java-print-binary-tree-diagram) diff --git a/data-structures/pom.xml b/data-structures/pom.xml index f4a8ea3a14..4468f3d21f 100644 --- a/data-structures/pom.xml +++ b/data-structures/pom.xml @@ -23,7 +23,7 @@ com.leansoft bigqueue - 0.7.0 + ${bigqueue.version} @@ -39,4 +39,8 @@ + + 0.7.0 + + diff --git a/ddd/README.md b/ddd/README.md index daeb663e3b..cd7cf90d61 100644 --- a/ddd/README.md +++ b/ddd/README.md @@ -7,3 +7,4 @@ This module contains articles about Domain-driven Design (DDD) - [Persisting DDD Aggregates](https://www.baeldung.com/spring-persisting-ddd-aggregates) - [Double Dispatch in DDD](https://www.baeldung.com/ddd-double-dispatch) - [DDD Aggregates and @DomainEvents](https://www.baeldung.com/spring-data-ddd) +- [Organizing Layers Using Hexagonal Architecture, DDD, and Spring](https://www.baeldung.com/hexagonal-architecture-ddd-spring) diff --git a/dropwizard/README.md b/dropwizard/README.md new file mode 100644 index 0000000000..e713b2f1e6 --- /dev/null +++ b/dropwizard/README.md @@ -0,0 +1 @@ +# Dropwizard \ No newline at end of file diff --git a/dropwizard/pom.xml b/dropwizard/pom.xml new file mode 100644 index 0000000000..ddc9aa1949 --- /dev/null +++ b/dropwizard/pom.xml @@ -0,0 +1,68 @@ + + + 4.0.0 + dropwizard + 0.0.1-SNAPSHOT + dropwizard + jar + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + + io.dropwizard + dropwizard-core + ${dropwizard.version} + + + + + + + org.apache.maven.plugins + maven-shade-plugin + + true + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + + package + + shade + + + + + + com.baeldung.dropwizard.introduction.IntroductionApplication + + + + + + + + + + + 2.0.0 + + + \ No newline at end of file diff --git a/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/IntroductionApplication.java b/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/IntroductionApplication.java new file mode 100644 index 0000000000..d9af590017 --- /dev/null +++ b/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/IntroductionApplication.java @@ -0,0 +1,51 @@ +package com.baeldung.dropwizard.introduction; + +import com.baeldung.dropwizard.introduction.configuration.ApplicationHealthCheck; +import com.baeldung.dropwizard.introduction.configuration.BasicConfiguration; +import com.baeldung.dropwizard.introduction.domain.Brand; +import com.baeldung.dropwizard.introduction.repository.BrandRepository; +import com.baeldung.dropwizard.introduction.resource.BrandResource; +import io.dropwizard.Application; +import io.dropwizard.configuration.ResourceConfigurationSourceProvider; +import io.dropwizard.setup.Bootstrap; +import io.dropwizard.setup.Environment; + +import java.util.ArrayList; +import java.util.List; + +public class IntroductionApplication extends Application { + + public static void main(final String[] args) throws Exception { + new IntroductionApplication().run("server", "introduction-config.yml"); + } + + @Override + public void run(final BasicConfiguration basicConfiguration, final Environment environment) { + final int defaultSize = basicConfiguration.getDefaultSize(); + final BrandRepository brandRepository = new BrandRepository(initBrands()); + final BrandResource brandResource = new BrandResource(defaultSize, brandRepository); + environment + .jersey() + .register(brandResource); + + final ApplicationHealthCheck healthCheck = new ApplicationHealthCheck(); + environment + .healthChecks() + .register("application", healthCheck); + } + + @Override + public void initialize(final Bootstrap bootstrap) { + bootstrap.setConfigurationSourceProvider(new ResourceConfigurationSourceProvider()); + super.initialize(bootstrap); + } + + private List initBrands() { + final List brands = new ArrayList<>(); + brands.add(new Brand(1L, "Brand1")); + brands.add(new Brand(2L, "Brand2")); + brands.add(new Brand(3L, "Brand3")); + + return brands; + } +} diff --git a/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/configuration/ApplicationHealthCheck.java b/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/configuration/ApplicationHealthCheck.java new file mode 100644 index 0000000000..bf4b710937 --- /dev/null +++ b/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/configuration/ApplicationHealthCheck.java @@ -0,0 +1,10 @@ +package com.baeldung.dropwizard.introduction.configuration; + +import com.codahale.metrics.health.HealthCheck; + +public class ApplicationHealthCheck extends HealthCheck { + @Override + protected Result check() throws Exception { + return Result.healthy(); + } +} diff --git a/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/configuration/BasicConfiguration.java b/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/configuration/BasicConfiguration.java new file mode 100644 index 0000000000..5098f89d62 --- /dev/null +++ b/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/configuration/BasicConfiguration.java @@ -0,0 +1,20 @@ +package com.baeldung.dropwizard.introduction.configuration; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.dropwizard.Configuration; + +import javax.validation.constraints.NotNull; + +public class BasicConfiguration extends Configuration { + @NotNull private final int defaultSize; + + @JsonCreator + public BasicConfiguration(@JsonProperty("defaultSize") final int defaultSize) { + this.defaultSize = defaultSize; + } + + public int getDefaultSize() { + return defaultSize; + } +} diff --git a/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/domain/Brand.java b/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/domain/Brand.java new file mode 100644 index 0000000000..c83f67bb6e --- /dev/null +++ b/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/domain/Brand.java @@ -0,0 +1,19 @@ +package com.baeldung.dropwizard.introduction.domain; + +public class Brand { + private final Long id; + private final String name; + + public Brand(final Long id, final String name) { + this.id = id; + this.name = name; + } + + public Long getId() { + return id; + } + + public String getName() { + return name; + } +} diff --git a/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/repository/BrandRepository.java b/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/repository/BrandRepository.java new file mode 100644 index 0000000000..3f187df3de --- /dev/null +++ b/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/repository/BrandRepository.java @@ -0,0 +1,32 @@ +package com.baeldung.dropwizard.introduction.repository; + +import com.baeldung.dropwizard.introduction.domain.Brand; +import com.google.common.collect.ImmutableList; + +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + +public class BrandRepository { + private final List brands; + + public BrandRepository(final List brands) { + this.brands = ImmutableList.copyOf(brands); + } + + public List findAll(final int size) { + return brands + .stream() + .limit(size) + .collect(Collectors.toList()); + } + + public Optional findById(final Long id) { + return brands + .stream() + .filter(brand -> brand + .getId() + .equals(id)) + .findFirst(); + } +} diff --git a/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/resource/BrandResource.java b/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/resource/BrandResource.java new file mode 100644 index 0000000000..5f97e26faf --- /dev/null +++ b/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/resource/BrandResource.java @@ -0,0 +1,35 @@ +package com.baeldung.dropwizard.introduction.resource; + +import com.baeldung.dropwizard.introduction.domain.Brand; +import com.baeldung.dropwizard.introduction.repository.BrandRepository; + +import javax.ws.rs.*; +import javax.ws.rs.core.MediaType; +import java.util.List; +import java.util.Optional; + +@Path("/brands") +@Produces(MediaType.APPLICATION_JSON) +public class BrandResource { + private final int defaultSize; + private final BrandRepository brandRepository; + + public BrandResource(final int defaultSize, final BrandRepository brandRepository) { + this.defaultSize = defaultSize; + this.brandRepository = brandRepository; + + } + + @GET + public List getBrands(@QueryParam("size") final Optional size) { + return brandRepository.findAll(size.orElse(defaultSize)); + } + + @GET + @Path("/{id}") + public Brand getById(@PathParam("id") final Long id) { + return brandRepository + .findById(id) + .orElseThrow(RuntimeException::new); + } +} diff --git a/dropwizard/src/main/resources/introduction-config.yml b/dropwizard/src/main/resources/introduction-config.yml new file mode 100644 index 0000000000..02ff36de05 --- /dev/null +++ b/dropwizard/src/main/resources/introduction-config.yml @@ -0,0 +1 @@ +defaultSize: 5 \ No newline at end of file diff --git a/dropwizard/src/test/java/com/baeldung/dropwizard/introduction/repository/BrandRepositoryUnitTest.java b/dropwizard/src/test/java/com/baeldung/dropwizard/introduction/repository/BrandRepositoryUnitTest.java new file mode 100644 index 0000000000..b996883ee5 --- /dev/null +++ b/dropwizard/src/test/java/com/baeldung/dropwizard/introduction/repository/BrandRepositoryUnitTest.java @@ -0,0 +1,47 @@ +package com.baeldung.dropwizard.introduction.repository; + +import com.baeldung.dropwizard.introduction.domain.Brand; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +class BrandRepositoryUnitTest { + + private static final Brand BRAND_1 = new Brand(1L, "Brand1"); + + private final BrandRepository brandRepository = new BrandRepository(getBrands()); + + @Test + void givenSize_whenFindingAll_thenReturnList() { + final int size = 2; + + final List result = brandRepository.findAll(size); + + assertEquals(size, result.size()); + } + + @Test + void givenId_whenFindingById_thenReturnFoundBrand() { + final Long id = BRAND_1.getId(); + + final Optional result = brandRepository.findById(id); + + Assertions.assertTrue(result.isPresent()); + assertEquals(BRAND_1, result.get()); + } + + + private List getBrands() { + final List brands = new ArrayList<>(); + brands.add(BRAND_1); + brands.add(new Brand(2L, "Brand2")); + brands.add(new Brand(3L, "Brand3")); + + return brands; + } +} \ No newline at end of file diff --git a/ethereum/pom.xml b/ethereum/pom.xml index da0a7ebda8..1449d9d95c 100644 --- a/ethereum/pom.xml +++ b/ethereum/pom.xml @@ -177,8 +177,8 @@ maven-compiler-plugin ${compiler.plugin.version} - ${source.version} - ${target.version} + ${java.version} + ${java.version} @@ -189,7 +189,7 @@ org.apache.maven.plugins maven-war-plugin - 3.0.0 + ${maven-war-plugin.version} src/main/webapp false @@ -216,7 +216,5 @@ 1.7.25 2.0.4.RELEASE 3.1 - 1.8 - 1.8 diff --git a/graphql/graphql-java/pom.xml b/graphql/graphql-java/pom.xml index 3613d89ae7..793a02458a 100644 --- a/graphql/graphql-java/pom.xml +++ b/graphql/graphql-java/pom.xml @@ -11,6 +11,7 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT + ../.. diff --git a/intelliJ/remote-debugging/README.adoc b/intelliJ/remote-debugging/README.adoc deleted file mode 100644 index 7110a5d7b9..0000000000 --- a/intelliJ/remote-debugging/README.adoc +++ /dev/null @@ -1,85 +0,0 @@ -:toc: -:spring_version: current -:icons: font -:source-highlighter: prettify -:project_id: gs-scheduling-tasks -This guide walks you through the steps for scheduling tasks with Spring. - -== What you'll build - -You'll build an application that prints out the current time every five seconds using Spring's `@Scheduled` annotation. - -== What you'll need - -:java_version: 1.8 -include::https://raw.githubusercontent.com/spring-guides/getting-started-macros/master/prereq_editor_jdk_buildtools.adoc[] - - -include::https://raw.githubusercontent.com/spring-guides/getting-started-macros/master/how_to_complete_this_guide.adoc[] - - -include::https://raw.githubusercontent.com/spring-guides/getting-started-macros/master/hide-show-gradle.adoc[] - -include::https://raw.githubusercontent.com/spring-guides/getting-started-macros/master/hide-show-maven.adoc[] - -include::https://raw.githubusercontent.com/spring-guides/getting-started-macros/master/hide-show-sts.adoc[] - - - -[[initial]] -== Create a scheduled task -Now that you've set up your project, you can create a scheduled task. - -`src/main/java/hello/ScheduledTasks.java` -[source,java] ----- -include::complete/src/main/java/hello/ScheduledTasks.java[] ----- - -The `Scheduled` annotation defines when a particular method runs. -NOTE: This example uses `fixedRate`, which specifies the interval between method invocations measured from the start time of each invocation. There are https://docs.spring.io/spring/docs/{spring_version}/spring-framework-reference/html/scheduling.html#scheduling-annotation-support-scheduled[other options], like `fixedDelay`, which specifies the interval between invocations measured from the completion of the task. You can also https://docs.spring.io/spring/docs/{spring_version}/javadoc-api/org/springframework/scheduling/support/CronSequenceGenerator.html[use `@Scheduled(cron=". . .")` expressions for more sophisticated task scheduling]. - -== Enable Scheduling - -Although scheduled tasks can be embedded in web apps and WAR files, the simpler approach demonstrated below creates a standalone application. You package everything in a single, executable JAR file, driven by a good old Java `main()` method. - -`src/main/java/hello/Application.java` -[source,java] ----- -include::complete/src/main/java/hello/Application.java[] ----- - -include::https://raw.githubusercontent.com/spring-guides/getting-started-macros/master/spring-boot-application.adoc[] - -https://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/#scheduling-enable-annotation-support[`@EnableScheduling`] ensures that a background task executor is created. Without it, nothing gets scheduled. - - -include::https://raw.githubusercontent.com/spring-guides/getting-started-macros/master/build_an_executable_jar_subhead.adoc[] - -include::https://raw.githubusercontent.com/spring-guides/getting-started-macros/master/build_an_executable_jar_with_both.adoc[] - - - -Logging output is displayed and you can see from the logs that it is on a background thread. You should see your scheduled task fire every 5 seconds: - -.... -[...] -2016-08-25 13:10:00.143 INFO 31565 --- [pool-1-thread-1] hello.ScheduledTasks : The time is now 13:10:00 -2016-08-25 13:10:05.143 INFO 31565 --- [pool-1-thread-1] hello.ScheduledTasks : The time is now 13:10:05 -2016-08-25 13:10:10.143 INFO 31565 --- [pool-1-thread-1] hello.ScheduledTasks : The time is now 13:10:10 -2016-08-25 13:10:15.143 INFO 31565 --- [pool-1-thread-1] hello.ScheduledTasks : The time is now 13:10:15 -.... - -== Summary - -Congratulations! You created an application with a scheduled task. Heck, the actual code was shorter than the build file! This technique works in any type of application. - -== See Also - -The following guides may also be helpful: - -* https://spring.io/guides/gs/spring-boot/[Building an Application with Spring Boot] -* https://spring.io/guides/gs/batch-processing/[Creating a Batch Service] - -include::https://raw.githubusercontent.com/spring-guides/getting-started-macros/master/footer.adoc[] - diff --git a/intelliJ/remote-debugging/README.md b/intelliJ/remote-debugging/README.md new file mode 100644 index 0000000000..54e3e00ace --- /dev/null +++ b/intelliJ/remote-debugging/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Remote Debugging with IntelliJ IDEA](https://www.baeldung.com/intellij-remote-debugging) diff --git a/intelliJ/remote-debugging/pom.xml b/intelliJ/remote-debugging/pom.xml index 43b9a44d13..b8845e49d2 100644 --- a/intelliJ/remote-debugging/pom.xml +++ b/intelliJ/remote-debugging/pom.xml @@ -9,14 +9,16 @@ gs-scheduling-tasks - org.springframework.boot - spring-boot-starter-parent - 2.1.6.RELEASE + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../../parent-boot-2 1.8 3.1.2 + 2.1.6.RELEASE @@ -45,5 +47,4 @@ - diff --git a/jackson-modules/pom.xml b/jackson-modules/pom.xml index a8568c1950..4281710ac9 100644 --- a/jackson-modules/pom.xml +++ b/jackson-modules/pom.xml @@ -21,7 +21,6 @@ jackson-conversions-2 jackson-custom-conversions jackson-exceptions - jackson-simple diff --git a/jackson-modules/jackson-simple/README.md b/jackson-simple/README.md similarity index 87% rename from jackson-modules/jackson-simple/README.md rename to jackson-simple/README.md index ffc76ead22..41aee8cac9 100644 --- a/jackson-modules/jackson-simple/README.md +++ b/jackson-simple/README.md @@ -16,4 +16,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring ### NOTE: -Since this is a module tied to an e-book, it should **not** be used to store the code for any further article. +Since this is a module tied to an e-book, it should **not** be moved or used to store the code for any further article. diff --git a/jackson-modules/jackson-simple/pom.xml b/jackson-simple/pom.xml similarity index 77% rename from jackson-modules/jackson-simple/pom.xml rename to jackson-simple/pom.xml index fef28e4359..f41df7085c 100644 --- a/jackson-modules/jackson-simple/pom.xml +++ b/jackson-simple/pom.xml @@ -8,11 +8,18 @@ com.baeldung - jackson-modules + parent-java 0.0.1-SNAPSHOT + ../parent-java + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson.version} + org.assertj diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/AliasBean.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/AliasBean.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/AliasBean.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/AliasBean.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithCreator.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithCreator.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithCreator.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithCreator.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithCustomAnnotation.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithCustomAnnotation.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithCustomAnnotation.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithCustomAnnotation.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithFilter.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithFilter.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithFilter.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithFilter.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithGetter.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithGetter.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithGetter.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithGetter.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithIgnore.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithIgnore.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithIgnore.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithIgnore.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithInject.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithInject.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithInject.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithInject.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/ExtendableBean.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/ExtendableBean.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/ExtendableBean.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/ExtendableBean.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/MyBean.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/MyBean.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/MyBean.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/MyBean.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/PrivateBean.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/PrivateBean.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/PrivateBean.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/PrivateBean.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/RawBean.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/RawBean.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/RawBean.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/RawBean.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/UnwrappedUser.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/UnwrappedUser.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/UnwrappedUser.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/UnwrappedUser.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/UserWithIgnoreType.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/UserWithIgnoreType.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/UserWithIgnoreType.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/UserWithIgnoreType.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/Zoo.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/Zoo.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/Zoo.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/Zoo.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithIdentity.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithIdentity.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithIdentity.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithIdentity.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithIgnore.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithIgnore.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithIgnore.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithIgnore.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithRef.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithRef.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithRef.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithRef.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithIdentity.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithIdentity.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithIdentity.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithIdentity.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithIgnore.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithIgnore.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithIgnore.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithIgnore.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithRef.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithRef.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithRef.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithRef.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/date/CustomDateDeserializer.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/date/CustomDateDeserializer.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/date/CustomDateDeserializer.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/date/CustomDateDeserializer.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/date/CustomDateSerializer.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/date/CustomDateSerializer.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/date/CustomDateSerializer.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/date/CustomDateSerializer.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/date/EventWithFormat.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/date/EventWithFormat.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/date/EventWithFormat.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/date/EventWithFormat.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/date/EventWithSerializer.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/date/EventWithSerializer.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/date/EventWithSerializer.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/date/EventWithSerializer.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/deserialization/ItemDeserializerOnClass.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/deserialization/ItemDeserializerOnClass.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/deserialization/ItemDeserializerOnClass.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/deserialization/ItemDeserializerOnClass.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/dtos/Item.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/dtos/Item.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/dtos/Item.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/dtos/Item.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/dtos/ItemWithSerializer.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/dtos/ItemWithSerializer.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/dtos/ItemWithSerializer.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/dtos/ItemWithSerializer.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/dtos/User.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/dtos/User.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/dtos/User.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/dtos/User.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/dtos/withEnum/DistanceEnumWithValue.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/dtos/withEnum/DistanceEnumWithValue.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/dtos/withEnum/DistanceEnumWithValue.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/dtos/withEnum/DistanceEnumWithValue.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/exception/UserWithRoot.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/exception/UserWithRoot.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/exception/UserWithRoot.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/exception/UserWithRoot.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/exception/UserWithRootNamespace.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/exception/UserWithRootNamespace.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/exception/UserWithRootNamespace.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/exception/UserWithRootNamespace.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/ignore/MyMixInForIgnoreType.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/ignore/MyMixInForIgnoreType.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/ignore/MyMixInForIgnoreType.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/ignore/MyMixInForIgnoreType.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/jsonview/Item.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/jsonview/Item.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/jsonview/Item.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/jsonview/Item.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/jsonview/Views.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/jsonview/Views.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/jsonview/Views.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/jsonview/Views.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/serialization/ItemSerializer.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/serialization/ItemSerializer.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/serialization/ItemSerializer.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/serialization/ItemSerializer.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/serialization/ItemSerializerOnClass.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/serialization/ItemSerializerOnClass.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/annotation/serialization/ItemSerializerOnClass.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/serialization/ItemSerializerOnClass.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDto.java b/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDto.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDto.java rename to jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDto.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIgnoreField.java b/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIgnoreField.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIgnoreField.java rename to jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIgnoreField.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIgnoreFieldByName.java b/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIgnoreFieldByName.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIgnoreFieldByName.java rename to jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIgnoreFieldByName.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIgnoreNull.java b/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIgnoreNull.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIgnoreNull.java rename to jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIgnoreNull.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIncludeNonDefault.java b/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIncludeNonDefault.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIncludeNonDefault.java rename to jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIncludeNonDefault.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoWithFilter.java b/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoWithFilter.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoWithFilter.java rename to jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoWithFilter.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoWithSpecialField.java b/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoWithSpecialField.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoWithSpecialField.java rename to jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoWithSpecialField.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyMixInForIgnoreType.java b/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyMixInForIgnoreType.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyMixInForIgnoreType.java rename to jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyMixInForIgnoreType.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/ignorenullfields/MyDto.java b/jackson-simple/src/main/java/com/baeldung/jackson/ignorenullfields/MyDto.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/ignorenullfields/MyDto.java rename to jackson-simple/src/main/java/com/baeldung/jackson/ignorenullfields/MyDto.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/ignorenullfields/MyDtoIgnoreNull.java b/jackson-simple/src/main/java/com/baeldung/jackson/ignorenullfields/MyDtoIgnoreNull.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/ignorenullfields/MyDtoIgnoreNull.java rename to jackson-simple/src/main/java/com/baeldung/jackson/ignorenullfields/MyDtoIgnoreNull.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/jsonproperty/MyDto.java b/jackson-simple/src/main/java/com/baeldung/jackson/jsonproperty/MyDto.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/jsonproperty/MyDto.java rename to jackson-simple/src/main/java/com/baeldung/jackson/jsonproperty/MyDto.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/jsonproperty/MyDtoFieldNameChanged.java b/jackson-simple/src/main/java/com/baeldung/jackson/jsonproperty/MyDtoFieldNameChanged.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/jsonproperty/MyDtoFieldNameChanged.java rename to jackson-simple/src/main/java/com/baeldung/jackson/jsonproperty/MyDtoFieldNameChanged.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/objectmapper/CustomCarDeserializer.java b/jackson-simple/src/main/java/com/baeldung/jackson/objectmapper/CustomCarDeserializer.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/objectmapper/CustomCarDeserializer.java rename to jackson-simple/src/main/java/com/baeldung/jackson/objectmapper/CustomCarDeserializer.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/objectmapper/CustomCarSerializer.java b/jackson-simple/src/main/java/com/baeldung/jackson/objectmapper/CustomCarSerializer.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/objectmapper/CustomCarSerializer.java rename to jackson-simple/src/main/java/com/baeldung/jackson/objectmapper/CustomCarSerializer.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/objectmapper/dto/Car.java b/jackson-simple/src/main/java/com/baeldung/jackson/objectmapper/dto/Car.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/objectmapper/dto/Car.java rename to jackson-simple/src/main/java/com/baeldung/jackson/objectmapper/dto/Car.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/objectmapper/dto/Request.java b/jackson-simple/src/main/java/com/baeldung/jackson/objectmapper/dto/Request.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/objectmapper/dto/Request.java rename to jackson-simple/src/main/java/com/baeldung/jackson/objectmapper/dto/Request.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/unknownproperties/MyDto.java b/jackson-simple/src/main/java/com/baeldung/jackson/unknownproperties/MyDto.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/unknownproperties/MyDto.java rename to jackson-simple/src/main/java/com/baeldung/jackson/unknownproperties/MyDto.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/unknownproperties/MyDtoIgnoreType.java b/jackson-simple/src/main/java/com/baeldung/jackson/unknownproperties/MyDtoIgnoreType.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/unknownproperties/MyDtoIgnoreType.java rename to jackson-simple/src/main/java/com/baeldung/jackson/unknownproperties/MyDtoIgnoreType.java diff --git a/jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/unknownproperties/MyDtoIgnoreUnknown.java b/jackson-simple/src/main/java/com/baeldung/jackson/unknownproperties/MyDtoIgnoreUnknown.java similarity index 100% rename from jackson-modules/jackson-simple/src/main/java/com/baeldung/jackson/unknownproperties/MyDtoIgnoreUnknown.java rename to jackson-simple/src/main/java/com/baeldung/jackson/unknownproperties/MyDtoIgnoreUnknown.java diff --git a/jackson-modules/jackson-simple/src/main/resources/logback.xml b/jackson-simple/src/main/resources/logback.xml similarity index 100% rename from jackson-modules/jackson-simple/src/main/resources/logback.xml rename to jackson-simple/src/main/resources/logback.xml diff --git a/jackson-modules/jackson-simple/src/test/java/com/baeldung/jackson/annotation/JacksonAnnotationUnitTest.java b/jackson-simple/src/test/java/com/baeldung/jackson/annotation/JacksonAnnotationUnitTest.java similarity index 100% rename from jackson-modules/jackson-simple/src/test/java/com/baeldung/jackson/annotation/JacksonAnnotationUnitTest.java rename to jackson-simple/src/test/java/com/baeldung/jackson/annotation/JacksonAnnotationUnitTest.java diff --git a/jackson-modules/jackson-simple/src/test/java/com/baeldung/jackson/ignore/IgnoreFieldsWithFilterUnitTest.java b/jackson-simple/src/test/java/com/baeldung/jackson/ignore/IgnoreFieldsWithFilterUnitTest.java similarity index 100% rename from jackson-modules/jackson-simple/src/test/java/com/baeldung/jackson/ignore/IgnoreFieldsWithFilterUnitTest.java rename to jackson-simple/src/test/java/com/baeldung/jackson/ignore/IgnoreFieldsWithFilterUnitTest.java diff --git a/jackson-modules/jackson-simple/src/test/java/com/baeldung/jackson/ignore/JacksonSerializationIgnoreUnitTest.java b/jackson-simple/src/test/java/com/baeldung/jackson/ignore/JacksonSerializationIgnoreUnitTest.java similarity index 100% rename from jackson-modules/jackson-simple/src/test/java/com/baeldung/jackson/ignore/JacksonSerializationIgnoreUnitTest.java rename to jackson-simple/src/test/java/com/baeldung/jackson/ignore/JacksonSerializationIgnoreUnitTest.java diff --git a/jackson-modules/jackson-simple/src/test/java/com/baeldung/jackson/ignorenullfields/IgnoreNullFieldsUnitTest.java b/jackson-simple/src/test/java/com/baeldung/jackson/ignorenullfields/IgnoreNullFieldsUnitTest.java similarity index 100% rename from jackson-modules/jackson-simple/src/test/java/com/baeldung/jackson/ignorenullfields/IgnoreNullFieldsUnitTest.java rename to jackson-simple/src/test/java/com/baeldung/jackson/ignorenullfields/IgnoreNullFieldsUnitTest.java diff --git a/jackson-modules/jackson-simple/src/test/java/com/baeldung/jackson/jsonproperty/JsonPropertyUnitTest.java b/jackson-simple/src/test/java/com/baeldung/jackson/jsonproperty/JsonPropertyUnitTest.java similarity index 100% rename from jackson-modules/jackson-simple/src/test/java/com/baeldung/jackson/jsonproperty/JsonPropertyUnitTest.java rename to jackson-simple/src/test/java/com/baeldung/jackson/jsonproperty/JsonPropertyUnitTest.java diff --git a/jackson-modules/jackson-simple/src/test/java/com/baeldung/jackson/objectmapper/JavaReadWriteJsonExampleUnitTest.java b/jackson-simple/src/test/java/com/baeldung/jackson/objectmapper/JavaReadWriteJsonExampleUnitTest.java similarity index 100% rename from jackson-modules/jackson-simple/src/test/java/com/baeldung/jackson/objectmapper/JavaReadWriteJsonExampleUnitTest.java rename to jackson-simple/src/test/java/com/baeldung/jackson/objectmapper/JavaReadWriteJsonExampleUnitTest.java diff --git a/jackson-modules/jackson-simple/src/test/java/com/baeldung/jackson/objectmapper/SerializationDeserializationFeatureUnitTest.java b/jackson-simple/src/test/java/com/baeldung/jackson/objectmapper/SerializationDeserializationFeatureUnitTest.java similarity index 100% rename from jackson-modules/jackson-simple/src/test/java/com/baeldung/jackson/objectmapper/SerializationDeserializationFeatureUnitTest.java rename to jackson-simple/src/test/java/com/baeldung/jackson/objectmapper/SerializationDeserializationFeatureUnitTest.java diff --git a/jackson-modules/jackson-simple/src/test/java/com/baeldung/jackson/unknownproperties/UnknownPropertiesUnitTest.java b/jackson-simple/src/test/java/com/baeldung/jackson/unknownproperties/UnknownPropertiesUnitTest.java similarity index 100% rename from jackson-modules/jackson-simple/src/test/java/com/baeldung/jackson/unknownproperties/UnknownPropertiesUnitTest.java rename to jackson-simple/src/test/java/com/baeldung/jackson/unknownproperties/UnknownPropertiesUnitTest.java diff --git a/jackson-modules/jackson-simple/src/test/resources/json_car.json b/jackson-simple/src/test/resources/json_car.json similarity index 100% rename from jackson-modules/jackson-simple/src/test/resources/json_car.json rename to jackson-simple/src/test/resources/json_car.json diff --git a/java-ee-8-security-api/README.md b/java-ee-8-security-api/README.md index b01a073e35..17142f8102 100644 --- a/java-ee-8-security-api/README.md +++ b/java-ee-8-security-api/README.md @@ -4,4 +4,4 @@ This module contains articles about the Security API in Java EE 8. ### Relevant articles - - [Java EE 8 Security API](https://www.baeldung.com/java-ee-8-security) + - [Jakarta EE 8 Security API](https://www.baeldung.com/java-ee-8-security) diff --git a/java-numbers-2/README.md b/java-numbers-2/README.md index e200c4aa03..2d0d5443b1 100644 --- a/java-numbers-2/README.md +++ b/java-numbers-2/README.md @@ -15,4 +15,5 @@ This module contains articles about numbers in Java. - [Binary Numbers in Java](https://www.baeldung.com/java-binary-numbers) - [Generating Random Numbers in a Range in Java](https://www.baeldung.com/java-generating-random-numbers) - [Listing Numbers Within a Range in Java](https://www.baeldung.com/java-listing-numbers-within-a-range) +- [Fibonacci Series in Java](https://www.baeldung.com/java-fibonacci) - More articles: [[<-- prev]](/../java-numbers) diff --git a/java-numbers-3/pom.xml b/java-numbers-3/pom.xml index e3c64064c7..bf5fe9b0e7 100644 --- a/java-numbers-3/pom.xml +++ b/java-numbers-3/pom.xml @@ -17,7 +17,7 @@ it.unimi.dsi dsiutils - 2.6.0 + ${dsiutils.version} @@ -31,4 +31,8 @@ + + 2.6.0 + + diff --git a/javax-servlets/README.md b/javax-servlets/README.md index 085cc04f87..7dbe1a02ad 100644 --- a/javax-servlets/README.md +++ b/javax-servlets/README.md @@ -9,6 +9,6 @@ This module contains articles about Servlets. - [Uploading Files with Servlets and JSP](https://www.baeldung.com/upload-file-servlet) - [Example of Downloading File in a Servlet](https://www.baeldung.com/servlet-download-file) - [Returning a JSON Response from a Servlet](https://www.baeldung.com/servlet-json-response) -- [Java EE Servlet Exception Handling](https://www.baeldung.com/servlet-exceptions) +- [Jakarta EE Servlet Exception Handling](https://www.baeldung.com/servlet-exceptions) - [Context and Servlet Initialization Parameters](https://www.baeldung.com/context-servlet-initialization-param) - [The Difference between getRequestURI and getPathInfo in HttpServletRequest](https://www.baeldung.com/http-servlet-request-requesturi-pathinfo) diff --git a/jee-7-security/README.md b/jee-7-security/README.md index ced2beec46..0d95d81474 100644 --- a/jee-7-security/README.md +++ b/jee-7-security/README.md @@ -3,4 +3,4 @@ This module contains articles about security in JEE 7. ### Relevant Articles: -- [Securing Java EE with Spring Security](https://www.baeldung.com/java-ee-spring-security) +- [Securing Jakarta EE with Spring Security](https://www.baeldung.com/java-ee-spring-security) diff --git a/jee-7/README.md b/jee-7/README.md index 2c45fe2c67..adaee67d74 100644 --- a/jee-7/README.md +++ b/jee-7/README.md @@ -3,7 +3,7 @@ This module contains articles about JEE 7. ### Relevant Articles: -- [Scheduling in Java EE](https://www.baeldung.com/scheduling-in-java-enterprise-edition) +- [Scheduling in Jakarta EE](https://www.baeldung.com/scheduling-in-java-enterprise-edition) - [JSON Processing in Java EE 7](https://www.baeldung.com/jee7-json) - [Converters, Listeners and Validators in Java EE 7](https://www.baeldung.com/java-ee7-converter-listener-validator) - [Introduction to JAX-WS](https://www.baeldung.com/jax-ws) diff --git a/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleBatchLetUnitTest.java b/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleBatchLetUnitTest.java index ade492b1b9..3babf9b5aa 100644 --- a/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleBatchLetUnitTest.java +++ b/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleBatchLetUnitTest.java @@ -1,13 +1,17 @@ package com.baeldung.batch.understanding; -import static org.junit.jupiter.api.Assertions.*; -import java.util.Properties; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + import javax.batch.operations.JobOperator; import javax.batch.runtime.BatchRuntime; import javax.batch.runtime.BatchStatus; import javax.batch.runtime.JobExecution; -import org.junit.jupiter.api.Test; +import java.util.Properties; +import static org.junit.jupiter.api.Assertions.assertEquals; + +@Disabled("Should be fixed in BAEL-3812") class SimpleBatchLetUnitTest { @Test public void givenBatchLet_thenBatch_CompleteWithSuccess() throws Exception { diff --git a/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleErrorChunkUnitTest.java b/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleErrorChunkUnitTest.java index ded31b6345..c53561a0c0 100644 --- a/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleErrorChunkUnitTest.java +++ b/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleErrorChunkUnitTest.java @@ -1,21 +1,19 @@ package com.baeldung.batch.understanding; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -import java.util.List; -import java.util.Map; -import java.util.Properties; import javax.batch.operations.JobOperator; import javax.batch.runtime.BatchRuntime; import javax.batch.runtime.BatchStatus; import javax.batch.runtime.JobExecution; -import javax.batch.runtime.Metric.MetricType; import javax.batch.runtime.StepExecution; +import java.util.List; +import java.util.Properties; -import org.junit.jupiter.api.Test; +import static org.junit.Assert.assertEquals; +@Disabled("Should be fixed in BAEL-3812") class SimpleErrorChunkUnitTest { @Test diff --git a/jee-kotlin/README.md b/jee-kotlin/README.md index aa3aa58b4e..e8975a7f62 100644 --- a/jee-kotlin/README.md +++ b/jee-kotlin/README.md @@ -3,4 +3,4 @@ This module contains articles about Java EE with Kotlin. ### Relevant Articles: -- [Java EE Application with Kotlin](https://www.baeldung.com/java-ee-kotlin-app) +- [Jakarta EE Application with Kotlin](https://www.baeldung.com/java-ee-kotlin-app) diff --git a/jhipster/jhipster-uaa/quotes/pom.xml b/jhipster/jhipster-uaa/quotes/pom.xml index 81ab23471f..aacc6f8e36 100644 --- a/jhipster/jhipster-uaa/quotes/pom.xml +++ b/jhipster/jhipster-uaa/quotes/pom.xml @@ -232,7 +232,7 @@ org.zalando problem-spring-web - 0.24.0-RC.0 + ${zalando.version} org.springframework.security.oauth @@ -910,5 +910,6 @@ ${project.basedir}/src/test/ + 0.24.0-RC.0 diff --git a/json-2/README.md b/json-2/README.md new file mode 100644 index 0000000000..e7c3043339 --- /dev/null +++ b/json-2/README.md @@ -0,0 +1,5 @@ +## JSON + +This module contains articles about JSON. + +### Relevant Articles: diff --git a/json-2/pom.xml b/json-2/pom.xml new file mode 100644 index 0000000000..72b3295b2b --- /dev/null +++ b/json-2/pom.xml @@ -0,0 +1,41 @@ + + + com.baeldung + json-2 + 0.0.1-SNAPSHOT + + + parent-modules + com.baeldung + 1.0.0-SNAPSHOT + + 4.0.0 + + + + com.jsoniter + jsoniter + ${jsoniter.version} + + + + junit + junit + ${junit.version} + test + + + + org.assertj + assertj-core + ${assertj-core.version} + test + + + + 0.9.23 + 3.11.1 + + diff --git a/json-2/src/main/java/com/baeldung/jsoniter/model/Name.java b/json-2/src/main/java/com/baeldung/jsoniter/model/Name.java new file mode 100644 index 0000000000..ed5e221235 --- /dev/null +++ b/json-2/src/main/java/com/baeldung/jsoniter/model/Name.java @@ -0,0 +1,22 @@ +package com.baeldung.jsoniter.model; + +public class Name { + private String firstName; + private String surname; + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getSurname() { + return surname; + } + + public void setSurname(String surname) { + this.surname = surname; + } +} diff --git a/json-2/src/main/java/com/baeldung/jsoniter/model/Student.java b/json-2/src/main/java/com/baeldung/jsoniter/model/Student.java new file mode 100644 index 0000000000..07c73dd18e --- /dev/null +++ b/json-2/src/main/java/com/baeldung/jsoniter/model/Student.java @@ -0,0 +1,26 @@ +package com.baeldung.jsoniter.model; + +import com.jsoniter.annotation.JsonProperty; +import com.jsoniter.fuzzy.MaybeStringIntDecoder; + +public class Student { + @JsonProperty(decoder = MaybeStringIntDecoder.class) + private int id; + private Name name; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public Name getName() { + return name; + } + + public void setName(Name name) { + this.name = name; + } +} diff --git a/json-2/src/test/java/com/baeldung/jsoniter/JsoniterIntroUnitTest.java b/json-2/src/test/java/com/baeldung/jsoniter/JsoniterIntroUnitTest.java new file mode 100644 index 0000000000..09f82567a2 --- /dev/null +++ b/json-2/src/test/java/com/baeldung/jsoniter/JsoniterIntroUnitTest.java @@ -0,0 +1,85 @@ +package com.baeldung.jsoniter; + +import com.baeldung.jsoniter.model.Name; +import com.baeldung.jsoniter.model.Student; +import com.jsoniter.JsonIterator; +import com.jsoniter.ValueType; +import com.jsoniter.any.Any; + +import org.junit.Test; + +import static com.jsoniter.ValueType.STRING; +import static org.assertj.core.api.Assertions.assertThat; + +public class JsoniterIntroUnitTest { + + @Test + public void whenParsedUsingBindAPI_thenConvertedToJavaObjectCorrectly() { + String input = "{\"id\":1,\"name\":{\"firstName\":\"Joe\",\"surname\":\"Blogg\"}}"; + + Student student = JsonIterator.deserialize(input, Student.class); + + assertThat(student.getId()).isEqualTo(1); + assertThat(student.getName().getFirstName()).isEqualTo("Joe"); + assertThat(student.getName().getSurname()).isEqualTo("Blogg"); + } + + @Test + public void givenTypeInJsonFuzzy_whenFieldIsMaybeDecoded_thenFieldParsedCorrectly() { + String input = "{\"id\":\"1\",\"name\":{\"firstName\":\"Joe\",\"surname\":\"Blogg\"}}"; + + Student student = JsonIterator.deserialize(input, Student.class); + + assertThat(student.getId()).isEqualTo(1); + } + + @Test + public void whenParsedUsingAnyAPI_thenFieldValueCanBeExtractedUsingTheFieldName() { + String input = "{\"id\":1,\"name\":{\"firstName\":\"Joe\",\"surname\":\"Blogg\"}}"; + + Any any = JsonIterator.deserialize(input); + + assertThat(any.toInt("id")).isEqualTo(1); + assertThat(any.toString("name", "firstName")).isEqualTo("Joe"); + assertThat(any.toString("name", "surname")).isEqualTo("Blogg"); + } + + @Test + public void whenParsedUsingAnyAPI_thenFieldValueTypeIsCorrect() { + String input = "{\"id\":1,\"name\":{\"firstName\":\"Joe\",\"surname\":\"Blogg\"}}"; + + Any any = JsonIterator.deserialize(input); + + assertThat(any.get("id").valueType()).isEqualTo(ValueType.NUMBER); + assertThat(any.get("name").valueType()).isEqualTo(ValueType.OBJECT); + assertThat(any.get("error").valueType()).isEqualTo(ValueType.INVALID); + } + + @Test + public void whenParsedUsingIteratorAPI_thenFieldValuesExtractedCorrectly() throws Exception { + Name name = new Name(); + String input = "{ \"firstName\" : \"Joe\", \"surname\" : \"Blogg\" }"; + JsonIterator iterator = JsonIterator.parse(input); + + for (String field = iterator.readObject(); field != null; field = iterator.readObject()) { + switch (field) { + case "firstName": + if (iterator.whatIsNext() == ValueType.STRING) { + name.setFirstName(iterator.readString()); + } + continue; + case "surname": + if (iterator.whatIsNext() == ValueType.STRING) { + name.setSurname(iterator.readString()); + } + continue; + default: + iterator.skip(); + } + } + + assertThat(name.getFirstName()).isEqualTo("Joe"); + assertThat(name.getSurname()).isEqualTo("Blogg"); + } + +} diff --git a/json-2/src/test/resources/Student.json b/json-2/src/test/resources/Student.json new file mode 100644 index 0000000000..7ff3351e8e --- /dev/null +++ b/json-2/src/test/resources/Student.json @@ -0,0 +1 @@ +{"id":1,"name":{"firstName": "Joe", "surname":"Blogg"}} diff --git a/jta/README.md b/jta/README.md index 0351177a0d..202019118d 100644 --- a/jta/README.md +++ b/jta/README.md @@ -3,4 +3,4 @@ This module contains articles about the Java Transaction API (JTA). ### Relevant Articles: -- [Guide to Java EE JTA](https://www.baeldung.com/jee-jta) +- [Guide to Jakarta EE JTA](https://www.baeldung.com/jee-jta) diff --git a/kotlin-libraries-2/README.md b/kotlin-libraries-2/README.md index 4064ef67d8..f725048acd 100644 --- a/kotlin-libraries-2/README.md +++ b/kotlin-libraries-2/README.md @@ -8,4 +8,7 @@ This module contains articles about Kotlin Libraries. - [Introduction to RxKotlin](https://www.baeldung.com/rxkotlin) - [MockK: A Mocking Library for Kotlin](https://www.baeldung.com/kotlin-mockk) - [Kotlin Immutable Collections](https://www.baeldung.com/kotlin-immutable-collections) +- [Dependency Injection for Kotlin with Injekt](https://www.baeldung.com/kotlin-dependency-injection-with-injekt) +- [Fuel HTTP Library with Kotlin](https://www.baeldung.com/kotlin-fuel) +- [Introduction to Kovenant Library for Kotlin](https://www.baeldung.com/kotlin-kovenant) - More articles: [[<-- prev]](/kotlin-libraries) diff --git a/kotlin-libraries-2/pom.xml b/kotlin-libraries-2/pom.xml index 518142403e..254f2c6907 100644 --- a/kotlin-libraries-2/pom.xml +++ b/kotlin-libraries-2/pom.xml @@ -21,7 +21,7 @@ io.reactivex.rxjava2 rxkotlin - 2.3.0 + ${rxkotlin.version} junit @@ -39,6 +39,37 @@ kotlinx-collections-immutable ${kotlinx-collections-immutable.version} + + uy.kohesive.injekt + injekt-core + ${injekt-core.version} + + + com.github.kittinunf.fuel + fuel + ${fuel.version} + + + com.github.kittinunf.fuel + fuel-gson + ${fuel.version} + + + com.github.kittinunf.fuel + fuel-rxjava + ${fuel.version} + + + com.github.kittinunf.fuel + fuel-coroutines + ${fuel.version} + + + nl.komponents.kovenant + kovenant + ${kovenant.version} + pom + io.mockk @@ -49,9 +80,13 @@ + 1.16.1 + 1.15.0 + 3.3.0 27.1-jre 1.9.3 0.1 + 2.3.0 diff --git a/core-kotlin/src/main/kotlin/com/baeldung/fuel/Interceptors.kt b/kotlin-libraries-2/src/main/kotlin/com/baeldung/fuel/Interceptors.kt similarity index 100% rename from core-kotlin/src/main/kotlin/com/baeldung/fuel/Interceptors.kt rename to kotlin-libraries-2/src/main/kotlin/com/baeldung/fuel/Interceptors.kt diff --git a/core-kotlin/src/main/kotlin/com/baeldung/fuel/Post.kt b/kotlin-libraries-2/src/main/kotlin/com/baeldung/fuel/Post.kt similarity index 100% rename from core-kotlin/src/main/kotlin/com/baeldung/fuel/Post.kt rename to kotlin-libraries-2/src/main/kotlin/com/baeldung/fuel/Post.kt diff --git a/core-kotlin/src/main/kotlin/com/baeldung/fuel/PostRoutingAPI.kt b/kotlin-libraries-2/src/main/kotlin/com/baeldung/fuel/PostRoutingAPI.kt similarity index 100% rename from core-kotlin/src/main/kotlin/com/baeldung/fuel/PostRoutingAPI.kt rename to kotlin-libraries-2/src/main/kotlin/com/baeldung/fuel/PostRoutingAPI.kt diff --git a/core-kotlin/src/main/kotlin/com/baeldung/injekt/DelegateInjectionApplication.kt b/kotlin-libraries-2/src/main/kotlin/com/baeldung/injekt/DelegateInjectionApplication.kt similarity index 100% rename from core-kotlin/src/main/kotlin/com/baeldung/injekt/DelegateInjectionApplication.kt rename to kotlin-libraries-2/src/main/kotlin/com/baeldung/injekt/DelegateInjectionApplication.kt diff --git a/core-kotlin/src/main/kotlin/com/baeldung/injekt/KeyedApplication.kt b/kotlin-libraries-2/src/main/kotlin/com/baeldung/injekt/KeyedApplication.kt similarity index 80% rename from core-kotlin/src/main/kotlin/com/baeldung/injekt/KeyedApplication.kt rename to kotlin-libraries-2/src/main/kotlin/com/baeldung/injekt/KeyedApplication.kt index 744459b7fe..4205678981 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/injekt/KeyedApplication.kt +++ b/kotlin-libraries-2/src/main/kotlin/com/baeldung/injekt/KeyedApplication.kt @@ -1,8 +1,12 @@ package com.baeldung.injekt import org.slf4j.LoggerFactory -import uy.kohesive.injekt.* -import uy.kohesive.injekt.api.* +import uy.kohesive.injekt.Injekt +import uy.kohesive.injekt.InjektMain +import uy.kohesive.injekt.api.InjektRegistrar +import uy.kohesive.injekt.api.addPerKeyFactory +import uy.kohesive.injekt.api.addSingletonFactory +import uy.kohesive.injekt.api.get class KeyedApplication { companion object : InjektMain() { diff --git a/core-kotlin/src/main/kotlin/com/baeldung/injekt/ModularApplication.kt b/kotlin-libraries-2/src/main/kotlin/com/baeldung/injekt/ModularApplication.kt similarity index 94% rename from core-kotlin/src/main/kotlin/com/baeldung/injekt/ModularApplication.kt rename to kotlin-libraries-2/src/main/kotlin/com/baeldung/injekt/ModularApplication.kt index e802f3f6d5..96a0c9556a 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/injekt/ModularApplication.kt +++ b/kotlin-libraries-2/src/main/kotlin/com/baeldung/injekt/ModularApplication.kt @@ -1,7 +1,8 @@ package com.baeldung.injekt import org.slf4j.LoggerFactory -import uy.kohesive.injekt.* +import uy.kohesive.injekt.Injekt +import uy.kohesive.injekt.InjektMain import uy.kohesive.injekt.api.* class ModularApplication { diff --git a/core-kotlin/src/main/kotlin/com/baeldung/injekt/PerThreadApplication.kt b/kotlin-libraries-2/src/main/kotlin/com/baeldung/injekt/PerThreadApplication.kt similarity index 84% rename from core-kotlin/src/main/kotlin/com/baeldung/injekt/PerThreadApplication.kt rename to kotlin-libraries-2/src/main/kotlin/com/baeldung/injekt/PerThreadApplication.kt index a42f314349..f3167bc223 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/injekt/PerThreadApplication.kt +++ b/kotlin-libraries-2/src/main/kotlin/com/baeldung/injekt/PerThreadApplication.kt @@ -1,8 +1,12 @@ package com.baeldung.injekt import org.slf4j.LoggerFactory -import uy.kohesive.injekt.* -import uy.kohesive.injekt.api.* +import uy.kohesive.injekt.Injekt +import uy.kohesive.injekt.InjektMain +import uy.kohesive.injekt.api.InjektRegistrar +import uy.kohesive.injekt.api.addPerThreadFactory +import uy.kohesive.injekt.api.addSingletonFactory +import uy.kohesive.injekt.api.get import java.util.* import java.util.concurrent.Executors import java.util.concurrent.TimeUnit diff --git a/core-kotlin/src/main/kotlin/com/baeldung/injekt/SimpleApplication.kt b/kotlin-libraries-2/src/main/kotlin/com/baeldung/injekt/SimpleApplication.kt similarity index 75% rename from core-kotlin/src/main/kotlin/com/baeldung/injekt/SimpleApplication.kt rename to kotlin-libraries-2/src/main/kotlin/com/baeldung/injekt/SimpleApplication.kt index 2b07cd059f..5c2dc28ba5 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/injekt/SimpleApplication.kt +++ b/kotlin-libraries-2/src/main/kotlin/com/baeldung/injekt/SimpleApplication.kt @@ -1,8 +1,12 @@ package com.baeldung.injekt import org.slf4j.LoggerFactory -import uy.kohesive.injekt.* -import uy.kohesive.injekt.api.* +import uy.kohesive.injekt.Injekt +import uy.kohesive.injekt.InjektMain +import uy.kohesive.injekt.api.InjektRegistrar +import uy.kohesive.injekt.api.addSingleton +import uy.kohesive.injekt.api.addSingletonFactory +import uy.kohesive.injekt.api.get class SimpleApplication { companion object : InjektMain() { diff --git a/core-kotlin/src/test/kotlin/com/baeldung/fuel/FuelHttpUnitTest.kt b/kotlin-libraries-2/src/test/kotlin/com/baeldung/fuel/FuelHttpUnitTest.kt similarity index 100% rename from core-kotlin/src/test/kotlin/com/baeldung/fuel/FuelHttpUnitTest.kt rename to kotlin-libraries-2/src/test/kotlin/com/baeldung/fuel/FuelHttpUnitTest.kt diff --git a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/KovenantTest.kt b/kotlin-libraries-2/src/test/kotlin/com/baeldung/kovenant/KovenantTest.kt similarity index 99% rename from core-kotlin/src/test/kotlin/com/baeldung/kotlin/KovenantTest.kt rename to kotlin-libraries-2/src/test/kotlin/com/baeldung/kovenant/KovenantTest.kt index 469118f0f6..046b7380f7 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/KovenantTest.kt +++ b/kotlin-libraries-2/src/test/kotlin/com/baeldung/kovenant/KovenantTest.kt @@ -1,4 +1,4 @@ -package com.baeldung.kotlin +package com.baeldung.kovenant import nl.komponents.kovenant.* import nl.komponents.kovenant.Kovenant.deferred @@ -12,6 +12,7 @@ import java.util.* import java.util.concurrent.TimeUnit class KovenantTest { + @Before fun setupTestMode() { Kovenant.testMode { error -> diff --git a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/KovenantTimeoutTest.kt b/kotlin-libraries-2/src/test/kotlin/com/baeldung/kovenant/KovenantTimeoutTest.kt similarity index 96% rename from core-kotlin/src/test/kotlin/com/baeldung/kotlin/KovenantTimeoutTest.kt rename to kotlin-libraries-2/src/test/kotlin/com/baeldung/kovenant/KovenantTimeoutTest.kt index e37d2cc2fa..d98f9c538f 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/KovenantTimeoutTest.kt +++ b/kotlin-libraries-2/src/test/kotlin/com/baeldung/kovenant/KovenantTimeoutTest.kt @@ -1,4 +1,4 @@ -package com.baeldung.kotlin +package com.baeldung.kovenant import nl.komponents.kovenant.Promise import nl.komponents.kovenant.any diff --git a/kotlin-libraries/README.md b/kotlin-libraries/README.md index 99a57c8293..570bf9b1e5 100644 --- a/kotlin-libraries/README.md +++ b/kotlin-libraries/README.md @@ -10,7 +10,6 @@ This module contains articles about Kotlin Libraries. - [Writing Specifications with Kotlin and Spek](https://www.baeldung.com/kotlin-spek) - [Processing JSON with Kotlin and Klaxson](https://www.baeldung.com/kotlin-json-klaxson) - [Guide to the Kotlin Exposed Framework](https://www.baeldung.com/kotlin-exposed-persistence) -- [Working with Dates in Kotlin](https://www.baeldung.com/kotlin-dates) - [Introduction to Arrow in Kotlin](https://www.baeldung.com/kotlin-arrow) - [Kotlin with Ktor](https://www.baeldung.com/kotlin-ktor) - [REST API With Kotlin and Kovert](https://www.baeldung.com/kotlin-kovert) diff --git a/kotlin-quasar/pom.xml b/kotlin-quasar/pom.xml index f5fbce6ed7..ec37fa8059 100644 --- a/kotlin-quasar/pom.xml +++ b/kotlin-quasar/pom.xml @@ -48,7 +48,7 @@ junit junit - 4.12 + ${junit.version} @@ -148,6 +148,7 @@ 3.1.1 2.22.1 1.3.2 + 4.12 diff --git a/libraries-2/README.md b/libraries-2/README.md index 95c454edbb..eb45a3e426 100644 --- a/libraries-2/README.md +++ b/libraries-2/README.md @@ -18,7 +18,7 @@ Remember, for advanced libraries like [Jackson](/jackson) and [JUnit](/testing-m - [Key Value Store with Chronicle Map](https://www.baeldung.com/java-chronicle-map) - [Guide to MapDB](https://www.baeldung.com/mapdb) - [A Guide to Apache Mesos](https://www.baeldung.com/apache-mesos) -- [JasperReports with Spring](https://www.baeldung.com/spring-jasper)] +- [JasperReports with Spring](https://www.baeldung.com/spring-jasper) - [Jetty ReactiveStreams HTTP Client](https://www.baeldung.com/jetty-reactivestreams-http-client) - More articles [[<-- prev]](/libraries) diff --git a/libraries-3/pom.xml b/libraries-3/pom.xml index 6942aa736d..1dbe6b2435 100644 --- a/libraries-3/pom.xml +++ b/libraries-3/pom.xml @@ -8,8 +8,9 @@ com.baeldung - parent-modules - 1.0.0-SNAPSHOT + parent-boot-2 + 0.0.1-SNAPSHOT + ../parent-boot-2 @@ -23,16 +24,75 @@ lombok ${lombok.version} + + + org.springframework.boot + spring-boot-starter-web + + + + net.sourceforge.barbecue + barbecue + ${barbecue.version} + + + + net.sf.barcode4j + barcode4j + ${barcode4j.version} + + + + com.google.zxing + core + ${zxing.version} + + + com.google.zxing + javase + ${zxing.version} + + + + com.github.kenglxn.qrgen + javase + ${qrgen.version} + + + com.github.rvesse + airline + ${airline.version} + org.cactoos cactoos ${cactoos.version} + + org.cache2k + cache2k-base-bom + ${cache2k.version} + pom + + + + jitpack.io + https://jitpack.io + + + 1.78 1.18.6 + 1.5-beta1 + 2.1 + 3.3.0 + 2.6.0 + 0.43 + 2.7.2 + 1.2.3.Final - \ No newline at end of file + diff --git a/libraries-3/src/main/java/com/baeldung/airline/CommandLine.java b/libraries-3/src/main/java/com/baeldung/airline/CommandLine.java new file mode 100644 index 0000000000..b4c3fc9b9e --- /dev/null +++ b/libraries-3/src/main/java/com/baeldung/airline/CommandLine.java @@ -0,0 +1,17 @@ +package com.baeldung.airline; + +import com.github.rvesse.airline.annotations.Cli; +import com.github.rvesse.airline.help.Help; + +@Cli(name = "baeldung-cli", +description = "Baeldung Airline Tutorial", +defaultCommand = Help.class, +commands = { DatabaseSetupCommand.class, LoggingCommand.class, Help.class }) +public class CommandLine { + + public static void main(String[] args) { + com.github.rvesse.airline.Cli cli = new com.github.rvesse.airline.Cli<>(CommandLine.class); + Runnable cmd = cli.parse(args); + cmd.run(); + } +} diff --git a/libraries-3/src/main/java/com/baeldung/airline/DatabaseSetupCommand.java b/libraries-3/src/main/java/com/baeldung/airline/DatabaseSetupCommand.java new file mode 100644 index 0000000000..bf67fa33b6 --- /dev/null +++ b/libraries-3/src/main/java/com/baeldung/airline/DatabaseSetupCommand.java @@ -0,0 +1,77 @@ +package com.baeldung.airline; + +import java.util.ArrayList; +import java.util.List; + +import javax.inject.Inject; + +import com.github.rvesse.airline.HelpOption; +import com.github.rvesse.airline.annotations.Command; +import com.github.rvesse.airline.annotations.Option; +import com.github.rvesse.airline.annotations.OptionType; +import com.github.rvesse.airline.annotations.restrictions.AllowedRawValues; +import com.github.rvesse.airline.annotations.restrictions.MutuallyExclusiveWith; +import com.github.rvesse.airline.annotations.restrictions.Pattern; +import com.github.rvesse.airline.annotations.restrictions.RequiredOnlyIf; + +@Command(name = "setup-db", description = "Setup our database") +public class DatabaseSetupCommand implements Runnable { + @Inject + private HelpOption help; + + @Option(type = OptionType.COMMAND, + name = {"-d", "--database"}, + description = "Type of RDBMS.", + title = "RDBMS type: mysql|postgresql|mongodb") + @AllowedRawValues(allowedValues = { "mysql", "postgres", "mongodb" }) + protected String rdbmsMode = "mysql"; + + @Option(type = OptionType.COMMAND, + name = {"--rdbms:url", "--url"}, + description = "URL to use for connection to RDBMS.", + title = "RDBMS URL") + @MutuallyExclusiveWith(tag="mode") + @Pattern(pattern="^(http://.*):(d*)(.*)u=(.*)&p=(.*)") + protected String rdbmsUrl = ""; + + @Option(type = OptionType.COMMAND, + name = {"--rdbms:host", "--host"}, + description = "Host to use for connection to RDBMS.", + title = "RDBMS host") + @MutuallyExclusiveWith(tag="mode") + protected String rdbmsHost = ""; + + @RequiredOnlyIf(names={"--rdbms:host", "--host"}) + @Option(type = OptionType.COMMAND, + name = {"--rdbms:user", "-u", "--user"}, + description = "User for login to RDBMS.", + title = "RDBMS user") + protected String rdbmsUser; + + @RequiredOnlyIf(names={"--rdbms:host", "--host"}) + @Option(type = OptionType.COMMAND, + name = {"--rdbms:password", "--password"}, + description = "Password for login to RDBMS.", + title = "RDBMS password") + protected String rdbmsPassword; + + @Option(type = OptionType.COMMAND, + name = {"--driver", "--jars"}, + description = "List of drivers", + title = "--driver --driver ") + protected List jars = new ArrayList<>(); + + @Override + public void run() { + //skipping store our choices... + if (!help.showHelpIfRequested()) { + if(!"".equals(rdbmsHost)) { + System.out.println("Connecting to database host: " + rdbmsHost); + System.out.println("Credential: " + rdbmsUser + " / " + rdbmsPassword); + } else { + System.out.println("Connecting to database url: " + rdbmsUrl); + } + System.out.println(jars.toString()); + } + } +} diff --git a/libraries-3/src/main/java/com/baeldung/airline/LoggingCommand.java b/libraries-3/src/main/java/com/baeldung/airline/LoggingCommand.java new file mode 100644 index 0000000000..4a269f87fd --- /dev/null +++ b/libraries-3/src/main/java/com/baeldung/airline/LoggingCommand.java @@ -0,0 +1,24 @@ +package com.baeldung.airline; + +import javax.inject.Inject; + +import com.github.rvesse.airline.HelpOption; +import com.github.rvesse.airline.annotations.Command; +import com.github.rvesse.airline.annotations.Option; + +@Command(name = "setup-log", description = "Setup our log") +public class LoggingCommand implements Runnable { + + @Inject + private HelpOption help; + + @Option(name = { "-v", "--verbose" }, description = "Set log verbosity on/off") + private boolean verbose = false; + + @Override + public void run() { + //skipping store user choice + if (!help.showHelpIfRequested()) + System.out.println("Verbosity: " + verbose); + } +} diff --git a/libraries-3/src/main/java/com/baeldung/barcodes/BarcodesController.java b/libraries-3/src/main/java/com/baeldung/barcodes/BarcodesController.java new file mode 100644 index 0000000000..171d703621 --- /dev/null +++ b/libraries-3/src/main/java/com/baeldung/barcodes/BarcodesController.java @@ -0,0 +1,99 @@ +package com.baeldung.barcodes; + +import com.baeldung.barcodes.generators.BarbecueBarcodeGenerator; +import com.baeldung.barcodes.generators.Barcode4jBarcodeGenerator; +import com.baeldung.barcodes.generators.QRGenBarcodeGenerator; +import com.baeldung.barcodes.generators.ZxingBarcodeGenerator; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.awt.image.BufferedImage; + +@RestController +@RequestMapping("/barcodes") +public class BarcodesController { + + //Barbecue library + + @GetMapping(value = "/barbecue/upca/{barcode}", produces = MediaType.IMAGE_PNG_VALUE) + public ResponseEntity barbecueUPCABarcode(@PathVariable("barcode") String barcode) throws Exception { + return okResponse(BarbecueBarcodeGenerator.generateUPCABarcodeImage(barcode)); + } + + @GetMapping(value = "/barbecue/ean13/{barcode}", produces = MediaType.IMAGE_PNG_VALUE) + public ResponseEntity barbecueEAN13Barcode(@PathVariable("barcode") String barcode) throws Exception { + return okResponse(BarbecueBarcodeGenerator.generateEAN13BarcodeImage(barcode)); + } + + @PostMapping(value = "/barbecue/code128", produces = MediaType.IMAGE_PNG_VALUE) + public ResponseEntity barbecueCode128Barcode(@RequestBody String barcode) throws Exception { + return okResponse(BarbecueBarcodeGenerator.generateCode128BarcodeImage(barcode)); + } + + @PostMapping(value = "/barbecue/pdf417", produces = MediaType.IMAGE_PNG_VALUE) + public ResponseEntity barbecuePDF417Barcode(@RequestBody String barcode) throws Exception { + return okResponse(BarbecueBarcodeGenerator.generatePDF417BarcodeImage(barcode)); + } + + //Barcode4j library + + @GetMapping(value = "/barcode4j/upca/{barcode}", produces = MediaType.IMAGE_PNG_VALUE) + public ResponseEntity barcode4jUPCABarcode(@PathVariable("barcode") String barcode) { + return okResponse(Barcode4jBarcodeGenerator.generateUPCABarcodeImage(barcode)); + } + + @GetMapping(value = "/barcode4j/ean13/{barcode}", produces = MediaType.IMAGE_PNG_VALUE) + public ResponseEntity barcode4jEAN13Barcode(@PathVariable("barcode") String barcode) { + return okResponse(Barcode4jBarcodeGenerator.generateEAN13BarcodeImage(barcode)); + } + + @PostMapping(value = "/barcode4j/code128", produces = MediaType.IMAGE_PNG_VALUE) + public ResponseEntity barcode4jCode128Barcode(@RequestBody String barcode) { + return okResponse(Barcode4jBarcodeGenerator.generateCode128BarcodeImage(barcode)); + } + + @PostMapping(value = "/barcode4j/pdf417", produces = MediaType.IMAGE_PNG_VALUE) + public ResponseEntity barcode4jPDF417Barcode(@RequestBody String barcode) { + return okResponse(Barcode4jBarcodeGenerator.generatePDF417BarcodeImage(barcode)); + } + + //Zxing library + + @GetMapping(value = "/zxing/upca/{barcode}", produces = MediaType.IMAGE_PNG_VALUE) + public ResponseEntity zxingUPCABarcode(@PathVariable("barcode") String barcode) throws Exception { + return okResponse(ZxingBarcodeGenerator.generateUPCABarcodeImage(barcode)); + } + + @GetMapping(value = "/zxing/ean13/{barcode}", produces = MediaType.IMAGE_PNG_VALUE) + public ResponseEntity zxingEAN13Barcode(@PathVariable("barcode") String barcode) throws Exception { + return okResponse(ZxingBarcodeGenerator.generateEAN13BarcodeImage(barcode)); + } + + @PostMapping(value = "/zxing/code128", produces = MediaType.IMAGE_PNG_VALUE) + public ResponseEntity zxingCode128Barcode(@RequestBody String barcode) throws Exception { + return okResponse(ZxingBarcodeGenerator.generateCode128BarcodeImage(barcode)); + } + + @PostMapping(value = "/zxing/pdf417", produces = MediaType.IMAGE_PNG_VALUE) + public ResponseEntity zxingPDF417Barcode(@RequestBody String barcode) throws Exception { + return okResponse(ZxingBarcodeGenerator.generatePDF417BarcodeImage(barcode)); + } + + @PostMapping(value = "/zxing/qrcode", produces = MediaType.IMAGE_PNG_VALUE) + public ResponseEntity zxingQRCode(@RequestBody String barcode) throws Exception { + return okResponse(ZxingBarcodeGenerator.generateQRCodeImage(barcode)); + } + + //QRGen + + @PostMapping(value = "/qrgen/qrcode", produces = MediaType.IMAGE_PNG_VALUE) + public ResponseEntity qrgenQRCode(@RequestBody String barcode) throws Exception { + return okResponse(QRGenBarcodeGenerator.generateQRCodeImage(barcode)); + } + + private ResponseEntity okResponse(BufferedImage image) { + return new ResponseEntity<>(image, HttpStatus.OK); + } +} diff --git a/libraries-3/src/main/java/com/baeldung/barcodes/SpringBootApp.java b/libraries-3/src/main/java/com/baeldung/barcodes/SpringBootApp.java new file mode 100644 index 0000000000..991b3b11ce --- /dev/null +++ b/libraries-3/src/main/java/com/baeldung/barcodes/SpringBootApp.java @@ -0,0 +1,23 @@ +package com.baeldung.barcodes; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.http.converter.BufferedImageHttpMessageConverter; +import org.springframework.http.converter.HttpMessageConverter; + +import java.awt.image.BufferedImage; + +@SpringBootApplication +public class SpringBootApp { + + public static void main(String[] args) { + SpringApplication.run(SpringBootApp.class, args); + } + + @Bean + public HttpMessageConverter createImageHttpMessageConverter() { + return new BufferedImageHttpMessageConverter(); + } + +} diff --git a/libraries-3/src/main/java/com/baeldung/barcodes/generators/BarbecueBarcodeGenerator.java b/libraries-3/src/main/java/com/baeldung/barcodes/generators/BarbecueBarcodeGenerator.java new file mode 100644 index 0000000000..353f824d98 --- /dev/null +++ b/libraries-3/src/main/java/com/baeldung/barcodes/generators/BarbecueBarcodeGenerator.java @@ -0,0 +1,43 @@ +package com.baeldung.barcodes.generators; + +import net.sourceforge.barbecue.Barcode; +import net.sourceforge.barbecue.BarcodeFactory; +import net.sourceforge.barbecue.BarcodeImageHandler; + +import java.awt.*; +import java.awt.image.BufferedImage; + +public class BarbecueBarcodeGenerator { + + private static final Font BARCODE_TEXT_FONT = new Font(Font.SANS_SERIF, Font.PLAIN, 14); + + public static BufferedImage generateUPCABarcodeImage(String barcodeText) throws Exception { + Barcode barcode = BarcodeFactory.createUPCA(barcodeText); //checksum is automatically added + barcode.setFont(BARCODE_TEXT_FONT); + barcode.setResolution(400); + + return BarcodeImageHandler.getImage(barcode); + } + + public static BufferedImage generateEAN13BarcodeImage(String barcodeText) throws Exception { + Barcode barcode = BarcodeFactory.createEAN13(barcodeText); //checksum is automatically added + barcode.setFont(BARCODE_TEXT_FONT); + + return BarcodeImageHandler.getImage(barcode); + } + + public static BufferedImage generateCode128BarcodeImage(String barcodeText) throws Exception { + Barcode barcode = BarcodeFactory.createCode128(barcodeText); + barcode.setFont(BARCODE_TEXT_FONT); + + return BarcodeImageHandler.getImage(barcode); + } + + public static BufferedImage generatePDF417BarcodeImage(String barcodeText) throws Exception { + Barcode barcode = BarcodeFactory.createPDF417(barcodeText); + barcode.setFont(BARCODE_TEXT_FONT); + + return BarcodeImageHandler.getImage(barcode); + } + +} diff --git a/libraries-3/src/main/java/com/baeldung/barcodes/generators/Barcode4jBarcodeGenerator.java b/libraries-3/src/main/java/com/baeldung/barcodes/generators/Barcode4jBarcodeGenerator.java new file mode 100644 index 0000000000..a2fee044e5 --- /dev/null +++ b/libraries-3/src/main/java/com/baeldung/barcodes/generators/Barcode4jBarcodeGenerator.java @@ -0,0 +1,46 @@ +package com.baeldung.barcodes.generators; + +import org.krysalis.barcode4j.impl.code128.Code128Bean; +import org.krysalis.barcode4j.impl.pdf417.PDF417Bean; +import org.krysalis.barcode4j.impl.upcean.EAN13Bean; +import org.krysalis.barcode4j.impl.upcean.UPCABean; +import org.krysalis.barcode4j.output.bitmap.BitmapCanvasProvider; + +import java.awt.image.BufferedImage; + +public class Barcode4jBarcodeGenerator { + + public static BufferedImage generateUPCABarcodeImage(String barcodeText) { + UPCABean barcodeGenerator = new UPCABean(); + BitmapCanvasProvider canvas = new BitmapCanvasProvider(160, BufferedImage.TYPE_BYTE_BINARY, false, 0); + + barcodeGenerator.generateBarcode(canvas, barcodeText); + return canvas.getBufferedImage(); + } + + public static BufferedImage generateEAN13BarcodeImage(String barcodeText) { + EAN13Bean barcodeGenerator = new EAN13Bean(); + BitmapCanvasProvider canvas = new BitmapCanvasProvider(160, BufferedImage.TYPE_BYTE_BINARY, false, 0); + + barcodeGenerator.generateBarcode(canvas, barcodeText); + return canvas.getBufferedImage(); + } + + public static BufferedImage generateCode128BarcodeImage(String barcodeText) { + Code128Bean barcodeGenerator = new Code128Bean(); + BitmapCanvasProvider canvas = new BitmapCanvasProvider(160, BufferedImage.TYPE_BYTE_BINARY, false, 0); + + barcodeGenerator.generateBarcode(canvas, barcodeText); + return canvas.getBufferedImage(); + } + + public static BufferedImage generatePDF417BarcodeImage(String barcodeText) { + PDF417Bean barcodeGenerator = new PDF417Bean(); + BitmapCanvasProvider canvas = new BitmapCanvasProvider(160, BufferedImage.TYPE_BYTE_BINARY, false, 0); + barcodeGenerator.setColumns(10); + + barcodeGenerator.generateBarcode(canvas, barcodeText); + return canvas.getBufferedImage(); + } + +} diff --git a/libraries-3/src/main/java/com/baeldung/barcodes/generators/QRGenBarcodeGenerator.java b/libraries-3/src/main/java/com/baeldung/barcodes/generators/QRGenBarcodeGenerator.java new file mode 100644 index 0000000000..46d17ac500 --- /dev/null +++ b/libraries-3/src/main/java/com/baeldung/barcodes/generators/QRGenBarcodeGenerator.java @@ -0,0 +1,21 @@ +package com.baeldung.barcodes.generators; + +import net.glxn.qrgen.javase.QRCode; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; + +public class QRGenBarcodeGenerator { + + public static BufferedImage generateQRCodeImage(String barcodeText) throws Exception { + ByteArrayOutputStream stream = QRCode + .from(barcodeText) + .withSize(250, 250) + .stream(); + ByteArrayInputStream bis = new ByteArrayInputStream(stream.toByteArray()); + + return ImageIO.read(bis); + } +} diff --git a/libraries-3/src/main/java/com/baeldung/barcodes/generators/ZxingBarcodeGenerator.java b/libraries-3/src/main/java/com/baeldung/barcodes/generators/ZxingBarcodeGenerator.java new file mode 100644 index 0000000000..e9aa2975da --- /dev/null +++ b/libraries-3/src/main/java/com/baeldung/barcodes/generators/ZxingBarcodeGenerator.java @@ -0,0 +1,51 @@ +package com.baeldung.barcodes.generators; + +import com.google.zxing.BarcodeFormat; +import com.google.zxing.client.j2se.MatrixToImageWriter; +import com.google.zxing.common.BitMatrix; +import com.google.zxing.oned.Code128Writer; +import com.google.zxing.oned.EAN13Writer; +import com.google.zxing.oned.UPCAWriter; +import com.google.zxing.pdf417.PDF417Writer; +import com.google.zxing.qrcode.QRCodeWriter; + +import java.awt.image.BufferedImage; + +public class ZxingBarcodeGenerator { + + public static BufferedImage generateUPCABarcodeImage(String barcodeText) throws Exception { + UPCAWriter barcodeWriter = new UPCAWriter(); + BitMatrix bitMatrix = barcodeWriter.encode(barcodeText, BarcodeFormat.UPC_A, 300, 150); + + return MatrixToImageWriter.toBufferedImage(bitMatrix); + } + + public static BufferedImage generateEAN13BarcodeImage(String barcodeText) throws Exception { + EAN13Writer barcodeWriter = new EAN13Writer(); + BitMatrix bitMatrix = barcodeWriter.encode(barcodeText, BarcodeFormat.EAN_13, 300, 150); + + return MatrixToImageWriter.toBufferedImage(bitMatrix); + } + + public static BufferedImage generateCode128BarcodeImage(String barcodeText) throws Exception { + Code128Writer barcodeWriter = new Code128Writer(); + BitMatrix bitMatrix = barcodeWriter.encode(barcodeText, BarcodeFormat.CODE_128, 300, 150); + + return MatrixToImageWriter.toBufferedImage(bitMatrix); + } + + public static BufferedImage generatePDF417BarcodeImage(String barcodeText) throws Exception { + PDF417Writer barcodeWriter = new PDF417Writer(); + BitMatrix bitMatrix = barcodeWriter.encode(barcodeText, BarcodeFormat.PDF_417, 700, 700); + + return MatrixToImageWriter.toBufferedImage(bitMatrix); + } + + public static BufferedImage generateQRCodeImage(String barcodeText) throws Exception { + QRCodeWriter barcodeWriter = new QRCodeWriter(); + BitMatrix bitMatrix = barcodeWriter.encode(barcodeText, BarcodeFormat.QR_CODE, 200, 200); + + return MatrixToImageWriter.toBufferedImage(bitMatrix); + } + +} \ No newline at end of file diff --git a/libraries-3/src/main/java/com/baeldung/cache2k/ProductHelper.java b/libraries-3/src/main/java/com/baeldung/cache2k/ProductHelper.java new file mode 100644 index 0000000000..dc984e5f0b --- /dev/null +++ b/libraries-3/src/main/java/com/baeldung/cache2k/ProductHelper.java @@ -0,0 +1,41 @@ +package com.baeldung.cache2k; + +import java.util.Objects; + +import org.cache2k.Cache; +import org.cache2k.Cache2kBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ProductHelper { + + final Logger LOGGER = LoggerFactory.getLogger(ProductHelper.class); + + private Cache cachedDiscounts; + + public ProductHelper() { + cachedDiscounts = Cache2kBuilder.of(String.class, Integer.class) + .name("discount") + .eternal(true) + .entryCapacity(100) + .build(); + + initDiscountCache("Sports", 20); + } + + public void initDiscountCache(String productType, Integer value) { + cachedDiscounts.put(productType, value); + } + + public Integer getDiscount(String productType) { + Integer discount = cachedDiscounts.get(productType); + if (Objects.isNull(discount)) { + LOGGER.info("Discount for {} not found.", productType); + discount = 0; + } else { + LOGGER.info("Discount for {} found.", productType); + } + return discount; + } + +} diff --git a/libraries-3/src/main/java/com/baeldung/cache2k/ProductHelperUsingLoader.java b/libraries-3/src/main/java/com/baeldung/cache2k/ProductHelperUsingLoader.java new file mode 100644 index 0000000000..787a78cd36 --- /dev/null +++ b/libraries-3/src/main/java/com/baeldung/cache2k/ProductHelperUsingLoader.java @@ -0,0 +1,41 @@ +package com.baeldung.cache2k; + +import java.util.Objects; +import java.util.concurrent.TimeUnit; + +import org.cache2k.Cache; +import org.cache2k.Cache2kBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ProductHelperUsingLoader { + + final Logger LOGGER = LoggerFactory.getLogger(ProductHelperUsingLoader.class); + + private Cache cachedDiscounts; + + public ProductHelperUsingLoader() { + cachedDiscounts = Cache2kBuilder.of(String.class, Integer.class) + .name("discount-loader") + .eternal(false) + .expireAfterWrite(10, TimeUnit.MILLISECONDS) + .entryCapacity(100) + .loader((key) -> { + LOGGER.info("Calculating discount for {}.", key); + return "Sports".equalsIgnoreCase(key) ? 20 : 10; + }) + .build(); + } + + public Integer getDiscount(String productType) { + Integer discount = cachedDiscounts.get(productType); + if (Objects.isNull(discount)) { + LOGGER.info("Discount for {} not found.", productType); + discount = 0; + } else { + LOGGER.info("Discount for {} found.", productType); + } + return discount; + } + +} diff --git a/libraries-3/src/main/java/com/baeldung/cache2k/ProductHelperWithEventListener.java b/libraries-3/src/main/java/com/baeldung/cache2k/ProductHelperWithEventListener.java new file mode 100644 index 0000000000..5b9eb28c68 --- /dev/null +++ b/libraries-3/src/main/java/com/baeldung/cache2k/ProductHelperWithEventListener.java @@ -0,0 +1,49 @@ +package com.baeldung.cache2k; + +import java.util.Objects; +import java.util.concurrent.TimeUnit; + +import org.cache2k.Cache; +import org.cache2k.Cache2kBuilder; +import org.cache2k.CacheEntry; +import org.cache2k.event.CacheEntryCreatedListener; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ProductHelperWithEventListener { + + final Logger LOGGER = LoggerFactory.getLogger(ProductHelperWithEventListener.class); + + private Cache cachedDiscounts; + + public ProductHelperWithEventListener() { + cachedDiscounts = Cache2kBuilder.of(String.class, Integer.class) + .name("discount-listener") + .eternal(false) + .expireAfterWrite(10, TimeUnit.MILLISECONDS) + .entryCapacity(100) + .loader((key) -> { + LOGGER.info("Calculating discount for {}.", key); + return "Sports".equalsIgnoreCase(key) ? 20 : 10; + }) + .addListener(new CacheEntryCreatedListener() { + @Override + public void onEntryCreated(Cache cache, CacheEntry entry) { + LOGGER.info("Entry created: [{}, {}].", entry.getKey(), entry.getValue()); + } + }) + .build(); + } + + public Integer getDiscount(String productType) { + Integer discount = cachedDiscounts.get(productType); + if (Objects.isNull(discount)) { + LOGGER.info("Discount for {} not found.", productType); + discount = 0; + } else { + LOGGER.info("Discount for {} found.", productType); + } + return discount; + } + +} diff --git a/libraries-3/src/main/java/com/baeldung/cache2k/ProductHelperWithExpiry.java b/libraries-3/src/main/java/com/baeldung/cache2k/ProductHelperWithExpiry.java new file mode 100644 index 0000000000..b0bf8f90de --- /dev/null +++ b/libraries-3/src/main/java/com/baeldung/cache2k/ProductHelperWithExpiry.java @@ -0,0 +1,43 @@ +package com.baeldung.cache2k; + +import java.util.Objects; +import java.util.concurrent.TimeUnit; + +import org.cache2k.Cache; +import org.cache2k.Cache2kBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ProductHelperWithExpiry { + + final Logger LOGGER = LoggerFactory.getLogger(ProductHelperWithExpiry.class); + + private Cache cachedDiscounts; + + public ProductHelperWithExpiry() { + cachedDiscounts = Cache2kBuilder.of(String.class, Integer.class) + .name("discount-expiry") + .eternal(false) + .expireAfterWrite(5, TimeUnit.MILLISECONDS) + .entryCapacity(100) + .build(); + + initDiscountCache("Sports", 20); + } + + public void initDiscountCache(String productType, Integer value) { + cachedDiscounts.put(productType, value); + } + + public Integer getDiscount(String productType) { + Integer discount = cachedDiscounts.get(productType); + if (Objects.isNull(discount)) { + LOGGER.info("Discount for {} not found.", productType); + discount = 0; + } else { + LOGGER.info("Discount for {} found.", productType); + } + return discount; + } + +} diff --git a/libraries-3/src/test/java/com/baeldung/cache2k/ProductHelperUnitTest.java b/libraries-3/src/test/java/com/baeldung/cache2k/ProductHelperUnitTest.java new file mode 100644 index 0000000000..69da2591dd --- /dev/null +++ b/libraries-3/src/test/java/com/baeldung/cache2k/ProductHelperUnitTest.java @@ -0,0 +1,17 @@ +package com.baeldung.cache2k; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class ProductHelperUnitTest { + + ProductHelper productHelper = new ProductHelper(); + + @Test + public void whenInvokedGetDiscount_thenGetItFromCache() { + assertTrue(productHelper.getDiscount("Sports") == 20); + assertTrue(productHelper.getDiscount("Electronics") == 0); + } + +} diff --git a/libraries-3/src/test/java/com/baeldung/cache2k/ProductHelperUsingLoaderUnitTest.java b/libraries-3/src/test/java/com/baeldung/cache2k/ProductHelperUsingLoaderUnitTest.java new file mode 100644 index 0000000000..2656e75cab --- /dev/null +++ b/libraries-3/src/test/java/com/baeldung/cache2k/ProductHelperUsingLoaderUnitTest.java @@ -0,0 +1,17 @@ +package com.baeldung.cache2k; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class ProductHelperUsingLoaderUnitTest { + + ProductHelperUsingLoader productHelper = new ProductHelperUsingLoader(); + + @Test + public void whenInvokedGetDiscount_thenPopulateCache() { + assertTrue(productHelper.getDiscount("Sports") == 20); + assertTrue(productHelper.getDiscount("Electronics") == 10); + } + +} diff --git a/libraries-3/src/test/java/com/baeldung/cache2k/ProductHelperWithEventListenerUnitTest.java b/libraries-3/src/test/java/com/baeldung/cache2k/ProductHelperWithEventListenerUnitTest.java new file mode 100644 index 0000000000..7bf08232f4 --- /dev/null +++ b/libraries-3/src/test/java/com/baeldung/cache2k/ProductHelperWithEventListenerUnitTest.java @@ -0,0 +1,16 @@ +package com.baeldung.cache2k; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class ProductHelperWithEventListenerUnitTest { + + ProductHelperWithEventListener productHelper = new ProductHelperWithEventListener(); + + @Test + public void whenEntryAddedInCache_thenEventListenerCalled() { + assertTrue(productHelper.getDiscount("Sports") == 20); + } + +} diff --git a/libraries-3/src/test/java/com/baeldung/cache2k/ProductHelperWithExpiryUnitTest.java b/libraries-3/src/test/java/com/baeldung/cache2k/ProductHelperWithExpiryUnitTest.java new file mode 100644 index 0000000000..65feba2c70 --- /dev/null +++ b/libraries-3/src/test/java/com/baeldung/cache2k/ProductHelperWithExpiryUnitTest.java @@ -0,0 +1,18 @@ +package com.baeldung.cache2k; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class ProductHelperWithExpiryUnitTest { + + ProductHelperWithExpiry productHelper = new ProductHelperWithExpiry(); + + @Test + public void whenInvokedGetDiscountForExpiredProduct_thenNoDiscount() throws InterruptedException { + assertTrue(productHelper.getDiscount("Sports") == 20); + Thread.sleep(20); + assertTrue(productHelper.getDiscount("Sports") == 0); + } + +} diff --git a/libraries-http/README.md b/libraries-http/README.md index f5afb2d277..1f065a9d4a 100644 --- a/libraries-http/README.md +++ b/libraries-http/README.md @@ -12,3 +12,5 @@ This module contains articles about HTTP libraries. - [Introduction to Retrofit](https://www.baeldung.com/retrofit) - [A Guide to Unirest](https://www.baeldung.com/unirest) - [Creating REST Microservices with Javalin](https://www.baeldung.com/javalin-rest-microservices) +- [A Quick Guide to Timeouts in OkHttp](https://www.baeldung.com/okhttp-timeouts) +- [A Quick Guide to Post Requests with OkHttp](https://www.baeldung.com/okhttp-post) diff --git a/libraries-security/README.md b/libraries-security/README.md index 819bc866cf..580ebdeab0 100644 --- a/libraries-security/README.md +++ b/libraries-security/README.md @@ -9,4 +9,4 @@ This module contains articles about security libraries. - [Guide to Google Tink](https://www.baeldung.com/google-tink) - [Introduction to BouncyCastle with Java](https://www.baeldung.com/java-bouncy-castle) - [Intro to Jasypt](https://www.baeldung.com/jasypt) -- [Digital Signature in Java](https://www.baeldung.com/java-digital-signature) +- [Digital Signatures in Java](https://www.baeldung.com/java-digital-signature) diff --git a/maven-all/maven-custom-plugin/README.md b/maven-all/maven-custom-plugin/README.md new file mode 100644 index 0000000000..55d147c337 --- /dev/null +++ b/maven-all/maven-custom-plugin/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [How to Create a Maven Plugin](https://www.baeldung.com/maven-plugin) diff --git a/maven-all/maven/proxy/README.md b/maven-all/maven/proxy/README.md new file mode 100644 index 0000000000..9ae1fd6ad5 --- /dev/null +++ b/maven-all/maven/proxy/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Using Maven Behind a Proxy](https://www.baeldung.com/maven-behind-proxy) diff --git a/maven-all/profiles/pom.xml b/maven-all/profiles/pom.xml index 01b191c7d6..4ae6d1ee40 100644 --- a/maven-all/profiles/pom.xml +++ b/maven-all/profiles/pom.xml @@ -73,7 +73,7 @@ org.apache.maven.plugins maven-help-plugin - 3.2.0 + ${help.plugin.version} show-profiles @@ -87,4 +87,8 @@ + + 3.2.0 + + \ No newline at end of file diff --git a/maven-all/versions-maven-plugin/original/pom.xml b/maven-all/versions-maven-plugin/original/pom.xml index c6c1657b25..54140aec9b 100644 --- a/maven-all/versions-maven-plugin/original/pom.xml +++ b/maven-all/versions-maven-plugin/original/pom.xml @@ -46,7 +46,7 @@ org.codehaus.mojo versions-maven-plugin - 2.7 + ${versions.plugin.version} org.apache.commons:commons-collections4 @@ -76,6 +76,7 @@ 4.0 3.0 1.9.1 + 2.7 \ No newline at end of file diff --git a/netflix-modules/genie/pom.xml b/netflix-modules/genie/pom.xml index 835bbf2b50..2c7c04b26b 100644 --- a/netflix-modules/genie/pom.xml +++ b/netflix-modules/genie/pom.xml @@ -3,7 +3,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 genie - 1.0.0-SNAPSHOT Genie jar Sample project for Netflix Genie diff --git a/netflix-modules/pom.xml b/netflix-modules/pom.xml index 5a082e8f1a..9ed22498d8 100644 --- a/netflix-modules/pom.xml +++ b/netflix-modules/pom.xml @@ -3,7 +3,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 netflix-modules - 1.0.0-SNAPSHOT Netflix Modules pom Module for Netflix projects diff --git a/ninja/README.md b/ninja/README.md new file mode 100644 index 0000000000..554d088c1b --- /dev/null +++ b/ninja/README.md @@ -0,0 +1,3 @@ +### Relevant Articles + +- [Introduction to Ninja Framework](https://www.baeldung.com/ninja-framework-intro) diff --git a/ninja/pom.xml b/ninja/pom.xml index b66225f693..afb1d509b8 100644 --- a/ninja/pom.xml +++ b/ninja/pom.xml @@ -16,6 +16,12 @@ 3.3.4 2.1.3 1.4.186 + 3.2 + 1.8 + 1.8 + 1.3.1 + 2.8.2 + 2.2 @@ -23,16 +29,16 @@ org.apache.maven.plugins maven-compiler-plugin - 3.2 + ${compiler.plugin.version} - 1.8 - 1.8 + ${source.version} + ${target.version} org.apache.maven.plugins maven-enforcer-plugin - 1.3.1 + ${enforcer.plugin.version} enforce-banned-dependencies @@ -95,7 +101,7 @@ org.apache.maven.plugins maven-deploy-plugin - 2.8.2 + ${deploy.plugin.version} true @@ -103,7 +109,7 @@ org.apache.maven.plugins maven-shade-plugin - 2.2 + ${shade.plugin.version} true diff --git a/oauth2-framework-impl/README.md b/oauth2-framework-impl/README.md index ea9686b451..ae28c1b511 100644 --- a/oauth2-framework-impl/README.md +++ b/oauth2-framework-impl/README.md @@ -4,4 +4,4 @@ This module contains articles about the implementation of OAuth2 with Java EE. ### Relevant Articles -- [Implementing The OAuth 2.0 Authorization Framework Using Java EE](https://www.baeldung.com/java-ee-oauth2-implementation) +- [Implementing The OAuth 2.0 Authorization Framework Using Jakarta EE](https://www.baeldung.com/java-ee-oauth2-implementation) diff --git a/open-liberty/pom.xml b/open-liberty/pom.xml new file mode 100644 index 0000000000..d6588ce49a --- /dev/null +++ b/open-liberty/pom.xml @@ -0,0 +1,130 @@ + + + 4.0.0 + + com.baeldung + open-liberty + 1.0-SNAPSHOT + war + + + + jakarta.platform + jakarta.jakartaee-web-api + ${version.jakarta.jakartaee-web-api} + provided + + + org.eclipse.microprofile + microprofile + ${version.microprofile} + pom + provided + + + org.apache.derby + derby + ${version.derby} + + + + + junit + junit + ${version.junit} + test + + + org.eclipse + yasson + ${version.yasson} + test + + + org.apache.cxf + cxf-rt-rs-client + ${version.cxf-rt-rs-client} + test + + + org.glassfish + javax.json + ${version.javax.json} + test + + + org.apache.cxf + cxf-rt-rs-mp-client + ${version.cxf-rt-rs-mp-client} + test + + + + + ${project.artifactId} + + + + io.openliberty.tools + liberty-maven-plugin + ${version.liberty-maven-plugin} + + + org.apache.maven.plugins + maven-dependency-plugin + ${version.maven-dependency-plugin} + + + copy-derby-dependency + package + + copy-dependencies + + + derby + ${project.build.directory}/liberty/wlp/usr/shared/resources/ + + ${testServerHttpPort} + + + + + + + org.apache.maven.plugins + maven-war-plugin + ${version.maven-war-plugin} + + + + + + + 1.8 + 1.8 + UTF-8 + UTF-8 + false + + + 8.0.0 + 3.2 + 10.14.2.0 + 3.1 + 2.10 + 3.2.3 + 4.12 + 1.0.5 + 3.2.6 + 1.0.4 + 3.3.1 + + + openliberty + 9080 + 9443 + 7070 + + \ No newline at end of file diff --git a/open-liberty/src/main/java/com/baeldung/openliberty/person/dao/PersonDao.java b/open-liberty/src/main/java/com/baeldung/openliberty/person/dao/PersonDao.java new file mode 100644 index 0000000000..e2d408d8b0 --- /dev/null +++ b/open-liberty/src/main/java/com/baeldung/openliberty/person/dao/PersonDao.java @@ -0,0 +1,24 @@ +package com.baeldung.openliberty.person.dao; + +import javax.enterprise.context.RequestScoped; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; + +import com.baeldung.openliberty.person.model.Person; + +@RequestScoped +public class PersonDao { + + @PersistenceContext(name = "jpa-unit") + private EntityManager em; + + public Person createPerson(Person person) { + em.persist(person); + return person; + } + + public Person readPerson(int personId) { + return em.find(Person.class, personId); + } + +} \ No newline at end of file diff --git a/open-liberty/src/main/java/com/baeldung/openliberty/person/model/Person.java b/open-liberty/src/main/java/com/baeldung/openliberty/person/model/Person.java new file mode 100644 index 0000000000..79e8c16911 --- /dev/null +++ b/open-liberty/src/main/java/com/baeldung/openliberty/person/model/Person.java @@ -0,0 +1,58 @@ +package com.baeldung.openliberty.person.model; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.Email; +import javax.validation.constraints.NotBlank; + +@Entity +public class Person { + + @GeneratedValue(strategy = GenerationType.AUTO) + @Id + private int id; + + private String username; + private String email; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public Person(int id, @NotBlank String username, @Email String email) { + super(); + this.id = id; + this.username = username; + this.email = email; + } + + public Person() { + super(); + } + + public String toString() { + return this.id + ":" +this.username; + } +} diff --git a/open-liberty/src/main/java/com/baeldung/openliberty/person/resource/PersonResource.java b/open-liberty/src/main/java/com/baeldung/openliberty/person/resource/PersonResource.java new file mode 100644 index 0000000000..0fb86860b8 --- /dev/null +++ b/open-liberty/src/main/java/com/baeldung/openliberty/person/resource/PersonResource.java @@ -0,0 +1,52 @@ +package com.baeldung.openliberty.person.resource; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import javax.enterprise.context.RequestScoped; +import javax.inject.Inject; +import javax.transaction.Transactional; +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +import com.baeldung.openliberty.person.dao.PersonDao; +import com.baeldung.openliberty.person.model.Person; + +@RequestScoped +@Path("persons") +public class PersonResource { + + @Inject + private PersonDao personDao; + + @GET + @Produces(MediaType.APPLICATION_JSON) + public List getAllPersons() { + return Arrays.asList(new Person(1, "normanlewis", "normanlewis@email.com")); + } + + @POST + @Consumes(MediaType.APPLICATION_JSON) + @Transactional + public Response addPerson(Person person) { + personDao.createPerson(person); + String respMessage = "Person #" + person.getId() + " created successfully."; + return Response.status(Response.Status.CREATED).entity(respMessage).build(); + } + + @GET + @Path("{id}") + @Produces(MediaType.APPLICATION_JSON) + @Transactional + public Person getPerson(@PathParam("id") int id) { + Person person = personDao.readPerson(id); + return person; + } +} diff --git a/open-liberty/src/main/java/com/baeldung/openliberty/rest/ApiApplication.java b/open-liberty/src/main/java/com/baeldung/openliberty/rest/ApiApplication.java new file mode 100644 index 0000000000..176eaccaed --- /dev/null +++ b/open-liberty/src/main/java/com/baeldung/openliberty/rest/ApiApplication.java @@ -0,0 +1,9 @@ +package com.baeldung.openliberty.rest; + +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.core.Application; + +@ApplicationPath("/api") +public class ApiApplication extends Application { + +} diff --git a/open-liberty/src/main/java/com/baeldung/openliberty/rest/consumes/RestConsumer.java b/open-liberty/src/main/java/com/baeldung/openliberty/rest/consumes/RestConsumer.java new file mode 100644 index 0000000000..8073c408dd --- /dev/null +++ b/open-liberty/src/main/java/com/baeldung/openliberty/rest/consumes/RestConsumer.java @@ -0,0 +1,18 @@ +package com.baeldung.openliberty.rest.consumes; + +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; +import javax.ws.rs.core.Response; + +public class RestConsumer { + + public static String consumeWithJsonb(String targetUrl) { + Client client = ClientBuilder.newClient(); + Response response = client.target(targetUrl).request().get(); + String result = response.readEntity(String.class); + response.close(); + client.close(); + return result; + } + +} diff --git a/open-liberty/src/main/java/com/baeldung/openliberty/servlet/AppServlet.java b/open-liberty/src/main/java/com/baeldung/openliberty/servlet/AppServlet.java new file mode 100644 index 0000000000..d8c8d159c4 --- /dev/null +++ b/open-liberty/src/main/java/com/baeldung/openliberty/servlet/AppServlet.java @@ -0,0 +1,27 @@ +package com.baeldung.openliberty.servlet; + +import java.io.IOException; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +@WebServlet(urlPatterns="/app") +public class AppServlet extends HttpServlet { + + private static final long serialVersionUID = 1L; + + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String htmlOutput = "

Hello! Welcome to Open Liberty

"; + response.getWriter().append(htmlOutput); + } + + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + doGet(request, response); + } +} \ No newline at end of file diff --git a/open-liberty/src/main/liberty/config/server.xml b/open-liberty/src/main/liberty/config/server.xml new file mode 100644 index 0000000000..bc99905058 --- /dev/null +++ b/open-liberty/src/main/liberty/config/server.xml @@ -0,0 +1,28 @@ + + + mpHealth-2.0 + servlet-4.0 + jaxrs-2.1 + jsonp-1.1 + jsonb-1.0 + cdi-2.0 + jpa-2.2 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/open-liberty/src/main/resources/META-INF/persistence.xml b/open-liberty/src/main/resources/META-INF/persistence.xml new file mode 100644 index 0000000000..ca8ad1a5c9 --- /dev/null +++ b/open-liberty/src/main/resources/META-INF/persistence.xml @@ -0,0 +1,14 @@ + + + + jdbc/jpadatasource + + + + + + \ No newline at end of file diff --git a/open-liberty/src/test/java/com/baeldung/openliberty/RestClientTest.java b/open-liberty/src/test/java/com/baeldung/openliberty/RestClientTest.java new file mode 100644 index 0000000000..4978483ca0 --- /dev/null +++ b/open-liberty/src/test/java/com/baeldung/openliberty/RestClientTest.java @@ -0,0 +1,40 @@ +package com.baeldung.openliberty; + +import static org.junit.Assert.assertEquals; + +import javax.json.bind.JsonbBuilder; + +import org.junit.BeforeClass; +import org.junit.Test; + +import com.baeldung.openliberty.person.model.Person; +import com.baeldung.openliberty.rest.consumes.RestConsumer; + +public class RestClientTest { + + private static String BASE_URL; + + private final String API_PERSON = "api/persons"; + + @BeforeClass + public static void oneTimeSetup() { + BASE_URL = "http://localhost:9080/"; + } + + @Test + public void testSuite() { + //run the test only when liberty server is started + //this.whenConsumeWithJsonb_thenGetPerson(); + } + + public void whenConsumeWithJsonb_thenGetPerson() { + String url = BASE_URL + API_PERSON + "/1"; + String result = RestConsumer.consumeWithJsonb(url); + + Person person = JsonbBuilder.create().fromJson(result, Person.class); + assertEquals(1, person.getId()); + assertEquals("normanlewis", person.getUsername()); + assertEquals("normanlewis@email.com", person.getEmail()); + } + +} diff --git a/osgi/pom.xml b/osgi/pom.xml index ed708e8004..afc980c8bd 100644 --- a/osgi/pom.xml +++ b/osgi/pom.xml @@ -11,7 +11,6 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - .. diff --git a/parent-boot-2/pom.xml b/parent-boot-2/pom.xml index 881a0f1d67..43911a26ad 100644 --- a/parent-boot-2/pom.xml +++ b/parent-boot-2/pom.xml @@ -79,7 +79,7 @@ 3.3.0 1.0.22.RELEASE - 2.1.9.RELEASE + 2.2.2.RELEASE diff --git a/parent-java/pom.xml b/parent-java/pom.xml index 47965fc36d..e4ec2255c6 100644 --- a/parent-java/pom.xml +++ b/parent-java/pom.xml @@ -27,11 +27,22 @@ commons-io ${commons.io.version} + + org.openjdk.jmh + jmh-core + ${jmh.version} + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh.version} + 23.0 2.6 + 1.19 diff --git a/parent-kotlin/pom.xml b/parent-kotlin/pom.xml index a180343378..abc871ca91 100644 --- a/parent-kotlin/pom.xml +++ b/parent-kotlin/pom.xml @@ -16,7 +16,7 @@ jcenter - http://jcenter.bintray.com + https://jcenter.bintray.com kotlin-ktor @@ -45,7 +45,7 @@ org.springframework.boot spring-boot-dependencies - 2.2.0.M4 + ${boot.dependencies.version} pom import @@ -215,6 +215,7 @@ 0.9.5 3.12.0 1.3.2 + 2.2.0.M4 diff --git a/parent-spring-4/pom.xml b/parent-spring-4/pom.xml index 671ca7db6b..3749c5016e 100644 --- a/parent-spring-4/pom.xml +++ b/parent-spring-4/pom.xml @@ -51,7 +51,7 @@
- 4.3.25.RELEASE + 4.3.26.RELEASE 1.6.1 diff --git a/patterns/design-patterns-architectural/pom.xml b/patterns/design-patterns-architectural/pom.xml index 81cc55aa21..d1945a1d0a 100644 --- a/patterns/design-patterns-architectural/pom.xml +++ b/patterns/design-patterns-architectural/pom.xml @@ -11,7 +11,6 @@ com.baeldung patterns 1.0.0-SNAPSHOT - .. @@ -22,11 +21,6 @@ test - - javax - javaee-api - ${javaee.version} - org.hibernate hibernate-core @@ -41,11 +35,7 @@ - UTF-8 - 1.8 - 1.8 3.9.1 - 8.0 5.2.16.Final 6.0.6 diff --git a/patterns/design-patterns-behavioral-2/pom.xml b/patterns/design-patterns-behavioral-2/pom.xml index 4cbe6e32b9..3a6d21353e 100644 --- a/patterns/design-patterns-behavioral-2/pom.xml +++ b/patterns/design-patterns-behavioral-2/pom.xml @@ -11,7 +11,6 @@ com.baeldung patterns 1.0.0-SNAPSHOT - .. @@ -24,9 +23,6 @@ - UTF-8 - 1.8 - 1.8 3.12.2 diff --git a/patterns/design-patterns-behavioral/pom.xml b/patterns/design-patterns-behavioral/pom.xml index c4ae00435e..aceaabf582 100644 --- a/patterns/design-patterns-behavioral/pom.xml +++ b/patterns/design-patterns-behavioral/pom.xml @@ -11,7 +11,6 @@ com.baeldung patterns 1.0.0-SNAPSHOT - .. @@ -41,9 +40,6 @@ - UTF-8 - 1.8 - 1.8 16.0.2 3.9.1 diff --git a/patterns/design-patterns-cloud/pom.xml b/patterns/design-patterns-cloud/pom.xml index 51f6a42f76..34defb7eac 100644 --- a/patterns/design-patterns-cloud/pom.xml +++ b/patterns/design-patterns-cloud/pom.xml @@ -9,47 +9,4 @@ design-patterns-cloud pom - - - junit - junit - ${junit.version} - test - - - org.mockito - mockito-core - ${mockito-core.version} - test - - - io.github.resilience4j - resilience4j-retry - ${resilience4j.version} - test - - - org.slf4j - slf4j-api - ${slf4j.version} - test - - - org.slf4j - slf4j-simple - ${slf4j.version} - test - - - - - UTF-8 - 1.8 - 1.8 - 4.12 - 2.27.0 - 1.7.26 - 0.16.0 - - diff --git a/patterns/design-patterns-creational/pom.xml b/patterns/design-patterns-creational/pom.xml index aa20c1c085..7c2742ade4 100644 --- a/patterns/design-patterns-creational/pom.xml +++ b/patterns/design-patterns-creational/pom.xml @@ -11,7 +11,6 @@ com.baeldung patterns 1.0.0-SNAPSHOT - .. @@ -36,10 +35,6 @@ - UTF-8 - 1.8 - 1.8 - 2.4.1 3.0.2 3.9.1 diff --git a/patterns/design-patterns-functional/pom.xml b/patterns/design-patterns-functional/pom.xml index ec37ad1e8d..e5166dc61e 100644 --- a/patterns/design-patterns-functional/pom.xml +++ b/patterns/design-patterns-functional/pom.xml @@ -11,13 +11,6 @@ com.baeldung patterns 1.0.0-SNAPSHOT - .. - - UTF-8 - 1.8 - 1.8 - - diff --git a/patterns/design-patterns-structural/pom.xml b/patterns/design-patterns-structural/pom.xml index 97e0b9b38b..c37b6845be 100644 --- a/patterns/design-patterns-structural/pom.xml +++ b/patterns/design-patterns-structural/pom.xml @@ -11,7 +11,6 @@ com.baeldung patterns 1.0.0-SNAPSHOT - .. @@ -22,10 +21,4 @@ - - UTF-8 - 1.8 - 1.8 - - diff --git a/patterns/dip/pom.xml b/patterns/dip/pom.xml index 37c980f2e3..7217c4fdcc 100644 --- a/patterns/dip/pom.xml +++ b/patterns/dip/pom.xml @@ -12,16 +12,9 @@ com.baeldung patterns 1.0.0-SNAPSHOT - .. - - junit - junit - ${junit.version} - test - org.assertj assertj-core @@ -31,9 +24,6 @@ - UTF-8 - 11 - 11 3.12.1 diff --git a/patterns/front-controller/pom.xml b/patterns/front-controller/pom.xml index 1de3b82fcd..dc10250946 100644 --- a/patterns/front-controller/pom.xml +++ b/patterns/front-controller/pom.xml @@ -10,7 +10,6 @@ com.baeldung patterns 1.0.0-SNAPSHOT - .. diff --git a/patterns/intercepting-filter/pom.xml b/patterns/intercepting-filter/pom.xml index 435c1e13cf..7f2f57b5e1 100644 --- a/patterns/intercepting-filter/pom.xml +++ b/patterns/intercepting-filter/pom.xml @@ -10,7 +10,6 @@ com.baeldung patterns 1.0.0-SNAPSHOT - .. @@ -27,15 +26,6 @@ - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - ${java.version} - ${java.version} - - org.apache.maven.plugins maven-war-plugin diff --git a/patterns/pom.xml b/patterns/pom.xml index 8a510769a9..4c17055231 100644 --- a/patterns/pom.xml +++ b/patterns/pom.xml @@ -10,21 +10,20 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - .. - front-controller - intercepting-filter design-patterns-architectural design-patterns-behavioral design-patterns-behavioral-2 + design-patterns-cloud design-patterns-creational design-patterns-functional design-patterns-structural - solid dip - design-patterns-cloud + front-controller + intercepting-filter + solid diff --git a/patterns/solid/pom.xml b/patterns/solid/pom.xml index 1b0e35339d..ad76ea89fd 100644 --- a/patterns/solid/pom.xml +++ b/patterns/solid/pom.xml @@ -11,7 +11,6 @@ com.baeldung patterns 1.0.0-SNAPSHOT - .. diff --git a/performance-tests/pom.xml b/performance-tests/pom.xml index 94588c99d4..c8cebd8a11 100644 --- a/performance-tests/pom.xml +++ b/performance-tests/pom.xml @@ -38,7 +38,7 @@ org.mapstruct mapstruct-processor - 1.2.0.Final + ${mapstruct-jdk8.version} provided @@ -93,6 +93,15 @@ Name of the benchmark Uber-JAR to generate. --> benchmarks + 3.1 + 2.2 + 2.5.1 + 2.4 + 2.9.1 + 2.6 + 3.3 + 2.2.1 + 2.17 @@ -100,7 +109,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.1 + ${compiler.plugin.version} ${javac.target} ${javac.target} @@ -117,7 +126,7 @@ org.apache.maven.plugins maven-shade-plugin - 2.2 + ${shade.plugin.version} package @@ -162,31 +171,31 @@ maven-install-plugin - 2.5.1 + ${install.version} maven-jar-plugin - 2.4 + ${jar.plugin.version} maven-javadoc-plugin - 2.9.1 + ${javadoc.plugin.version} maven-resources-plugin - 2.6 + ${resources.plugin.version} maven-site-plugin - 3.3 + ${site.plugin.version} maven-source-plugin - 2.2.1 + ${source.plugin.version} maven-surefire-plugin - 2.17 + ${surefire.plugin.version} diff --git a/performance-tests/src/main/java/com/baeldung/performancetests/MappingFrameworksPerformance.java b/performance-tests/src/main/java/com/baeldung/performancetests/MappingFrameworksPerformance.java index 1c9e4c5dc4..66251eb078 100644 --- a/performance-tests/src/main/java/com/baeldung/performancetests/MappingFrameworksPerformance.java +++ b/performance-tests/src/main/java/com/baeldung/performancetests/MappingFrameworksPerformance.java @@ -1,4 +1,4 @@ -package com.baeldung.performancetests.benchmark; +package com.baeldung.performancetests; import com.baeldung.performancetests.dozer.DozerConverter; import com.baeldung.performancetests.jmapper.JMapperConverter; diff --git a/persistence-modules/activejdbc/pom.xml b/persistence-modules/activejdbc/pom.xml index 47643cd639..84ce1c2b48 100644 --- a/persistence-modules/activejdbc/pom.xml +++ b/persistence-modules/activejdbc/pom.xml @@ -10,9 +10,8 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ @@ -41,16 +40,6 @@ - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - ${java.version} - ${java.version} - UTF-8 - - org.javalite activejdbc-instrumentation diff --git a/persistence-modules/apache-cayenne/pom.xml b/persistence-modules/apache-cayenne/pom.xml index 7c94c5ba39..d728e18b33 100644 --- a/persistence-modules/apache-cayenne/pom.xml +++ b/persistence-modules/apache-cayenne/pom.xml @@ -10,9 +10,8 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ diff --git a/persistence-modules/core-java-persistence/pom.xml b/persistence-modules/core-java-persistence/pom.xml index 80c4053743..1224523ac7 100644 --- a/persistence-modules/core-java-persistence/pom.xml +++ b/persistence-modules/core-java-persistence/pom.xml @@ -10,9 +10,8 @@ com.baeldung - parent-java - 0.0.1-SNAPSHOT - ../../parent-java + persistence-modules + 1.0.0-SNAPSHOT @@ -60,19 +59,8 @@ - - core-java-persistence - - - src/main/resources - true - - - - 42.2.5.jre7 - 8.0.15 3.10.0 2.4.0 3.2.0 diff --git a/persistence-modules/deltaspike/pom.xml b/persistence-modules/deltaspike/pom.xml index 141412654f..871bacd18b 100644 --- a/persistence-modules/deltaspike/pom.xml +++ b/persistence-modules/deltaspike/pom.xml @@ -11,9 +11,8 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ diff --git a/persistence-modules/elasticsearch/pom.xml b/persistence-modules/elasticsearch/pom.xml index 878dd5847b..654d43d622 100644 --- a/persistence-modules/elasticsearch/pom.xml +++ b/persistence-modules/elasticsearch/pom.xml @@ -9,9 +9,8 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ diff --git a/persistence-modules/hbase/pom.xml b/persistence-modules/hbase/pom.xml index 9403239fb2..f54f2d8985 100644 --- a/persistence-modules/hbase/pom.xml +++ b/persistence-modules/hbase/pom.xml @@ -7,9 +7,8 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ diff --git a/persistence-modules/hibernate-mapping/pom.xml b/persistence-modules/hibernate-mapping/pom.xml index a0a2a047e3..ac7952fa2b 100644 --- a/persistence-modules/hibernate-mapping/pom.xml +++ b/persistence-modules/hibernate-mapping/pom.xml @@ -4,14 +4,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 hibernate-mapping - 1.0.0-SNAPSHOT hibernate-mapping com.baeldung persistence-modules 1.0.0-SNAPSHOT - .. @@ -55,21 +53,11 @@ - - hibernate-mapping - - - src/main/resources - true - - - - 5.3.10.Final 3.8.0 6.0.16.Final - 3.0.1-b11 + 3.0.1-b11 1.0.3 1.3 diff --git a/persistence-modules/hibernate-mapping/src/main/java/com/baeldung/hibernate/fetchMode/Customer.java b/persistence-modules/hibernate-mapping/src/main/java/com/baeldung/hibernate/fetchMode/Customer.java index 5997602205..5589601da8 100644 --- a/persistence-modules/hibernate-mapping/src/main/java/com/baeldung/hibernate/fetchMode/Customer.java +++ b/persistence-modules/hibernate-mapping/src/main/java/com/baeldung/hibernate/fetchMode/Customer.java @@ -1,4 +1,4 @@ -package com.baeldung.fetchMode; +package com.baeldung.hibernate.fetchMode; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; diff --git a/persistence-modules/hibernate-mapping/src/main/java/com/baeldung/hibernate/fetchMode/Order.java b/persistence-modules/hibernate-mapping/src/main/java/com/baeldung/hibernate/fetchMode/Order.java index c031972830..aa9c517321 100644 --- a/persistence-modules/hibernate-mapping/src/main/java/com/baeldung/hibernate/fetchMode/Order.java +++ b/persistence-modules/hibernate-mapping/src/main/java/com/baeldung/hibernate/fetchMode/Order.java @@ -1,4 +1,4 @@ -package com.baeldung.fetchMode; +package com.baeldung.hibernate.fetchMode; import javax.persistence.*; diff --git a/persistence-modules/hibernate-ogm/pom.xml b/persistence-modules/hibernate-ogm/pom.xml index bb15881788..8f42c28eee 100644 --- a/persistence-modules/hibernate-ogm/pom.xml +++ b/persistence-modules/hibernate-ogm/pom.xml @@ -8,9 +8,8 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ @@ -33,12 +32,6 @@ ${narayana-jta.version} - - junit - junit - ${junit.version} - test - org.easytesting fest-assert @@ -47,16 +40,6 @@ - - hibernate-ogm - - - src/main/resources - true - - - - 5.4.0.Final 1.4 diff --git a/persistence-modules/hibernate5-2/README.md b/persistence-modules/hibernate5-2/README.md index c41b5307d0..330708f6d3 100644 --- a/persistence-modules/hibernate5-2/README.md +++ b/persistence-modules/hibernate5-2/README.md @@ -6,4 +6,6 @@ This module contains articles about Hibernate 5. - [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) - [JPA/Hibernate Persistence Context](https://www.baeldung.com/jpa-hibernate-persistence-context) +- [FetchMode in Hibernate](https://www.baeldung.com/hibernate-fetchmode) +- [Various Logging Levels in Hibernate](https://www.baeldung.com/hibernate-logging-levels) - [[<-- Prev]](/hibernate5) diff --git a/persistence-modules/hibernate5-2/pom.xml b/persistence-modules/hibernate5-2/pom.xml index dfee4bb81e..15d42b3244 100644 --- a/persistence-modules/hibernate5-2/pom.xml +++ b/persistence-modules/hibernate5-2/pom.xml @@ -10,16 +10,15 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ org.hibernate hibernate-core - 5.4.7.Final + ${hibernate-core.version} org.springframework.boot @@ -51,19 +50,25 @@ com.h2database h2 - 1.4.200 + ${h2.version} org.apache.commons commons-lang3 - 3.8.1 + ${commons.lang3.version} + 5.4.7.Final + 1.4.200 + 3.8.1 true 2.1.7.RELEASE + 5.4.7.Final + 1.4.200 + 3.8.1 diff --git a/persistence-modules/hibernate5/pom.xml b/persistence-modules/hibernate5/pom.xml index ec06136f9c..ffeff5ee4a 100644 --- a/persistence-modules/hibernate5/pom.xml +++ b/persistence-modules/hibernate5/pom.xml @@ -9,9 +9,8 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ @@ -41,11 +40,6 @@ geodb ${geodb.version} - - org.hibernate - hibernate-c3p0 - ${hibernate.version} - mysql mysql-connector-java @@ -66,44 +60,14 @@ jackson-databind ${jackson.version} - - net.bytebuddy - byte-buddy - ${byte-buddy.version} - - - org.hibernate - hibernate-jpamodelgen - ${hibernate.version} - - - org.openjdk.jmh - jmh-core - ${openjdk-jmh.version} - org.openjdk.jmh jmh-generator-annprocess ${openjdk-jmh.version} - - javax.xml.bind - jaxb-api - ${jaxb-api.version} - - - hibernate5 - - - src/test/resources - true - - - - geodb-repo @@ -119,8 +83,6 @@ 3.8.0 1.21 0.9 - 1.9.5 - 2.3.0 diff --git a/persistence-modules/influxdb/pom.xml b/persistence-modules/influxdb/pom.xml index 7531ad8217..23ae64dca1 100644 --- a/persistence-modules/influxdb/pom.xml +++ b/persistence-modules/influxdb/pom.xml @@ -10,9 +10,8 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ diff --git a/persistence-modules/java-cassandra/pom.xml b/persistence-modules/java-cassandra/pom.xml index 6628a393fa..54879fb321 100644 --- a/persistence-modules/java-cassandra/pom.xml +++ b/persistence-modules/java-cassandra/pom.xml @@ -3,14 +3,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 java-cassandra - 1.0.0-SNAPSHOT java-cassandra com.baeldung - parent-java - 0.0.1-SNAPSHOT - ../../parent-java + persistence-modules + 1.0.0-SNAPSHOT @@ -40,26 +38,13 @@ java-driver-query-builder ${datastax-cassandra.version} - - - io.netty - netty-handler - ${io-netty.version} - - - - java-cassandra - - 3.1.2 3.1.1.0 4.1.0 - 4.1.34.Final - 18.0 diff --git a/persistence-modules/java-cockroachdb/pom.xml b/persistence-modules/java-cockroachdb/pom.xml index 750cbfce4c..e8c6365ca3 100644 --- a/persistence-modules/java-cockroachdb/pom.xml +++ b/persistence-modules/java-cockroachdb/pom.xml @@ -8,9 +8,8 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ diff --git a/persistence-modules/java-jdbi/pom.xml b/persistence-modules/java-jdbi/pom.xml index 0d978dc164..eb0de45593 100644 --- a/persistence-modules/java-jdbi/pom.xml +++ b/persistence-modules/java-jdbi/pom.xml @@ -8,9 +8,8 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ diff --git a/persistence-modules/java-jpa-2/pom.xml b/persistence-modules/java-jpa-2/pom.xml index cc9e69fcaa..f79f6f1633 100644 --- a/persistence-modules/java-jpa-2/pom.xml +++ b/persistence-modules/java-jpa-2/pom.xml @@ -7,9 +7,8 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../pom.xml @@ -63,7 +62,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.5.1 + ${maven-compiler-plugin.version} -proc:none @@ -71,7 +70,7 @@ org.bsc.maven maven-processor-plugin - 3.3.3 + ${maven-processor-plugin.version} process @@ -91,7 +90,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.0.0 + ${build-helper-maven-plugin.version} add-source @@ -116,6 +115,9 @@ 42.2.5 2.2 3.11.1 + 3.5.1 + 3.3.3 + 3.0.0 \ No newline at end of file diff --git a/persistence-modules/java-jpa/pom.xml b/persistence-modules/java-jpa/pom.xml index a979cf7e65..762c541d96 100644 --- a/persistence-modules/java-jpa/pom.xml +++ b/persistence-modules/java-jpa/pom.xml @@ -8,9 +8,8 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../pom.xml diff --git a/persistence-modules/java-mongodb/pom.xml b/persistence-modules/java-mongodb/pom.xml index 1e59bd9064..d62240927a 100644 --- a/persistence-modules/java-mongodb/pom.xml +++ b/persistence-modules/java-mongodb/pom.xml @@ -9,9 +9,8 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ @@ -35,8 +34,6 @@ - 1.8 - 1.8 3.10.1 1.11 1.5.3 diff --git a/persistence-modules/java-mongodb/src/test/java/com/baeldung/aggregation/AggregationLiveTest.java b/persistence-modules/java-mongodb/src/test/java/com/baeldung/aggregation/AggregationLiveTest.java new file mode 100644 index 0000000000..b3f01be566 --- /dev/null +++ b/persistence-modules/java-mongodb/src/test/java/com/baeldung/aggregation/AggregationLiveTest.java @@ -0,0 +1,111 @@ +package com.baeldung.aggregation; + +import static com.mongodb.client.model.Aggregates.count; +import static com.mongodb.client.model.Aggregates.group; +import static com.mongodb.client.model.Aggregates.limit; +import static com.mongodb.client.model.Aggregates.match; +import static com.mongodb.client.model.Aggregates.out; +import static com.mongodb.client.model.Aggregates.project; +import static com.mongodb.client.model.Aggregates.sort; +import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.Arrays; + +import org.bson.Document; +import org.bson.conversions.Bson; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.mongodb.client.MongoClient; +import com.mongodb.client.MongoClients; +import com.mongodb.client.MongoCollection; +import com.mongodb.client.MongoDatabase; +import com.mongodb.client.model.Accumulators; +import com.mongodb.client.model.Filters; +import com.mongodb.client.model.Projections; +import com.mongodb.client.model.Sorts; + +public class AggregationLiveTest { + + private static final String DATABASE = "world"; + private static final String COLLECTION = "countries"; + private static final String DATASET_JSON = "/countrydata.json"; + private static MongoClient mongoClient; + private static MongoDatabase database; + private static MongoCollection collection; + + @BeforeClass + public static void setUpDB() throws IOException { + mongoClient = MongoClients.create(); + database = mongoClient.getDatabase(DATABASE); + collection = database.getCollection(COLLECTION); + + collection.drop(); + + InputStream is = AggregationLiveTest.class.getResourceAsStream(DATASET_JSON); + BufferedReader reader = new BufferedReader(new InputStreamReader(is)); + reader.lines() + .forEach(line -> collection.insertOne(Document.parse(line))); + reader.close(); + } + + @Test + public void givenCountryCollection_whenNAFTACountriesCounted_thenThree() { + Document naftaCountries = collection.aggregate(Arrays.asList(match(Filters.eq("regionalBlocs.acronym", "NAFTA")), count())) + .first(); + + assertEquals(3, naftaCountries.get("count")); + } + + @Test + public void givenCountryCollection_whenAreaSortedDescending_thenSuccess() { + + collection.aggregate(Arrays.asList(sort(Sorts.descending("area")), limit(7), out("largest_seven"))) + .toCollection(); + + MongoCollection largestSeven = database.getCollection("largest_seven"); + + assertEquals(7, largestSeven.countDocuments()); + + Document usa = largestSeven.find(Filters.eq("alpha3Code", "USA")) + .first(); + + assertNotNull(usa); + } + + @Test + public void givenCountryCollection_whenCountedRegionWise_thenMaxInAfrica() { + Document maxCountriedRegion = collection.aggregate(Arrays.asList(group("$region", Accumulators.sum("tally", 1)), sort(Sorts.descending("tally")))) + .first(); + assertTrue(maxCountriedRegion.containsValue("Africa")); + } + + @Test + public void givenCountryCollection_whenNeighborsCalculated_thenMaxIsFifteenInChina() { + Bson borderingCountriesCollection = project(Projections.fields(Projections.excludeId(), Projections.include("name"), Projections.computed("borderingCountries", Projections.computed("$size", "$borders")))); + + int maxValue = collection.aggregate(Arrays.asList(borderingCountriesCollection, group(null, Accumulators.max("max", "$borderingCountries")))) + .first() + .getInteger("max"); + + assertEquals(15, maxValue); + + Document maxNeighboredCountry = collection.aggregate(Arrays.asList(borderingCountriesCollection, match(Filters.eq("borderingCountries", maxValue)))) + .first(); + assertTrue(maxNeighboredCountry.containsValue("China")); + + } + + @AfterClass + public static void cleanUp() { + mongoClient.close(); + } + +} diff --git a/persistence-modules/java-mongodb/src/test/resources/countrydata.json b/persistence-modules/java-mongodb/src/test/resources/countrydata.json new file mode 100644 index 0000000000..81213c31e7 --- /dev/null +++ b/persistence-modules/java-mongodb/src/test/resources/countrydata.json @@ -0,0 +1,250 @@ +{"name":"Afghanistan","topLevelDomain":[".af"],"alpha2Code":"AF","alpha3Code":"AFG","callingCodes":["93"],"capital":"Kabul","altSpellings":["AF","Afġānistān"],"region":"Asia","subregion":"Southern Asia","population":27657145,"latlng":[33.0,65.0],"demonym":"Afghan","area":652230.0,"gini":27.8,"timezones":["UTC+04:30"],"borders":["IRN","PAK","TKM","UZB","TJK","CHN"],"nativeName":"افغانستان","numericCode":"004","currencies":[{"code":"AFN","name":"Afghan afghani","symbol":"؋"}],"languages":[{"iso639_1":"ps","iso639_2":"pus","name":"Pashto","nativeName":"پښتو"},{"iso639_1":"uz","iso639_2":"uzb","name":"Uzbek","nativeName":"Oʻzbek"},{"iso639_1":"tk","iso639_2":"tuk","name":"Turkmen","nativeName":"Türkmen"}],"translations":{"de":"Afghanistan","es":"Afganistán","fr":"Afghanistan","ja":"アフガニスタン","it":"Afghanistan","br":"Afeganistão","pt":"Afeganistão","nl":"Afghanistan","hr":"Afganistan","fa":"افغانستان"},"flag":"https://restcountries.eu/data/afg.svg","regionalBlocs":[{"acronym":"SAARC","name":"South Asian Association for Regional Cooperation","otherAcronyms":[],"otherNames":[]}],"cioc":"AFG"} +{"name":"Åland Islands","topLevelDomain":[".ax"],"alpha2Code":"AX","alpha3Code":"ALA","callingCodes":["358"],"capital":"Mariehamn","altSpellings":["AX","Aaland","Aland","Ahvenanmaa"],"region":"Europe","subregion":"Northern Europe","population":28875,"latlng":[60.116667,19.9],"demonym":"Ålandish","area":1580.0,"gini":null,"timezones":["UTC+02:00"],"borders":[],"nativeName":"Åland","numericCode":"248","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"sv","iso639_2":"swe","name":"Swedish","nativeName":"svenska"}],"translations":{"de":"Åland","es":"Alandia","fr":"Åland","ja":"オーランド諸島","it":"Isole Aland","br":"Ilhas de Aland","pt":"Ilhas de Aland","nl":"Ålandeilanden","hr":"Ålandski otoci","fa":"جزایر الند"},"flag":"https://restcountries.eu/data/ala.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":""} +{"name":"Albania","topLevelDomain":[".al"],"alpha2Code":"AL","alpha3Code":"ALB","callingCodes":["355"],"capital":"Tirana","altSpellings":["AL","Shqipëri","Shqipëria","Shqipnia"],"region":"Europe","subregion":"Southern Europe","population":2886026,"latlng":[41.0,20.0],"demonym":"Albanian","area":28748.0,"gini":34.5,"timezones":["UTC+01:00"],"borders":["MNE","GRC","MKD","KOS"],"nativeName":"Shqipëria","numericCode":"008","currencies":[{"code":"ALL","name":"Albanian lek","symbol":"L"}],"languages":[{"iso639_1":"sq","iso639_2":"sqi","name":"Albanian","nativeName":"Shqip"}],"translations":{"de":"Albanien","es":"Albania","fr":"Albanie","ja":"アルバニア","it":"Albania","br":"Albânia","pt":"Albânia","nl":"Albanië","hr":"Albanija","fa":"آلبانی"},"flag":"https://restcountries.eu/data/alb.svg","regionalBlocs":[{"acronym":"CEFTA","name":"Central European Free Trade Agreement","otherAcronyms":[],"otherNames":[]}],"cioc":"ALB"} +{"name":"Algeria","topLevelDomain":[".dz"],"alpha2Code":"DZ","alpha3Code":"DZA","callingCodes":["213"],"capital":"Algiers","altSpellings":["DZ","Dzayer","Algérie"],"region":"Africa","subregion":"Northern Africa","population":40400000,"latlng":[28.0,3.0],"demonym":"Algerian","area":2381741.0,"gini":35.3,"timezones":["UTC+01:00"],"borders":["TUN","LBY","NER","ESH","MRT","MLI","MAR"],"nativeName":"الجزائر","numericCode":"012","currencies":[{"code":"DZD","name":"Algerian dinar","symbol":"د.ج"}],"languages":[{"iso639_1":"ar","iso639_2":"ara","name":"Arabic","nativeName":"العربية"}],"translations":{"de":"Algerien","es":"Argelia","fr":"Algérie","ja":"アルジェリア","it":"Algeria","br":"Argélia","pt":"Argélia","nl":"Algerije","hr":"Alžir","fa":"الجزایر"},"flag":"https://restcountries.eu/data/dza.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]},{"acronym":"AL","name":"Arab League","otherAcronyms":[],"otherNames":["جامعة الدول العربية","Jāmiʻat ad-Duwal al-ʻArabīyah","League of Arab States"]}],"cioc":"ALG"} +{"name":"American Samoa","topLevelDomain":[".as"],"alpha2Code":"AS","alpha3Code":"ASM","callingCodes":["1684"],"capital":"Pago Pago","altSpellings":["AS","Amerika Sāmoa","Amelika Sāmoa","Sāmoa Amelika"],"region":"Oceania","subregion":"Polynesia","population":57100,"latlng":[-14.33333333,-170.0],"demonym":"American Samoan","area":199.0,"gini":null,"timezones":["UTC-11:00"],"borders":[],"nativeName":"American Samoa","numericCode":"016","currencies":[{"code":"USD","name":"United State Dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"sm","iso639_2":"smo","name":"Samoan","nativeName":"gagana fa'a Samoa"}],"translations":{"de":"Amerikanisch-Samoa","es":"Samoa Americana","fr":"Samoa américaines","ja":"アメリカ領サモア","it":"Samoa Americane","br":"Samoa Americana","pt":"Samoa Americana","nl":"Amerikaans Samoa","hr":"Američka Samoa","fa":"ساموآی آمریکا"},"flag":"https://restcountries.eu/data/asm.svg","regionalBlocs":[],"cioc":"ASA"} +{"name":"Andorra","topLevelDomain":[".ad"],"alpha2Code":"AD","alpha3Code":"AND","callingCodes":["376"],"capital":"Andorra la Vella","altSpellings":["AD","Principality of Andorra","Principat d'Andorra"],"region":"Europe","subregion":"Southern Europe","population":78014,"latlng":[42.5,1.5],"demonym":"Andorran","area":468.0,"gini":null,"timezones":["UTC+01:00"],"borders":["FRA","ESP"],"nativeName":"Andorra","numericCode":"020","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"ca","iso639_2":"cat","name":"Catalan","nativeName":"català"}],"translations":{"de":"Andorra","es":"Andorra","fr":"Andorre","ja":"アンドラ","it":"Andorra","br":"Andorra","pt":"Andorra","nl":"Andorra","hr":"Andora","fa":"آندورا"},"flag":"https://restcountries.eu/data/and.svg","regionalBlocs":[],"cioc":"AND"} +{"name":"Angola","topLevelDomain":[".ao"],"alpha2Code":"AO","alpha3Code":"AGO","callingCodes":["244"],"capital":"Luanda","altSpellings":["AO","República de Angola","ʁɛpublika de an'ɡɔla"],"region":"Africa","subregion":"Middle Africa","population":25868000,"latlng":[-12.5,18.5],"demonym":"Angolan","area":1246700.0,"gini":58.6,"timezones":["UTC+01:00"],"borders":["COG","COD","ZMB","NAM"],"nativeName":"Angola","numericCode":"024","currencies":[{"code":"AOA","name":"Angolan kwanza","symbol":"Kz"}],"languages":[{"iso639_1":"pt","iso639_2":"por","name":"Portuguese","nativeName":"Português"}],"translations":{"de":"Angola","es":"Angola","fr":"Angola","ja":"アンゴラ","it":"Angola","br":"Angola","pt":"Angola","nl":"Angola","hr":"Angola","fa":"آنگولا"},"flag":"https://restcountries.eu/data/ago.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"ANG"} +{"name":"Anguilla","topLevelDomain":[".ai"],"alpha2Code":"AI","alpha3Code":"AIA","callingCodes":["1264"],"capital":"The Valley","altSpellings":["AI"],"region":"Americas","subregion":"Caribbean","population":13452,"latlng":[18.25,-63.16666666],"demonym":"Anguillian","area":91.0,"gini":null,"timezones":["UTC-04:00"],"borders":[],"nativeName":"Anguilla","numericCode":"660","currencies":[{"code":"XCD","name":"East Caribbean dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Anguilla","es":"Anguilla","fr":"Anguilla","ja":"アンギラ","it":"Anguilla","br":"Anguila","pt":"Anguila","nl":"Anguilla","hr":"Angvila","fa":"آنگویلا"},"flag":"https://restcountries.eu/data/aia.svg","regionalBlocs":[],"cioc":""} +{"name":"Antarctica","topLevelDomain":[".aq"],"alpha2Code":"AQ","alpha3Code":"ATA","callingCodes":["672"],"capital":"","altSpellings":[],"region":"Polar","subregion":"","population":1000,"latlng":[-74.65,4.48],"demonym":"","area":1.4E7,"gini":null,"timezones":["UTC-03:00","UTC+03:00","UTC+05:00","UTC+06:00","UTC+07:00","UTC+08:00","UTC+10:00","UTC+12:00"],"borders":[],"nativeName":"Antarctica","numericCode":"010","currencies":[{"code":"AUD","name":"Australian dollar","symbol":"$"},{"code":"GBP","name":"British pound","symbol":"£"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"ru","iso639_2":"rus","name":"Russian","nativeName":"Русский"}],"translations":{"de":"Antarktika","es":"Antártida","fr":"Antarctique","ja":"南極大陸","it":"Antartide","br":"Antártida","pt":"Antárctida","nl":"Antarctica","hr":"Antarktika","fa":"جنوبگان"},"flag":"https://restcountries.eu/data/ata.svg","regionalBlocs":[],"cioc":""} +{"name":"Antigua and Barbuda","topLevelDomain":[".ag"],"alpha2Code":"AG","alpha3Code":"ATG","callingCodes":["1268"],"capital":"Saint John's","altSpellings":["AG"],"region":"Americas","subregion":"Caribbean","population":86295,"latlng":[17.05,-61.8],"demonym":"Antiguan, Barbudan","area":442.0,"gini":null,"timezones":["UTC-04:00"],"borders":[],"nativeName":"Antigua and Barbuda","numericCode":"028","currencies":[{"code":"XCD","name":"East Caribbean dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Antigua und Barbuda","es":"Antigua y Barbuda","fr":"Antigua-et-Barbuda","ja":"アンティグア・バーブーダ","it":"Antigua e Barbuda","br":"Antígua e Barbuda","pt":"Antígua e Barbuda","nl":"Antigua en Barbuda","hr":"Antigva i Barbuda","fa":"آنتیگوا و باربودا"},"flag":"https://restcountries.eu/data/atg.svg","regionalBlocs":[{"acronym":"CARICOM","name":"Caribbean Community","otherAcronyms":[],"otherNames":["Comunidad del Caribe","Communauté Caribéenne","Caribische Gemeenschap"]}],"cioc":"ANT"} +{"name":"Argentina","topLevelDomain":[".ar"],"alpha2Code":"AR","alpha3Code":"ARG","callingCodes":["54"],"capital":"Buenos Aires","altSpellings":["AR","Argentine Republic","República Argentina"],"region":"Americas","subregion":"South America","population":43590400,"latlng":[-34.0,-64.0],"demonym":"Argentinean","area":2780400.0,"gini":44.5,"timezones":["UTC-03:00"],"borders":["BOL","BRA","CHL","PRY","URY"],"nativeName":"Argentina","numericCode":"032","currencies":[{"code":"ARS","name":"Argentine peso","symbol":"$"}],"languages":[{"iso639_1":"es","iso639_2":"spa","name":"Spanish","nativeName":"Español"},{"iso639_1":"gn","iso639_2":"grn","name":"Guaraní","nativeName":"Avañe'ẽ"}],"translations":{"de":"Argentinien","es":"Argentina","fr":"Argentine","ja":"アルゼンチン","it":"Argentina","br":"Argentina","pt":"Argentina","nl":"Argentinië","hr":"Argentina","fa":"آرژانتین"},"flag":"https://restcountries.eu/data/arg.svg","regionalBlocs":[{"acronym":"USAN","name":"Union of South American Nations","otherAcronyms":["UNASUR","UNASUL","UZAN"],"otherNames":["Unión de Naciones Suramericanas","União de Nações Sul-Americanas","Unie van Zuid-Amerikaanse Naties","South American Union"]}],"cioc":"ARG"} +{"name":"Armenia","topLevelDomain":[".am"],"alpha2Code":"AM","alpha3Code":"ARM","callingCodes":["374"],"capital":"Yerevan","altSpellings":["AM","Hayastan","Republic of Armenia","Հայաստանի Հանրապետություն"],"region":"Asia","subregion":"Western Asia","population":2994400,"latlng":[40.0,45.0],"demonym":"Armenian","area":29743.0,"gini":30.9,"timezones":["UTC+04:00"],"borders":["AZE","GEO","IRN","TUR"],"nativeName":"Հայաստան","numericCode":"051","currencies":[{"code":"AMD","name":"Armenian dram","symbol":null}],"languages":[{"iso639_1":"hy","iso639_2":"hye","name":"Armenian","nativeName":"Հայերեն"},{"iso639_1":"ru","iso639_2":"rus","name":"Russian","nativeName":"Русский"}],"translations":{"de":"Armenien","es":"Armenia","fr":"Arménie","ja":"アルメニア","it":"Armenia","br":"Armênia","pt":"Arménia","nl":"Armenië","hr":"Armenija","fa":"ارمنستان"},"flag":"https://restcountries.eu/data/arm.svg","regionalBlocs":[{"acronym":"EEU","name":"Eurasian Economic Union","otherAcronyms":["EAEU"],"otherNames":[]}],"cioc":"ARM"} +{"name":"Aruba","topLevelDomain":[".aw"],"alpha2Code":"AW","alpha3Code":"ABW","callingCodes":["297"],"capital":"Oranjestad","altSpellings":["AW"],"region":"Americas","subregion":"Caribbean","population":107394,"latlng":[12.5,-69.96666666],"demonym":"Aruban","area":180.0,"gini":null,"timezones":["UTC-04:00"],"borders":[],"nativeName":"Aruba","numericCode":"533","currencies":[{"code":"AWG","name":"Aruban florin","symbol":"ƒ"}],"languages":[{"iso639_1":"nl","iso639_2":"nld","name":"Dutch","nativeName":"Nederlands"},{"iso639_1":"pa","iso639_2":"pan","name":"(Eastern) Punjabi","nativeName":"ਪੰਜਾਬੀ"}],"translations":{"de":"Aruba","es":"Aruba","fr":"Aruba","ja":"アルバ","it":"Aruba","br":"Aruba","pt":"Aruba","nl":"Aruba","hr":"Aruba","fa":"آروبا"},"flag":"https://restcountries.eu/data/abw.svg","regionalBlocs":[],"cioc":"ARU"} +{"name":"Australia","topLevelDomain":[".au"],"alpha2Code":"AU","alpha3Code":"AUS","callingCodes":["61"],"capital":"Canberra","altSpellings":["AU"],"region":"Oceania","subregion":"Australia and New Zealand","population":24117360,"latlng":[-27.0,133.0],"demonym":"Australian","area":7692024.0,"gini":30.5,"timezones":["UTC+05:00","UTC+06:30","UTC+07:00","UTC+08:00","UTC+09:30","UTC+10:00","UTC+10:30","UTC+11:30"],"borders":[],"nativeName":"Australia","numericCode":"036","currencies":[{"code":"AUD","name":"Australian dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Australien","es":"Australia","fr":"Australie","ja":"オーストラリア","it":"Australia","br":"Austrália","pt":"Austrália","nl":"Australië","hr":"Australija","fa":"استرالیا"},"flag":"https://restcountries.eu/data/aus.svg","regionalBlocs":[],"cioc":"AUS"} +{"name":"Austria","topLevelDomain":[".at"],"alpha2Code":"AT","alpha3Code":"AUT","callingCodes":["43"],"capital":"Vienna","altSpellings":["AT","Österreich","Osterreich","Oesterreich"],"region":"Europe","subregion":"Western Europe","population":8725931,"latlng":[47.33333333,13.33333333],"demonym":"Austrian","area":83871.0,"gini":26.0,"timezones":["UTC+01:00"],"borders":["CZE","DEU","HUN","ITA","LIE","SVK","SVN","CHE"],"nativeName":"Österreich","numericCode":"040","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"de","iso639_2":"deu","name":"German","nativeName":"Deutsch"}],"translations":{"de":"Österreich","es":"Austria","fr":"Autriche","ja":"オーストリア","it":"Austria","br":"áustria","pt":"áustria","nl":"Oostenrijk","hr":"Austrija","fa":"اتریش"},"flag":"https://restcountries.eu/data/aut.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"AUT"} +{"name":"Azerbaijan","topLevelDomain":[".az"],"alpha2Code":"AZ","alpha3Code":"AZE","callingCodes":["994"],"capital":"Baku","altSpellings":["AZ","Republic of Azerbaijan","Azərbaycan Respublikası"],"region":"Asia","subregion":"Western Asia","population":9730500,"latlng":[40.5,47.5],"demonym":"Azerbaijani","area":86600.0,"gini":33.7,"timezones":["UTC+04:00"],"borders":["ARM","GEO","IRN","RUS","TUR"],"nativeName":"Azərbaycan","numericCode":"031","currencies":[{"code":"AZN","name":"Azerbaijani manat","symbol":null}],"languages":[{"iso639_1":"az","iso639_2":"aze","name":"Azerbaijani","nativeName":"azərbaycan dili"}],"translations":{"de":"Aserbaidschan","es":"Azerbaiyán","fr":"Azerbaïdjan","ja":"アゼルバイジャン","it":"Azerbaijan","br":"Azerbaijão","pt":"Azerbaijão","nl":"Azerbeidzjan","hr":"Azerbajdžan","fa":"آذربایجان"},"flag":"https://restcountries.eu/data/aze.svg","regionalBlocs":[],"cioc":"AZE"} +{"name":"Bahamas","topLevelDomain":[".bs"],"alpha2Code":"BS","alpha3Code":"BHS","callingCodes":["1242"],"capital":"Nassau","altSpellings":["BS","Commonwealth of the Bahamas"],"region":"Americas","subregion":"Caribbean","population":378040,"latlng":[24.25,-76.0],"demonym":"Bahamian","area":13943.0,"gini":null,"timezones":["UTC-05:00"],"borders":[],"nativeName":"Bahamas","numericCode":"044","currencies":[{"code":"BSD","name":"Bahamian dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Bahamas","es":"Bahamas","fr":"Bahamas","ja":"バハマ","it":"Bahamas","br":"Bahamas","pt":"Baamas","nl":"Bahama’s","hr":"Bahami","fa":"باهاما"},"flag":"https://restcountries.eu/data/bhs.svg","regionalBlocs":[{"acronym":"CARICOM","name":"Caribbean Community","otherAcronyms":[],"otherNames":["Comunidad del Caribe","Communauté Caribéenne","Caribische Gemeenschap"]}],"cioc":"BAH"} +{"name":"Bahrain","topLevelDomain":[".bh"],"alpha2Code":"BH","alpha3Code":"BHR","callingCodes":["973"],"capital":"Manama","altSpellings":["BH","Kingdom of Bahrain","Mamlakat al-Baḥrayn"],"region":"Asia","subregion":"Western Asia","population":1404900,"latlng":[26.0,50.55],"demonym":"Bahraini","area":765.0,"gini":null,"timezones":["UTC+03:00"],"borders":[],"nativeName":"‏البحرين","numericCode":"048","currencies":[{"code":"BHD","name":"Bahraini dinar","symbol":".د.ب"}],"languages":[{"iso639_1":"ar","iso639_2":"ara","name":"Arabic","nativeName":"العربية"}],"translations":{"de":"Bahrain","es":"Bahrein","fr":"Bahreïn","ja":"バーレーン","it":"Bahrein","br":"Bahrein","pt":"Barém","nl":"Bahrein","hr":"Bahrein","fa":"بحرین"},"flag":"https://restcountries.eu/data/bhr.svg","regionalBlocs":[{"acronym":"AL","name":"Arab League","otherAcronyms":[],"otherNames":["جامعة الدول العربية","Jāmiʻat ad-Duwal al-ʻArabīyah","League of Arab States"]}],"cioc":"BRN"} +{"name":"Bangladesh","topLevelDomain":[".bd"],"alpha2Code":"BD","alpha3Code":"BGD","callingCodes":["880"],"capital":"Dhaka","altSpellings":["BD","People's Republic of Bangladesh","Gônôprôjatôntri Bangladesh"],"region":"Asia","subregion":"Southern Asia","population":161006790,"latlng":[24.0,90.0],"demonym":"Bangladeshi","area":147570.0,"gini":32.1,"timezones":["UTC+06:00"],"borders":["MMR","IND"],"nativeName":"Bangladesh","numericCode":"050","currencies":[{"code":"BDT","name":"Bangladeshi taka","symbol":"৳"}],"languages":[{"iso639_1":"bn","iso639_2":"ben","name":"Bengali","nativeName":"বাংলা"}],"translations":{"de":"Bangladesch","es":"Bangladesh","fr":"Bangladesh","ja":"バングラデシュ","it":"Bangladesh","br":"Bangladesh","pt":"Bangladeche","nl":"Bangladesh","hr":"Bangladeš","fa":"بنگلادش"},"flag":"https://restcountries.eu/data/bgd.svg","regionalBlocs":[{"acronym":"SAARC","name":"South Asian Association for Regional Cooperation","otherAcronyms":[],"otherNames":[]}],"cioc":"BAN"} +{"name":"Barbados","topLevelDomain":[".bb"],"alpha2Code":"BB","alpha3Code":"BRB","callingCodes":["1246"],"capital":"Bridgetown","altSpellings":["BB"],"region":"Americas","subregion":"Caribbean","population":285000,"latlng":[13.16666666,-59.53333333],"demonym":"Barbadian","area":430.0,"gini":null,"timezones":["UTC-04:00"],"borders":[],"nativeName":"Barbados","numericCode":"052","currencies":[{"code":"BBD","name":"Barbadian dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Barbados","es":"Barbados","fr":"Barbade","ja":"バルバドス","it":"Barbados","br":"Barbados","pt":"Barbados","nl":"Barbados","hr":"Barbados","fa":"باربادوس"},"flag":"https://restcountries.eu/data/brb.svg","regionalBlocs":[{"acronym":"CARICOM","name":"Caribbean Community","otherAcronyms":[],"otherNames":["Comunidad del Caribe","Communauté Caribéenne","Caribische Gemeenschap"]}],"cioc":"BAR"} +{"name":"Belarus","topLevelDomain":[".by"],"alpha2Code":"BY","alpha3Code":"BLR","callingCodes":["375"],"capital":"Minsk","altSpellings":["BY","Bielaruś","Republic of Belarus","Белоруссия","Республика Беларусь","Belorussiya","Respublika Belarus’"],"region":"Europe","subregion":"Eastern Europe","population":9498700,"latlng":[53.0,28.0],"demonym":"Belarusian","area":207600.0,"gini":26.5,"timezones":["UTC+03:00"],"borders":["LVA","LTU","POL","RUS","UKR"],"nativeName":"Белару́сь","numericCode":"112","currencies":[{"code":"BYN","name":"New Belarusian ruble","symbol":"Br"},{"code":"BYR","name":"Old Belarusian ruble","symbol":"Br"}],"languages":[{"iso639_1":"be","iso639_2":"bel","name":"Belarusian","nativeName":"беларуская мова"},{"iso639_1":"ru","iso639_2":"rus","name":"Russian","nativeName":"Русский"}],"translations":{"de":"Weißrussland","es":"Bielorrusia","fr":"Biélorussie","ja":"ベラルーシ","it":"Bielorussia","br":"Bielorrússia","pt":"Bielorrússia","nl":"Wit-Rusland","hr":"Bjelorusija","fa":"بلاروس"},"flag":"https://restcountries.eu/data/blr.svg","regionalBlocs":[{"acronym":"EEU","name":"Eurasian Economic Union","otherAcronyms":["EAEU"],"otherNames":[]}],"cioc":"BLR"} +{"name":"Belgium","topLevelDomain":[".be"],"alpha2Code":"BE","alpha3Code":"BEL","callingCodes":["32"],"capital":"Brussels","altSpellings":["BE","België","Belgie","Belgien","Belgique","Kingdom of Belgium","Koninkrijk België","Royaume de Belgique","Königreich Belgien"],"region":"Europe","subregion":"Western Europe","population":11319511,"latlng":[50.83333333,4.0],"demonym":"Belgian","area":30528.0,"gini":33.0,"timezones":["UTC+01:00"],"borders":["FRA","DEU","LUX","NLD"],"nativeName":"België","numericCode":"056","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"nl","iso639_2":"nld","name":"Dutch","nativeName":"Nederlands"},{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"},{"iso639_1":"de","iso639_2":"deu","name":"German","nativeName":"Deutsch"}],"translations":{"de":"Belgien","es":"Bélgica","fr":"Belgique","ja":"ベルギー","it":"Belgio","br":"Bélgica","pt":"Bélgica","nl":"België","hr":"Belgija","fa":"بلژیک"},"flag":"https://restcountries.eu/data/bel.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"BEL"} +{"name":"Belize","topLevelDomain":[".bz"],"alpha2Code":"BZ","alpha3Code":"BLZ","callingCodes":["501"],"capital":"Belmopan","altSpellings":["BZ"],"region":"Americas","subregion":"Central America","population":370300,"latlng":[17.25,-88.75],"demonym":"Belizean","area":22966.0,"gini":53.1,"timezones":["UTC-06:00"],"borders":["GTM","MEX"],"nativeName":"Belize","numericCode":"084","currencies":[{"code":"BZD","name":"Belize dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"es","iso639_2":"spa","name":"Spanish","nativeName":"Español"}],"translations":{"de":"Belize","es":"Belice","fr":"Belize","ja":"ベリーズ","it":"Belize","br":"Belize","pt":"Belize","nl":"Belize","hr":"Belize","fa":"بلیز"},"flag":"https://restcountries.eu/data/blz.svg","regionalBlocs":[{"acronym":"CARICOM","name":"Caribbean Community","otherAcronyms":[],"otherNames":["Comunidad del Caribe","Communauté Caribéenne","Caribische Gemeenschap"]},{"acronym":"CAIS","name":"Central American Integration System","otherAcronyms":["SICA"],"otherNames":["Sistema de la Integración Centroamericana,"]}],"cioc":"BIZ"} +{"name":"Benin","topLevelDomain":[".bj"],"alpha2Code":"BJ","alpha3Code":"BEN","callingCodes":["229"],"capital":"Porto-Novo","altSpellings":["BJ","Republic of Benin","République du Bénin"],"region":"Africa","subregion":"Western Africa","population":10653654,"latlng":[9.5,2.25],"demonym":"Beninese","area":112622.0,"gini":38.6,"timezones":["UTC+01:00"],"borders":["BFA","NER","NGA","TGO"],"nativeName":"Bénin","numericCode":"204","currencies":[{"code":"XOF","name":"West African CFA franc","symbol":"Fr"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Benin","es":"Benín","fr":"Bénin","ja":"ベナン","it":"Benin","br":"Benin","pt":"Benim","nl":"Benin","hr":"Benin","fa":"بنین"},"flag":"https://restcountries.eu/data/ben.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"BEN"} +{"name":"Bermuda","topLevelDomain":[".bm"],"alpha2Code":"BM","alpha3Code":"BMU","callingCodes":["1441"],"capital":"Hamilton","altSpellings":["BM","The Islands of Bermuda","The Bermudas","Somers Isles"],"region":"Americas","subregion":"Northern America","population":61954,"latlng":[32.33333333,-64.75],"demonym":"Bermudian","area":54.0,"gini":null,"timezones":["UTC-04:00"],"borders":[],"nativeName":"Bermuda","numericCode":"060","currencies":[{"code":"BMD","name":"Bermudian dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Bermuda","es":"Bermudas","fr":"Bermudes","ja":"バミューダ","it":"Bermuda","br":"Bermudas","pt":"Bermudas","nl":"Bermuda","hr":"Bermudi","fa":"برمودا"},"flag":"https://restcountries.eu/data/bmu.svg","regionalBlocs":[],"cioc":"BER"} +{"name":"Bhutan","topLevelDomain":[".bt"],"alpha2Code":"BT","alpha3Code":"BTN","callingCodes":["975"],"capital":"Thimphu","altSpellings":["BT","Kingdom of Bhutan"],"region":"Asia","subregion":"Southern Asia","population":775620,"latlng":[27.5,90.5],"demonym":"Bhutanese","area":38394.0,"gini":38.1,"timezones":["UTC+06:00"],"borders":["CHN","IND"],"nativeName":"ʼbrug-yul","numericCode":"064","currencies":[{"code":"BTN","name":"Bhutanese ngultrum","symbol":"Nu."},{"code":"INR","name":"Indian rupee","symbol":"₹"}],"languages":[{"iso639_1":"dz","iso639_2":"dzo","name":"Dzongkha","nativeName":"རྫོང་ཁ"}],"translations":{"de":"Bhutan","es":"Bután","fr":"Bhoutan","ja":"ブータン","it":"Bhutan","br":"Butão","pt":"Butão","nl":"Bhutan","hr":"Butan","fa":"بوتان"},"flag":"https://restcountries.eu/data/btn.svg","regionalBlocs":[{"acronym":"SAARC","name":"South Asian Association for Regional Cooperation","otherAcronyms":[],"otherNames":[]}],"cioc":"BHU"} +{"name":"Bolivia (Plurinational State of)","topLevelDomain":[".bo"],"alpha2Code":"BO","alpha3Code":"BOL","callingCodes":["591"],"capital":"Sucre","altSpellings":["BO","Buliwya","Wuliwya","Plurinational State of Bolivia","Estado Plurinacional de Bolivia","Buliwya Mamallaqta","Wuliwya Suyu","Tetã Volívia"],"region":"Americas","subregion":"South America","population":10985059,"latlng":[-17.0,-65.0],"demonym":"Bolivian","area":1098581.0,"gini":56.3,"timezones":["UTC-04:00"],"borders":["ARG","BRA","CHL","PRY","PER"],"nativeName":"Bolivia","numericCode":"068","currencies":[{"code":"BOB","name":"Bolivian boliviano","symbol":"Bs."}],"languages":[{"iso639_1":"es","iso639_2":"spa","name":"Spanish","nativeName":"Español"},{"iso639_1":"ay","iso639_2":"aym","name":"Aymara","nativeName":"aymar aru"},{"iso639_1":"qu","iso639_2":"que","name":"Quechua","nativeName":"Runa Simi"}],"translations":{"de":"Bolivien","es":"Bolivia","fr":"Bolivie","ja":"ボリビア多民族国","it":"Bolivia","br":"Bolívia","pt":"Bolívia","nl":"Bolivia","hr":"Bolivija","fa":"بولیوی"},"flag":"https://restcountries.eu/data/bol.svg","regionalBlocs":[{"acronym":"USAN","name":"Union of South American Nations","otherAcronyms":["UNASUR","UNASUL","UZAN"],"otherNames":["Unión de Naciones Suramericanas","União de Nações Sul-Americanas","Unie van Zuid-Amerikaanse Naties","South American Union"]}],"cioc":"BOL"} +{"name":"Bonaire, Sint Eustatius and Saba","topLevelDomain":[".an",".nl"],"alpha2Code":"BQ","alpha3Code":"BES","callingCodes":["5997"],"capital":"Kralendijk","altSpellings":["BQ","Boneiru"],"region":"Americas","subregion":"Caribbean","population":17408,"latlng":[12.15,-68.266667],"demonym":"Dutch","area":294.0,"gini":null,"timezones":["UTC-04:00"],"borders":[],"nativeName":"Bonaire","numericCode":"535","currencies":[{"code":"USD","name":"United States dollar","symbol":"$"}],"languages":[{"iso639_1":"nl","iso639_2":"nld","name":"Dutch","nativeName":"Nederlands"}],"translations":{"de":"Bonaire, Sint Eustatius und Saba","es":null,"fr":"Bonaire, Saint-Eustache et Saba","ja":null,"it":"Bonaire, Saint-Eustache e Saba","br":"Bonaire","pt":"Bonaire","nl":null,"hr":null,"fa":"بونیر"},"flag":"https://restcountries.eu/data/bes.svg","regionalBlocs":[],"cioc":null} +{"name":"Bosnia and Herzegovina","topLevelDomain":[".ba"],"alpha2Code":"BA","alpha3Code":"BIH","callingCodes":["387"],"capital":"Sarajevo","altSpellings":["BA","Bosnia-Herzegovina","Босна и Херцеговина"],"region":"Europe","subregion":"Southern Europe","population":3531159,"latlng":[44.0,18.0],"demonym":"Bosnian, Herzegovinian","area":51209.0,"gini":36.2,"timezones":["UTC+01:00"],"borders":["HRV","MNE","SRB"],"nativeName":"Bosna i Hercegovina","numericCode":"070","currencies":[{"code":"BAM","name":"Bosnia and Herzegovina convertible mark","symbol":null}],"languages":[{"iso639_1":"bs","iso639_2":"bos","name":"Bosnian","nativeName":"bosanski jezik"},{"iso639_1":"hr","iso639_2":"hrv","name":"Croatian","nativeName":"hrvatski jezik"},{"iso639_1":"sr","iso639_2":"srp","name":"Serbian","nativeName":"српски језик"}],"translations":{"de":"Bosnien und Herzegowina","es":"Bosnia y Herzegovina","fr":"Bosnie-Herzégovine","ja":"ボスニア・ヘルツェゴビナ","it":"Bosnia ed Erzegovina","br":"Bósnia e Herzegovina","pt":"Bósnia e Herzegovina","nl":"Bosnië en Herzegovina","hr":"Bosna i Hercegovina","fa":"بوسنی و هرزگوین"},"flag":"https://restcountries.eu/data/bih.svg","regionalBlocs":[{"acronym":"CEFTA","name":"Central European Free Trade Agreement","otherAcronyms":[],"otherNames":[]}],"cioc":"BIH"} +{"name":"Botswana","topLevelDomain":[".bw"],"alpha2Code":"BW","alpha3Code":"BWA","callingCodes":["267"],"capital":"Gaborone","altSpellings":["BW","Republic of Botswana","Lefatshe la Botswana"],"region":"Africa","subregion":"Southern Africa","population":2141206,"latlng":[-22.0,24.0],"demonym":"Motswana","area":582000.0,"gini":61.0,"timezones":["UTC+02:00"],"borders":["NAM","ZAF","ZMB","ZWE"],"nativeName":"Botswana","numericCode":"072","currencies":[{"code":"BWP","name":"Botswana pula","symbol":"P"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"tn","iso639_2":"tsn","name":"Tswana","nativeName":"Setswana"}],"translations":{"de":"Botswana","es":"Botswana","fr":"Botswana","ja":"ボツワナ","it":"Botswana","br":"Botsuana","pt":"Botsuana","nl":"Botswana","hr":"Bocvana","fa":"بوتسوانا"},"flag":"https://restcountries.eu/data/bwa.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"BOT"} +{"name":"Bouvet Island","topLevelDomain":[".bv"],"alpha2Code":"BV","alpha3Code":"BVT","callingCodes":[""],"capital":"","altSpellings":["BV","Bouvetøya","Bouvet-øya"],"region":"","subregion":"","population":0,"latlng":[-54.43333333,3.4],"demonym":"","area":49.0,"gini":null,"timezones":["UTC+01:00"],"borders":[],"nativeName":"Bouvetøya","numericCode":"074","currencies":[{"code":"NOK","name":"Norwegian krone","symbol":"kr"}],"languages":[{"iso639_1":"no","iso639_2":"nor","name":"Norwegian","nativeName":"Norsk"},{"iso639_1":"nb","iso639_2":"nob","name":"Norwegian Bokmål","nativeName":"Norsk bokmål"},{"iso639_1":"nn","iso639_2":"nno","name":"Norwegian Nynorsk","nativeName":"Norsk nynorsk"}],"translations":{"de":"Bouvetinsel","es":"Isla Bouvet","fr":"Île Bouvet","ja":"ブーベ島","it":"Isola Bouvet","br":"Ilha Bouvet","pt":"Ilha Bouvet","nl":"Bouveteiland","hr":"Otok Bouvet","fa":"جزیره بووه"},"flag":"https://restcountries.eu/data/bvt.svg","regionalBlocs":[],"cioc":""} +{"name":"Brazil","topLevelDomain":[".br"],"alpha2Code":"BR","alpha3Code":"BRA","callingCodes":["55"],"capital":"Brasília","altSpellings":["BR","Brasil","Federative Republic of Brazil","República Federativa do Brasil"],"region":"Americas","subregion":"South America","population":206135893,"latlng":[-10.0,-55.0],"demonym":"Brazilian","area":8515767.0,"gini":54.7,"timezones":["UTC-05:00","UTC-04:00","UTC-03:00","UTC-02:00"],"borders":["ARG","BOL","COL","GUF","GUY","PRY","PER","SUR","URY","VEN"],"nativeName":"Brasil","numericCode":"076","currencies":[{"code":"BRL","name":"Brazilian real","symbol":"R$"}],"languages":[{"iso639_1":"pt","iso639_2":"por","name":"Portuguese","nativeName":"Português"}],"translations":{"de":"Brasilien","es":"Brasil","fr":"Brésil","ja":"ブラジル","it":"Brasile","br":"Brasil","pt":"Brasil","nl":"Brazilië","hr":"Brazil","fa":"برزیل"},"flag":"https://restcountries.eu/data/bra.svg","regionalBlocs":[{"acronym":"USAN","name":"Union of South American Nations","otherAcronyms":["UNASUR","UNASUL","UZAN"],"otherNames":["Unión de Naciones Suramericanas","União de Nações Sul-Americanas","Unie van Zuid-Amerikaanse Naties","South American Union"]}],"cioc":"BRA"} +{"name":"British Indian Ocean Territory","topLevelDomain":[".io"],"alpha2Code":"IO","alpha3Code":"IOT","callingCodes":["246"],"capital":"Diego Garcia","altSpellings":["IO"],"region":"Africa","subregion":"Eastern Africa","population":3000,"latlng":[-6.0,71.5],"demonym":"Indian","area":60.0,"gini":null,"timezones":["UTC+06:00"],"borders":[],"nativeName":"British Indian Ocean Territory","numericCode":"086","currencies":[{"code":"USD","name":"United States dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Britisches Territorium im Indischen Ozean","es":"Territorio Británico del Océano Índico","fr":"Territoire britannique de l'océan Indien","ja":"イギリス領インド洋地域","it":"Territorio britannico dell'oceano indiano","br":"Território Britânico do Oceano íÍdico","pt":"Território Britânico do Oceano Índico","nl":"Britse Gebieden in de Indische Oceaan","hr":"Britanski Indijskooceanski teritorij","fa":"قلمرو بریتانیا در اقیانوس هند"},"flag":"https://restcountries.eu/data/iot.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":""} +{"name":"United States Minor Outlying Islands","topLevelDomain":[".us"],"alpha2Code":"UM","alpha3Code":"UMI","callingCodes":[""],"capital":"","altSpellings":["UM"],"region":"Americas","subregion":"Northern America","population":300,"latlng":[],"demonym":"American","area":null,"gini":null,"timezones":["UTC-11:00","UTC-10:00","UTC+12:00"],"borders":[],"nativeName":"United States Minor Outlying Islands","numericCode":"581","currencies":[{"code":"USD","name":"United States Dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Kleinere Inselbesitzungen der Vereinigten Staaten","es":"Islas Ultramarinas Menores de Estados Unidos","fr":"Îles mineures éloignées des États-Unis","ja":"合衆国領有小離島","it":"Isole minori esterne degli Stati Uniti d'America","br":"Ilhas Menores Distantes dos Estados Unidos","pt":"Ilhas Menores Distantes dos Estados Unidos","nl":"Kleine afgelegen eilanden van de Verenigde Staten","hr":"Mali udaljeni otoci SAD-a","fa":"جزایر کوچک حاشیه‌ای ایالات متحده آمریکا"},"flag":"https://restcountries.eu/data/umi.svg","regionalBlocs":[],"cioc":""} +{"name":"Virgin Islands (British)","topLevelDomain":[".vg"],"alpha2Code":"VG","alpha3Code":"VGB","callingCodes":["1284"],"capital":"Road Town","altSpellings":["VG"],"region":"Americas","subregion":"Caribbean","population":28514,"latlng":[18.431383,-64.62305],"demonym":"Virgin Islander","area":151.0,"gini":null,"timezones":["UTC-04:00"],"borders":[],"nativeName":"British Virgin Islands","numericCode":"092","currencies":[{"code":null,"name":"[D]","symbol":"$"},{"code":"USD","name":"United States dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Britische Jungferninseln","es":"Islas Vírgenes del Reino Unido","fr":"Îles Vierges britanniques","ja":"イギリス領ヴァージン諸島","it":"Isole Vergini Britanniche","br":"Ilhas Virgens Britânicas","pt":"Ilhas Virgens Britânicas","nl":"Britse Maagdeneilanden","hr":"Britanski Djevičanski Otoci","fa":"جزایر ویرجین بریتانیا"},"flag":"https://restcountries.eu/data/vgb.svg","regionalBlocs":[],"cioc":"IVB"} +{"name":"Virgin Islands (U.S.)","topLevelDomain":[".vi"],"alpha2Code":"VI","alpha3Code":"VIR","callingCodes":["1 340"],"capital":"Charlotte Amalie","altSpellings":["VI","USVI","American Virgin Islands","U.S. Virgin Islands"],"region":"Americas","subregion":"Caribbean","population":114743,"latlng":[18.34,-64.93],"demonym":"Virgin Islander","area":346.36,"gini":null,"timezones":["UTC-04:00"],"borders":[],"nativeName":"Virgin Islands of the United States","numericCode":"850","currencies":[{"code":"USD","name":"United States dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Amerikanische Jungferninseln","es":"Islas Vírgenes de los Estados Unidos","fr":"Îles Vierges des États-Unis","ja":"アメリカ領ヴァージン諸島","it":"Isole Vergini americane","br":"Ilhas Virgens Americanas","pt":"Ilhas Virgens Americanas","nl":"Verenigde Staten Maagdeneilanden","hr":null,"fa":"جزایر ویرجین آمریکا"},"flag":"https://restcountries.eu/data/vir.svg","regionalBlocs":[],"cioc":"ISV"} +{"name":"Brunei Darussalam","topLevelDomain":[".bn"],"alpha2Code":"BN","alpha3Code":"BRN","callingCodes":["673"],"capital":"Bandar Seri Begawan","altSpellings":["BN","Nation of Brunei"," the Abode of Peace"],"region":"Asia","subregion":"South-Eastern Asia","population":411900,"latlng":[4.5,114.66666666],"demonym":"Bruneian","area":5765.0,"gini":null,"timezones":["UTC+08:00"],"borders":["MYS"],"nativeName":"Negara Brunei Darussalam","numericCode":"096","currencies":[{"code":"BND","name":"Brunei dollar","symbol":"$"},{"code":"SGD","name":"Singapore dollar","symbol":"$"}],"languages":[{"iso639_1":"ms","iso639_2":"msa","name":"Malay","nativeName":"bahasa Melayu"}],"translations":{"de":"Brunei","es":"Brunei","fr":"Brunei","ja":"ブルネイ・ダルサラーム","it":"Brunei","br":"Brunei","pt":"Brunei","nl":"Brunei","hr":"Brunej","fa":"برونئی"},"flag":"https://restcountries.eu/data/brn.svg","regionalBlocs":[{"acronym":"ASEAN","name":"Association of Southeast Asian Nations","otherAcronyms":[],"otherNames":[]}],"cioc":"BRU"} +{"name":"Bulgaria","topLevelDomain":[".bg"],"alpha2Code":"BG","alpha3Code":"BGR","callingCodes":["359"],"capital":"Sofia","altSpellings":["BG","Republic of Bulgaria","Република България"],"region":"Europe","subregion":"Eastern Europe","population":7153784,"latlng":[43.0,25.0],"demonym":"Bulgarian","area":110879.0,"gini":28.2,"timezones":["UTC+02:00"],"borders":["GRC","MKD","ROU","SRB","TUR"],"nativeName":"България","numericCode":"100","currencies":[{"code":"BGN","name":"Bulgarian lev","symbol":"лв"}],"languages":[{"iso639_1":"bg","iso639_2":"bul","name":"Bulgarian","nativeName":"български език"}],"translations":{"de":"Bulgarien","es":"Bulgaria","fr":"Bulgarie","ja":"ブルガリア","it":"Bulgaria","br":"Bulgária","pt":"Bulgária","nl":"Bulgarije","hr":"Bugarska","fa":"بلغارستان"},"flag":"https://restcountries.eu/data/bgr.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"BUL"} +{"name":"Burkina Faso","topLevelDomain":[".bf"],"alpha2Code":"BF","alpha3Code":"BFA","callingCodes":["226"],"capital":"Ouagadougou","altSpellings":["BF"],"region":"Africa","subregion":"Western Africa","population":19034397,"latlng":[13.0,-2.0],"demonym":"Burkinabe","area":272967.0,"gini":39.8,"timezones":["UTC"],"borders":["BEN","CIV","GHA","MLI","NER","TGO"],"nativeName":"Burkina Faso","numericCode":"854","currencies":[{"code":"XOF","name":"West African CFA franc","symbol":"Fr"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"},{"iso639_1":"ff","iso639_2":"ful","name":"Fula","nativeName":"Fulfulde"}],"translations":{"de":"Burkina Faso","es":"Burkina Faso","fr":"Burkina Faso","ja":"ブルキナファソ","it":"Burkina Faso","br":"Burkina Faso","pt":"Burquina Faso","nl":"Burkina Faso","hr":"Burkina Faso","fa":"بورکینافاسو"},"flag":"https://restcountries.eu/data/bfa.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"BUR"} +{"name":"Burundi","topLevelDomain":[".bi"],"alpha2Code":"BI","alpha3Code":"BDI","callingCodes":["257"],"capital":"Bujumbura","altSpellings":["BI","Republic of Burundi","Republika y'Uburundi","République du Burundi"],"region":"Africa","subregion":"Eastern Africa","population":10114505,"latlng":[-3.5,30.0],"demonym":"Burundian","area":27834.0,"gini":33.3,"timezones":["UTC+02:00"],"borders":["COD","RWA","TZA"],"nativeName":"Burundi","numericCode":"108","currencies":[{"code":"BIF","name":"Burundian franc","symbol":"Fr"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"},{"iso639_1":"rn","iso639_2":"run","name":"Kirundi","nativeName":"Ikirundi"}],"translations":{"de":"Burundi","es":"Burundi","fr":"Burundi","ja":"ブルンジ","it":"Burundi","br":"Burundi","pt":"Burúndi","nl":"Burundi","hr":"Burundi","fa":"بوروندی"},"flag":"https://restcountries.eu/data/bdi.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"BDI"} +{"name":"Cambodia","topLevelDomain":[".kh"],"alpha2Code":"KH","alpha3Code":"KHM","callingCodes":["855"],"capital":"Phnom Penh","altSpellings":["KH","Kingdom of Cambodia"],"region":"Asia","subregion":"South-Eastern Asia","population":15626444,"latlng":[13.0,105.0],"demonym":"Cambodian","area":181035.0,"gini":37.9,"timezones":["UTC+07:00"],"borders":["LAO","THA","VNM"],"nativeName":"Kâmpŭchéa","numericCode":"116","currencies":[{"code":"KHR","name":"Cambodian riel","symbol":"៛"},{"code":"USD","name":"United States dollar","symbol":"$"}],"languages":[{"iso639_1":"km","iso639_2":"khm","name":"Khmer","nativeName":"ខ្មែរ"}],"translations":{"de":"Kambodscha","es":"Camboya","fr":"Cambodge","ja":"カンボジア","it":"Cambogia","br":"Camboja","pt":"Camboja","nl":"Cambodja","hr":"Kambodža","fa":"کامبوج"},"flag":"https://restcountries.eu/data/khm.svg","regionalBlocs":[{"acronym":"ASEAN","name":"Association of Southeast Asian Nations","otherAcronyms":[],"otherNames":[]}],"cioc":"CAM"} +{"name":"Cameroon","topLevelDomain":[".cm"],"alpha2Code":"CM","alpha3Code":"CMR","callingCodes":["237"],"capital":"Yaoundé","altSpellings":["CM","Republic of Cameroon","République du Cameroun"],"region":"Africa","subregion":"Middle Africa","population":22709892,"latlng":[6.0,12.0],"demonym":"Cameroonian","area":475442.0,"gini":38.9,"timezones":["UTC+01:00"],"borders":["CAF","TCD","COG","GNQ","GAB","NGA"],"nativeName":"Cameroon","numericCode":"120","currencies":[{"code":"XAF","name":"Central African CFA franc","symbol":"Fr"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Kamerun","es":"Camerún","fr":"Cameroun","ja":"カメルーン","it":"Camerun","br":"Camarões","pt":"Camarões","nl":"Kameroen","hr":"Kamerun","fa":"کامرون"},"flag":"https://restcountries.eu/data/cmr.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"CMR"} +{"name":"Canada","topLevelDomain":[".ca"],"alpha2Code":"CA","alpha3Code":"CAN","callingCodes":["1"],"capital":"Ottawa","altSpellings":["CA"],"region":"Americas","subregion":"Northern America","population":36155487,"latlng":[60.0,-95.0],"demonym":"Canadian","area":9984670.0,"gini":32.6,"timezones":["UTC-08:00","UTC-07:00","UTC-06:00","UTC-05:00","UTC-04:00","UTC-03:30"],"borders":["USA"],"nativeName":"Canada","numericCode":"124","currencies":[{"code":"CAD","name":"Canadian dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Kanada","es":"Canadá","fr":"Canada","ja":"カナダ","it":"Canada","br":"Canadá","pt":"Canadá","nl":"Canada","hr":"Kanada","fa":"کانادا"},"flag":"https://restcountries.eu/data/can.svg","regionalBlocs":[{"acronym":"NAFTA","name":"North American Free Trade Agreement","otherAcronyms":[],"otherNames":["Tratado de Libre Comercio de América del Norte","Accord de Libre-échange Nord-Américain"]}],"cioc":"CAN"} +{"name":"Cabo Verde","topLevelDomain":[".cv"],"alpha2Code":"CV","alpha3Code":"CPV","callingCodes":["238"],"capital":"Praia","altSpellings":["CV","Republic of Cabo Verde","República de Cabo Verde"],"region":"Africa","subregion":"Western Africa","population":531239,"latlng":[16.0,-24.0],"demonym":"Cape Verdian","area":4033.0,"gini":50.5,"timezones":["UTC-01:00"],"borders":[],"nativeName":"Cabo Verde","numericCode":"132","currencies":[{"code":"CVE","name":"Cape Verdean escudo","symbol":"Esc"}],"languages":[{"iso639_1":"pt","iso639_2":"por","name":"Portuguese","nativeName":"Português"}],"translations":{"de":"Kap Verde","es":"Cabo Verde","fr":"Cap Vert","ja":"カーボベルデ","it":"Capo Verde","br":"Cabo Verde","pt":"Cabo Verde","nl":"Kaapverdië","hr":"Zelenortska Republika","fa":"کیپ ورد"},"flag":"https://restcountries.eu/data/cpv.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"CPV"} +{"name":"Cayman Islands","topLevelDomain":[".ky"],"alpha2Code":"KY","alpha3Code":"CYM","callingCodes":["1345"],"capital":"George Town","altSpellings":["KY"],"region":"Americas","subregion":"Caribbean","population":58238,"latlng":[19.5,-80.5],"demonym":"Caymanian","area":264.0,"gini":null,"timezones":["UTC-05:00"],"borders":[],"nativeName":"Cayman Islands","numericCode":"136","currencies":[{"code":"KYD","name":"Cayman Islands dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Kaimaninseln","es":"Islas Caimán","fr":"Îles Caïmans","ja":"ケイマン諸島","it":"Isole Cayman","br":"Ilhas Cayman","pt":"Ilhas Caimão","nl":"Caymaneilanden","hr":"Kajmanski otoci","fa":"جزایر کیمن"},"flag":"https://restcountries.eu/data/cym.svg","regionalBlocs":[],"cioc":"CAY"} +{"name":"Central African Republic","topLevelDomain":[".cf"],"alpha2Code":"CF","alpha3Code":"CAF","callingCodes":["236"],"capital":"Bangui","altSpellings":["CF","Central African Republic","République centrafricaine"],"region":"Africa","subregion":"Middle Africa","population":4998000,"latlng":[7.0,21.0],"demonym":"Central African","area":622984.0,"gini":56.3,"timezones":["UTC+01:00"],"borders":["CMR","TCD","COD","COG","SSD","SDN"],"nativeName":"Ködörösêse tî Bêafrîka","numericCode":"140","currencies":[{"code":"XAF","name":"Central African CFA franc","symbol":"Fr"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"},{"iso639_1":"sg","iso639_2":"sag","name":"Sango","nativeName":"yângâ tî sängö"}],"translations":{"de":"Zentralafrikanische Republik","es":"República Centroafricana","fr":"République centrafricaine","ja":"中央アフリカ共和国","it":"Repubblica Centrafricana","br":"República Centro-Africana","pt":"República Centro-Africana","nl":"Centraal-Afrikaanse Republiek","hr":"Srednjoafrička Republika","fa":"جمهوری آفریقای مرکزی"},"flag":"https://restcountries.eu/data/caf.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"CAF"} +{"name":"Chad","topLevelDomain":[".td"],"alpha2Code":"TD","alpha3Code":"TCD","callingCodes":["235"],"capital":"N'Djamena","altSpellings":["TD","Tchad","Republic of Chad","République du Tchad"],"region":"Africa","subregion":"Middle Africa","population":14497000,"latlng":[15.0,19.0],"demonym":"Chadian","area":1284000.0,"gini":39.8,"timezones":["UTC+01:00"],"borders":["CMR","CAF","LBY","NER","NGA","SSD"],"nativeName":"Tchad","numericCode":"148","currencies":[{"code":"XAF","name":"Central African CFA franc","symbol":"Fr"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"},{"iso639_1":"ar","iso639_2":"ara","name":"Arabic","nativeName":"العربية"}],"translations":{"de":"Tschad","es":"Chad","fr":"Tchad","ja":"チャド","it":"Ciad","br":"Chade","pt":"Chade","nl":"Tsjaad","hr":"Čad","fa":"چاد"},"flag":"https://restcountries.eu/data/tcd.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"CHA"} +{"name":"Chile","topLevelDomain":[".cl"],"alpha2Code":"CL","alpha3Code":"CHL","callingCodes":["56"],"capital":"Santiago","altSpellings":["CL","Republic of Chile","República de Chile"],"region":"Americas","subregion":"South America","population":18191900,"latlng":[-30.0,-71.0],"demonym":"Chilean","area":756102.0,"gini":52.1,"timezones":["UTC-06:00","UTC-04:00"],"borders":["ARG","BOL","PER"],"nativeName":"Chile","numericCode":"152","currencies":[{"code":"CLP","name":"Chilean peso","symbol":"$"}],"languages":[{"iso639_1":"es","iso639_2":"spa","name":"Spanish","nativeName":"Español"}],"translations":{"de":"Chile","es":"Chile","fr":"Chili","ja":"チリ","it":"Cile","br":"Chile","pt":"Chile","nl":"Chili","hr":"Čile","fa":"شیلی"},"flag":"https://restcountries.eu/data/chl.svg","regionalBlocs":[{"acronym":"PA","name":"Pacific Alliance","otherAcronyms":[],"otherNames":["Alianza del Pacífico"]},{"acronym":"USAN","name":"Union of South American Nations","otherAcronyms":["UNASUR","UNASUL","UZAN"],"otherNames":["Unión de Naciones Suramericanas","União de Nações Sul-Americanas","Unie van Zuid-Amerikaanse Naties","South American Union"]}],"cioc":"CHI"} +{"name":"China","topLevelDomain":[".cn"],"alpha2Code":"CN","alpha3Code":"CHN","callingCodes":["86"],"capital":"Beijing","altSpellings":["CN","Zhōngguó","Zhongguo","Zhonghua","People's Republic of China","中华人民共和国","Zhōnghuá Rénmín Gònghéguó"],"region":"Asia","subregion":"Eastern Asia","population":1377422166,"latlng":[35.0,105.0],"demonym":"Chinese","area":9640011.0,"gini":47.0,"timezones":["UTC+08:00"],"borders":["AFG","BTN","MMR","HKG","IND","KAZ","PRK","KGZ","LAO","MAC","MNG","PAK","RUS","TJK","VNM"],"nativeName":"中国","numericCode":"156","currencies":[{"code":"CNY","name":"Chinese yuan","symbol":"¥"}],"languages":[{"iso639_1":"zh","iso639_2":"zho","name":"Chinese","nativeName":"中文 (Zhōngwén)"}],"translations":{"de":"China","es":"China","fr":"Chine","ja":"中国","it":"Cina","br":"China","pt":"China","nl":"China","hr":"Kina","fa":"چین"},"flag":"https://restcountries.eu/data/chn.svg","regionalBlocs":[],"cioc":"CHN"} +{"name":"Christmas Island","topLevelDomain":[".cx"],"alpha2Code":"CX","alpha3Code":"CXR","callingCodes":["61"],"capital":"Flying Fish Cove","altSpellings":["CX","Territory of Christmas Island"],"region":"Oceania","subregion":"Australia and New Zealand","population":2072,"latlng":[-10.5,105.66666666],"demonym":"Christmas Island","area":135.0,"gini":null,"timezones":["UTC+07:00"],"borders":[],"nativeName":"Christmas Island","numericCode":"162","currencies":[{"code":"AUD","name":"Australian dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Weihnachtsinsel","es":"Isla de Navidad","fr":"Île Christmas","ja":"クリスマス島","it":"Isola di Natale","br":"Ilha Christmas","pt":"Ilha do Natal","nl":"Christmaseiland","hr":"Božićni otok","fa":"جزیره کریسمس"},"flag":"https://restcountries.eu/data/cxr.svg","regionalBlocs":[],"cioc":""} +{"name":"Cocos (Keeling) Islands","topLevelDomain":[".cc"],"alpha2Code":"CC","alpha3Code":"CCK","callingCodes":["61"],"capital":"West Island","altSpellings":["CC","Territory of the Cocos (Keeling) Islands","Keeling Islands"],"region":"Oceania","subregion":"Australia and New Zealand","population":550,"latlng":[-12.5,96.83333333],"demonym":"Cocos Islander","area":14.0,"gini":null,"timezones":["UTC+06:30"],"borders":[],"nativeName":"Cocos (Keeling) Islands","numericCode":"166","currencies":[{"code":"AUD","name":"Australian dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Kokosinseln","es":"Islas Cocos o Islas Keeling","fr":"Îles Cocos","ja":"ココス(キーリング)諸島","it":"Isole Cocos e Keeling","br":"Ilhas Cocos","pt":"Ilhas dos Cocos","nl":"Cocoseilanden","hr":"Kokosovi Otoci","fa":"جزایر کوکوس"},"flag":"https://restcountries.eu/data/cck.svg","regionalBlocs":[],"cioc":""} +{"name":"Colombia","topLevelDomain":[".co"],"alpha2Code":"CO","alpha3Code":"COL","callingCodes":["57"],"capital":"Bogotá","altSpellings":["CO","Republic of Colombia","República de Colombia"],"region":"Americas","subregion":"South America","population":48759958,"latlng":[4.0,-72.0],"demonym":"Colombian","area":1141748.0,"gini":55.9,"timezones":["UTC-05:00"],"borders":["BRA","ECU","PAN","PER","VEN"],"nativeName":"Colombia","numericCode":"170","currencies":[{"code":"COP","name":"Colombian peso","symbol":"$"}],"languages":[{"iso639_1":"es","iso639_2":"spa","name":"Spanish","nativeName":"Español"}],"translations":{"de":"Kolumbien","es":"Colombia","fr":"Colombie","ja":"コロンビア","it":"Colombia","br":"Colômbia","pt":"Colômbia","nl":"Colombia","hr":"Kolumbija","fa":"کلمبیا"},"flag":"https://restcountries.eu/data/col.svg","regionalBlocs":[{"acronym":"PA","name":"Pacific Alliance","otherAcronyms":[],"otherNames":["Alianza del Pacífico"]},{"acronym":"USAN","name":"Union of South American Nations","otherAcronyms":["UNASUR","UNASUL","UZAN"],"otherNames":["Unión de Naciones Suramericanas","União de Nações Sul-Americanas","Unie van Zuid-Amerikaanse Naties","South American Union"]}],"cioc":"COL"} +{"name":"Comoros","topLevelDomain":[".km"],"alpha2Code":"KM","alpha3Code":"COM","callingCodes":["269"],"capital":"Moroni","altSpellings":["KM","Union of the Comoros","Union des Comores","Udzima wa Komori","al-Ittiḥād al-Qumurī"],"region":"Africa","subregion":"Eastern Africa","population":806153,"latlng":[-12.16666666,44.25],"demonym":"Comoran","area":1862.0,"gini":64.3,"timezones":["UTC+03:00"],"borders":[],"nativeName":"Komori","numericCode":"174","currencies":[{"code":"KMF","name":"Comorian franc","symbol":"Fr"}],"languages":[{"iso639_1":"ar","iso639_2":"ara","name":"Arabic","nativeName":"العربية"},{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Union der Komoren","es":"Comoras","fr":"Comores","ja":"コモロ","it":"Comore","br":"Comores","pt":"Comores","nl":"Comoren","hr":"Komori","fa":"کومور"},"flag":"https://restcountries.eu/data/com.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]},{"acronym":"AL","name":"Arab League","otherAcronyms":[],"otherNames":["جامعة الدول العربية","Jāmiʻat ad-Duwal al-ʻArabīyah","League of Arab States"]}],"cioc":"COM"} +{"name":"Congo","topLevelDomain":[".cg"],"alpha2Code":"CG","alpha3Code":"COG","callingCodes":["242"],"capital":"Brazzaville","altSpellings":["CG","Congo-Brazzaville"],"region":"Africa","subregion":"Middle Africa","population":4741000,"latlng":[-1.0,15.0],"demonym":"Congolese","area":342000.0,"gini":47.3,"timezones":["UTC+01:00"],"borders":["AGO","CMR","CAF","COD","GAB"],"nativeName":"République du Congo","numericCode":"178","currencies":[{"code":"XAF","name":"Central African CFA franc","symbol":"Fr"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"},{"iso639_1":"ln","iso639_2":"lin","name":"Lingala","nativeName":"Lingála"}],"translations":{"de":"Kongo","es":"Congo","fr":"Congo","ja":"コンゴ共和国","it":"Congo","br":"Congo","pt":"Congo","nl":"Congo [Republiek]","hr":"Kongo","fa":"کنگو"},"flag":"https://restcountries.eu/data/cog.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"CGO"} +{"name":"Congo (Democratic Republic of the)","topLevelDomain":[".cd"],"alpha2Code":"CD","alpha3Code":"COD","callingCodes":["243"],"capital":"Kinshasa","altSpellings":["CD","DR Congo","Congo-Kinshasa","DRC"],"region":"Africa","subregion":"Middle Africa","population":85026000,"latlng":[0.0,25.0],"demonym":"Congolese","area":2344858.0,"gini":null,"timezones":["UTC+01:00","UTC+02:00"],"borders":["AGO","BDI","CAF","COG","RWA","SSD","TZA","UGA","ZMB"],"nativeName":"République démocratique du Congo","numericCode":"180","currencies":[{"code":"CDF","name":"Congolese franc","symbol":"Fr"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"},{"iso639_1":"ln","iso639_2":"lin","name":"Lingala","nativeName":"Lingála"},{"iso639_1":"kg","iso639_2":"kon","name":"Kongo","nativeName":"Kikongo"},{"iso639_1":"sw","iso639_2":"swa","name":"Swahili","nativeName":"Kiswahili"},{"iso639_1":"lu","iso639_2":"lub","name":"Luba-Katanga","nativeName":"Tshiluba"}],"translations":{"de":"Kongo (Dem. Rep.)","es":"Congo (Rep. Dem.)","fr":"Congo (Rép. dém.)","ja":"コンゴ民主共和国","it":"Congo (Rep. Dem.)","br":"RD Congo","pt":"RD Congo","nl":"Congo [DRC]","hr":"Kongo, Demokratska Republika","fa":"جمهوری کنگو"},"flag":"https://restcountries.eu/data/cod.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"COD"} +{"name":"Cook Islands","topLevelDomain":[".ck"],"alpha2Code":"CK","alpha3Code":"COK","callingCodes":["682"],"capital":"Avarua","altSpellings":["CK","Kūki 'Āirani"],"region":"Oceania","subregion":"Polynesia","population":18100,"latlng":[-21.23333333,-159.76666666],"demonym":"Cook Islander","area":236.0,"gini":null,"timezones":["UTC-10:00"],"borders":[],"nativeName":"Cook Islands","numericCode":"184","currencies":[{"code":"NZD","name":"New Zealand dollar","symbol":"$"},{"code":"CKD","name":"Cook Islands dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Cookinseln","es":"Islas Cook","fr":"Îles Cook","ja":"クック諸島","it":"Isole Cook","br":"Ilhas Cook","pt":"Ilhas Cook","nl":"Cookeilanden","hr":"Cookovo Otočje","fa":"جزایر کوک"},"flag":"https://restcountries.eu/data/cok.svg","regionalBlocs":[],"cioc":"COK"} +{"name":"Costa Rica","topLevelDomain":[".cr"],"alpha2Code":"CR","alpha3Code":"CRI","callingCodes":["506"],"capital":"San José","altSpellings":["CR","Republic of Costa Rica","República de Costa Rica"],"region":"Americas","subregion":"Central America","population":4890379,"latlng":[10.0,-84.0],"demonym":"Costa Rican","area":51100.0,"gini":50.7,"timezones":["UTC-06:00"],"borders":["NIC","PAN"],"nativeName":"Costa Rica","numericCode":"188","currencies":[{"code":"CRC","name":"Costa Rican colón","symbol":"₡"}],"languages":[{"iso639_1":"es","iso639_2":"spa","name":"Spanish","nativeName":"Español"}],"translations":{"de":"Costa Rica","es":"Costa Rica","fr":"Costa Rica","ja":"コスタリカ","it":"Costa Rica","br":"Costa Rica","pt":"Costa Rica","nl":"Costa Rica","hr":"Kostarika","fa":"کاستاریکا"},"flag":"https://restcountries.eu/data/cri.svg","regionalBlocs":[{"acronym":"CAIS","name":"Central American Integration System","otherAcronyms":["SICA"],"otherNames":["Sistema de la Integración Centroamericana,"]}],"cioc":"CRC"} +{"name":"Croatia","topLevelDomain":[".hr"],"alpha2Code":"HR","alpha3Code":"HRV","callingCodes":["385"],"capital":"Zagreb","altSpellings":["HR","Hrvatska","Republic of Croatia","Republika Hrvatska"],"region":"Europe","subregion":"Southern Europe","population":4190669,"latlng":[45.16666666,15.5],"demonym":"Croatian","area":56594.0,"gini":33.7,"timezones":["UTC+01:00"],"borders":["BIH","HUN","MNE","SRB","SVN"],"nativeName":"Hrvatska","numericCode":"191","currencies":[{"code":"HRK","name":"Croatian kuna","symbol":"kn"}],"languages":[{"iso639_1":"hr","iso639_2":"hrv","name":"Croatian","nativeName":"hrvatski jezik"}],"translations":{"de":"Kroatien","es":"Croacia","fr":"Croatie","ja":"クロアチア","it":"Croazia","br":"Croácia","pt":"Croácia","nl":"Kroatië","hr":"Hrvatska","fa":"کرواسی"},"flag":"https://restcountries.eu/data/hrv.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"CRO"} +{"name":"Cuba","topLevelDomain":[".cu"],"alpha2Code":"CU","alpha3Code":"CUB","callingCodes":["53"],"capital":"Havana","altSpellings":["CU","Republic of Cuba","República de Cuba"],"region":"Americas","subregion":"Caribbean","population":11239004,"latlng":[21.5,-80.0],"demonym":"Cuban","area":109884.0,"gini":null,"timezones":["UTC-05:00"],"borders":[],"nativeName":"Cuba","numericCode":"192","currencies":[{"code":"CUC","name":"Cuban convertible peso","symbol":"$"},{"code":"CUP","name":"Cuban peso","symbol":"$"}],"languages":[{"iso639_1":"es","iso639_2":"spa","name":"Spanish","nativeName":"Español"}],"translations":{"de":"Kuba","es":"Cuba","fr":"Cuba","ja":"キューバ","it":"Cuba","br":"Cuba","pt":"Cuba","nl":"Cuba","hr":"Kuba","fa":"کوبا"},"flag":"https://restcountries.eu/data/cub.svg","regionalBlocs":[],"cioc":"CUB"} +{"name":"Curaçao","topLevelDomain":[".cw"],"alpha2Code":"CW","alpha3Code":"CUW","callingCodes":["599"],"capital":"Willemstad","altSpellings":["CW","Curacao","Kòrsou","Country of Curaçao","Land Curaçao","Pais Kòrsou"],"region":"Americas","subregion":"Caribbean","population":154843,"latlng":[12.116667,-68.933333],"demonym":"Dutch","area":444.0,"gini":null,"timezones":["UTC-04:00"],"borders":[],"nativeName":"Curaçao","numericCode":"531","currencies":[{"code":"ANG","name":"Netherlands Antillean guilder","symbol":"ƒ"}],"languages":[{"iso639_1":"nl","iso639_2":"nld","name":"Dutch","nativeName":"Nederlands"},{"iso639_1":"pa","iso639_2":"pan","name":"(Eastern) Punjabi","nativeName":"ਪੰਜਾਬੀ"},{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Curaçao","es":null,"fr":"Curaçao","ja":null,"it":"Curaçao","br":"Curaçao","pt":"Curaçao","nl":"Curaçao","hr":null,"fa":"کوراسائو"},"flag":"https://restcountries.eu/data/cuw.svg","regionalBlocs":[],"cioc":""} +{"name":"Cyprus","topLevelDomain":[".cy"],"alpha2Code":"CY","alpha3Code":"CYP","callingCodes":["357"],"capital":"Nicosia","altSpellings":["CY","Kýpros","Kıbrıs","Republic of Cyprus","Κυπριακή Δημοκρατία","Kıbrıs Cumhuriyeti"],"region":"Europe","subregion":"Southern Europe","population":847000,"latlng":[35.0,33.0],"demonym":"Cypriot","area":9251.0,"gini":null,"timezones":["UTC+02:00"],"borders":["GBR"],"nativeName":"Κύπρος","numericCode":"196","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"el","iso639_2":"ell","name":"Greek (modern)","nativeName":"ελληνικά"},{"iso639_1":"tr","iso639_2":"tur","name":"Turkish","nativeName":"Türkçe"},{"iso639_1":"hy","iso639_2":"hye","name":"Armenian","nativeName":"Հայերեն"}],"translations":{"de":"Zypern","es":"Chipre","fr":"Chypre","ja":"キプロス","it":"Cipro","br":"Chipre","pt":"Chipre","nl":"Cyprus","hr":"Cipar","fa":"قبرس"},"flag":"https://restcountries.eu/data/cyp.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"CYP"} +{"name":"Czech Republic","topLevelDomain":[".cz"],"alpha2Code":"CZ","alpha3Code":"CZE","callingCodes":["420"],"capital":"Prague","altSpellings":["CZ","Česká republika","Česko"],"region":"Europe","subregion":"Eastern Europe","population":10558524,"latlng":[49.75,15.5],"demonym":"Czech","area":78865.0,"gini":26.0,"timezones":["UTC+01:00"],"borders":["AUT","DEU","POL","SVK"],"nativeName":"Česká republika","numericCode":"203","currencies":[{"code":"CZK","name":"Czech koruna","symbol":"Kč"}],"languages":[{"iso639_1":"cs","iso639_2":"ces","name":"Czech","nativeName":"čeština"},{"iso639_1":"sk","iso639_2":"slk","name":"Slovak","nativeName":"slovenčina"}],"translations":{"de":"Tschechische Republik","es":"República Checa","fr":"République tchèque","ja":"チェコ","it":"Repubblica Ceca","br":"República Tcheca","pt":"República Checa","nl":"Tsjechië","hr":"Češka","fa":"جمهوری چک"},"flag":"https://restcountries.eu/data/cze.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"CZE"} +{"name":"Denmark","topLevelDomain":[".dk"],"alpha2Code":"DK","alpha3Code":"DNK","callingCodes":["45"],"capital":"Copenhagen","altSpellings":["DK","Danmark","Kingdom of Denmark","Kongeriget Danmark"],"region":"Europe","subregion":"Northern Europe","population":5717014,"latlng":[56.0,10.0],"demonym":"Danish","area":43094.0,"gini":24.0,"timezones":["UTC-04:00","UTC-03:00","UTC-01:00","UTC","UTC+01:00"],"borders":["DEU"],"nativeName":"Danmark","numericCode":"208","currencies":[{"code":"DKK","name":"Danish krone","symbol":"kr"}],"languages":[{"iso639_1":"da","iso639_2":"dan","name":"Danish","nativeName":"dansk"}],"translations":{"de":"Dänemark","es":"Dinamarca","fr":"Danemark","ja":"デンマーク","it":"Danimarca","br":"Dinamarca","pt":"Dinamarca","nl":"Denemarken","hr":"Danska","fa":"دانمارک"},"flag":"https://restcountries.eu/data/dnk.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"DEN"} +{"name":"Djibouti","topLevelDomain":[".dj"],"alpha2Code":"DJ","alpha3Code":"DJI","callingCodes":["253"],"capital":"Djibouti","altSpellings":["DJ","Jabuuti","Gabuuti","Republic of Djibouti","République de Djibouti","Gabuutih Ummuuno","Jamhuuriyadda Jabuuti"],"region":"Africa","subregion":"Eastern Africa","population":900000,"latlng":[11.5,43.0],"demonym":"Djibouti","area":23200.0,"gini":40.0,"timezones":["UTC+03:00"],"borders":["ERI","ETH","SOM"],"nativeName":"Djibouti","numericCode":"262","currencies":[{"code":"DJF","name":"Djiboutian franc","symbol":"Fr"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"},{"iso639_1":"ar","iso639_2":"ara","name":"Arabic","nativeName":"العربية"}],"translations":{"de":"Dschibuti","es":"Yibuti","fr":"Djibouti","ja":"ジブチ","it":"Gibuti","br":"Djibuti","pt":"Djibuti","nl":"Djibouti","hr":"Džibuti","fa":"جیبوتی"},"flag":"https://restcountries.eu/data/dji.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]},{"acronym":"AL","name":"Arab League","otherAcronyms":[],"otherNames":["جامعة الدول العربية","Jāmiʻat ad-Duwal al-ʻArabīyah","League of Arab States"]}],"cioc":"DJI"} +{"name":"Dominica","topLevelDomain":[".dm"],"alpha2Code":"DM","alpha3Code":"DMA","callingCodes":["1767"],"capital":"Roseau","altSpellings":["DM","Dominique","Wai‘tu kubuli","Commonwealth of Dominica"],"region":"Americas","subregion":"Caribbean","population":71293,"latlng":[15.41666666,-61.33333333],"demonym":"Dominican","area":751.0,"gini":null,"timezones":["UTC-04:00"],"borders":[],"nativeName":"Dominica","numericCode":"212","currencies":[{"code":"XCD","name":"East Caribbean dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Dominica","es":"Dominica","fr":"Dominique","ja":"ドミニカ国","it":"Dominica","br":"Dominica","pt":"Dominica","nl":"Dominica","hr":"Dominika","fa":"دومینیکا"},"flag":"https://restcountries.eu/data/dma.svg","regionalBlocs":[],"cioc":"DMA"} +{"name":"Dominican Republic","topLevelDomain":[".do"],"alpha2Code":"DO","alpha3Code":"DOM","callingCodes":["1809","1829","1849"],"capital":"Santo Domingo","altSpellings":["DO"],"region":"Americas","subregion":"Caribbean","population":10075045,"latlng":[19.0,-70.66666666],"demonym":"Dominican","area":48671.0,"gini":47.2,"timezones":["UTC-04:00"],"borders":["HTI"],"nativeName":"República Dominicana","numericCode":"214","currencies":[{"code":"DOP","name":"Dominican peso","symbol":"$"}],"languages":[{"iso639_1":"es","iso639_2":"spa","name":"Spanish","nativeName":"Español"}],"translations":{"de":"Dominikanische Republik","es":"República Dominicana","fr":"République dominicaine","ja":"ドミニカ共和国","it":"Repubblica Dominicana","br":"República Dominicana","pt":"República Dominicana","nl":"Dominicaanse Republiek","hr":"Dominikanska Republika","fa":"جمهوری دومینیکن"},"flag":"https://restcountries.eu/data/dom.svg","regionalBlocs":[{"acronym":"CARICOM","name":"Caribbean Community","otherAcronyms":[],"otherNames":["Comunidad del Caribe","Communauté Caribéenne","Caribische Gemeenschap"]},{"acronym":"CAIS","name":"Central American Integration System","otherAcronyms":["SICA"],"otherNames":["Sistema de la Integración Centroamericana,"]}],"cioc":"DOM"} +{"name":"Ecuador","topLevelDomain":[".ec"],"alpha2Code":"EC","alpha3Code":"ECU","callingCodes":["593"],"capital":"Quito","altSpellings":["EC","Republic of Ecuador","República del Ecuador"],"region":"Americas","subregion":"South America","population":16545799,"latlng":[-2.0,-77.5],"demonym":"Ecuadorean","area":276841.0,"gini":49.3,"timezones":["UTC-06:00","UTC-05:00"],"borders":["COL","PER"],"nativeName":"Ecuador","numericCode":"218","currencies":[{"code":"USD","name":"United States dollar","symbol":"$"}],"languages":[{"iso639_1":"es","iso639_2":"spa","name":"Spanish","nativeName":"Español"}],"translations":{"de":"Ecuador","es":"Ecuador","fr":"Équateur","ja":"エクアドル","it":"Ecuador","br":"Equador","pt":"Equador","nl":"Ecuador","hr":"Ekvador","fa":"اکوادور"},"flag":"https://restcountries.eu/data/ecu.svg","regionalBlocs":[{"acronym":"USAN","name":"Union of South American Nations","otherAcronyms":["UNASUR","UNASUL","UZAN"],"otherNames":["Unión de Naciones Suramericanas","União de Nações Sul-Americanas","Unie van Zuid-Amerikaanse Naties","South American Union"]}],"cioc":"ECU"} +{"name":"Egypt","topLevelDomain":[".eg"],"alpha2Code":"EG","alpha3Code":"EGY","callingCodes":["20"],"capital":"Cairo","altSpellings":["EG","Arab Republic of Egypt"],"region":"Africa","subregion":"Northern Africa","population":91290000,"latlng":[27.0,30.0],"demonym":"Egyptian","area":1002450.0,"gini":30.8,"timezones":["UTC+02:00"],"borders":["ISR","LBY","SDN"],"nativeName":"مصر‎","numericCode":"818","currencies":[{"code":"EGP","name":"Egyptian pound","symbol":"£"}],"languages":[{"iso639_1":"ar","iso639_2":"ara","name":"Arabic","nativeName":"العربية"}],"translations":{"de":"Ägypten","es":"Egipto","fr":"Égypte","ja":"エジプト","it":"Egitto","br":"Egito","pt":"Egipto","nl":"Egypte","hr":"Egipat","fa":"مصر"},"flag":"https://restcountries.eu/data/egy.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]},{"acronym":"AL","name":"Arab League","otherAcronyms":[],"otherNames":["جامعة الدول العربية","Jāmiʻat ad-Duwal al-ʻArabīyah","League of Arab States"]}],"cioc":"EGY"} +{"name":"El Salvador","topLevelDomain":[".sv"],"alpha2Code":"SV","alpha3Code":"SLV","callingCodes":["503"],"capital":"San Salvador","altSpellings":["SV","Republic of El Salvador","República de El Salvador"],"region":"Americas","subregion":"Central America","population":6520675,"latlng":[13.83333333,-88.91666666],"demonym":"Salvadoran","area":21041.0,"gini":48.3,"timezones":["UTC-06:00"],"borders":["GTM","HND"],"nativeName":"El Salvador","numericCode":"222","currencies":[{"code":"USD","name":"United States dollar","symbol":"$"}],"languages":[{"iso639_1":"es","iso639_2":"spa","name":"Spanish","nativeName":"Español"}],"translations":{"de":"El Salvador","es":"El Salvador","fr":"Salvador","ja":"エルサルバドル","it":"El Salvador","br":"El Salvador","pt":"El Salvador","nl":"El Salvador","hr":"Salvador","fa":"السالوادور"},"flag":"https://restcountries.eu/data/slv.svg","regionalBlocs":[{"acronym":"CAIS","name":"Central American Integration System","otherAcronyms":["SICA"],"otherNames":["Sistema de la Integración Centroamericana,"]}],"cioc":"ESA"} +{"name":"Equatorial Guinea","topLevelDomain":[".gq"],"alpha2Code":"GQ","alpha3Code":"GNQ","callingCodes":["240"],"capital":"Malabo","altSpellings":["GQ","Republic of Equatorial Guinea","República de Guinea Ecuatorial","République de Guinée équatoriale","República da Guiné Equatorial"],"region":"Africa","subregion":"Middle Africa","population":1222442,"latlng":[2.0,10.0],"demonym":"Equatorial Guinean","area":28051.0,"gini":null,"timezones":["UTC+01:00"],"borders":["CMR","GAB"],"nativeName":"Guinea Ecuatorial","numericCode":"226","currencies":[{"code":"XAF","name":"Central African CFA franc","symbol":"Fr"}],"languages":[{"iso639_1":"es","iso639_2":"spa","name":"Spanish","nativeName":"Español"},{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Äquatorial-Guinea","es":"Guinea Ecuatorial","fr":"Guinée-Équatoriale","ja":"赤道ギニア","it":"Guinea Equatoriale","br":"Guiné Equatorial","pt":"Guiné Equatorial","nl":"Equatoriaal-Guinea","hr":"Ekvatorijalna Gvineja","fa":"گینه استوایی"},"flag":"https://restcountries.eu/data/gnq.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"GEQ"} +{"name":"Eritrea","topLevelDomain":[".er"],"alpha2Code":"ER","alpha3Code":"ERI","callingCodes":["291"],"capital":"Asmara","altSpellings":["ER","State of Eritrea","ሃገረ ኤርትራ","Dawlat Iritriyá","ʾErtrā","Iritriyā",""],"region":"Africa","subregion":"Eastern Africa","population":5352000,"latlng":[15.0,39.0],"demonym":"Eritrean","area":117600.0,"gini":null,"timezones":["UTC+03:00"],"borders":["DJI","ETH","SDN"],"nativeName":"ኤርትራ","numericCode":"232","currencies":[{"code":"ERN","name":"Eritrean nakfa","symbol":"Nfk"}],"languages":[{"iso639_1":"ti","iso639_2":"tir","name":"Tigrinya","nativeName":"ትግርኛ"},{"iso639_1":"ar","iso639_2":"ara","name":"Arabic","nativeName":"العربية"},{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Eritrea","es":"Eritrea","fr":"Érythrée","ja":"エリトリア","it":"Eritrea","br":"Eritreia","pt":"Eritreia","nl":"Eritrea","hr":"Eritreja","fa":"اریتره"},"flag":"https://restcountries.eu/data/eri.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"ERI"} +{"name":"Estonia","topLevelDomain":[".ee"],"alpha2Code":"EE","alpha3Code":"EST","callingCodes":["372"],"capital":"Tallinn","altSpellings":["EE","Eesti","Republic of Estonia","Eesti Vabariik"],"region":"Europe","subregion":"Northern Europe","population":1315944,"latlng":[59.0,26.0],"demonym":"Estonian","area":45227.0,"gini":36.0,"timezones":["UTC+02:00"],"borders":["LVA","RUS"],"nativeName":"Eesti","numericCode":"233","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"et","iso639_2":"est","name":"Estonian","nativeName":"eesti"}],"translations":{"de":"Estland","es":"Estonia","fr":"Estonie","ja":"エストニア","it":"Estonia","br":"Estônia","pt":"Estónia","nl":"Estland","hr":"Estonija","fa":"استونی"},"flag":"https://restcountries.eu/data/est.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"EST"} +{"name":"Ethiopia","topLevelDomain":[".et"],"alpha2Code":"ET","alpha3Code":"ETH","callingCodes":["251"],"capital":"Addis Ababa","altSpellings":["ET","ʾĪtyōṗṗyā","Federal Democratic Republic of Ethiopia","የኢትዮጵያ ፌዴራላዊ ዲሞክራሲያዊ ሪፐብሊክ"],"region":"Africa","subregion":"Eastern Africa","population":92206005,"latlng":[8.0,38.0],"demonym":"Ethiopian","area":1104300.0,"gini":29.8,"timezones":["UTC+03:00"],"borders":["DJI","ERI","KEN","SOM","SSD","SDN"],"nativeName":"ኢትዮጵያ","numericCode":"231","currencies":[{"code":"ETB","name":"Ethiopian birr","symbol":"Br"}],"languages":[{"iso639_1":"am","iso639_2":"amh","name":"Amharic","nativeName":"አማርኛ"}],"translations":{"de":"Äthiopien","es":"Etiopía","fr":"Éthiopie","ja":"エチオピア","it":"Etiopia","br":"Etiópia","pt":"Etiópia","nl":"Ethiopië","hr":"Etiopija","fa":"اتیوپی"},"flag":"https://restcountries.eu/data/eth.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"ETH"} +{"name":"Falkland Islands (Malvinas)","topLevelDomain":[".fk"],"alpha2Code":"FK","alpha3Code":"FLK","callingCodes":["500"],"capital":"Stanley","altSpellings":["FK","Islas Malvinas"],"region":"Americas","subregion":"South America","population":2563,"latlng":[-51.75,-59.0],"demonym":"Falkland Islander","area":12173.0,"gini":null,"timezones":["UTC-04:00"],"borders":[],"nativeName":"Falkland Islands","numericCode":"238","currencies":[{"code":"FKP","name":"Falkland Islands pound","symbol":"£"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Falklandinseln","es":"Islas Malvinas","fr":"Îles Malouines","ja":"フォークランド(マルビナス)諸島","it":"Isole Falkland o Isole Malvine","br":"Ilhas Malvinas","pt":"Ilhas Falkland","nl":"Falklandeilanden [Islas Malvinas]","hr":"Falklandski Otoci","fa":"جزایر فالکلند"},"flag":"https://restcountries.eu/data/flk.svg","regionalBlocs":[{"acronym":"USAN","name":"Union of South American Nations","otherAcronyms":["UNASUR","UNASUL","UZAN"],"otherNames":["Unión de Naciones Suramericanas","União de Nações Sul-Americanas","Unie van Zuid-Amerikaanse Naties","South American Union"]}],"cioc":""} +{"name":"Faroe Islands","topLevelDomain":[".fo"],"alpha2Code":"FO","alpha3Code":"FRO","callingCodes":["298"],"capital":"Tórshavn","altSpellings":["FO","Føroyar","Færøerne"],"region":"Europe","subregion":"Northern Europe","population":49376,"latlng":[62.0,-7.0],"demonym":"Faroese","area":1393.0,"gini":null,"timezones":["UTC+00:00"],"borders":[],"nativeName":"Føroyar","numericCode":"234","currencies":[{"code":"DKK","name":"Danish krone","symbol":"kr"},{"code":"(none)","name":"Faroese króna","symbol":"kr"}],"languages":[{"iso639_1":"fo","iso639_2":"fao","name":"Faroese","nativeName":"føroyskt"}],"translations":{"de":"Färöer-Inseln","es":"Islas Faroe","fr":"Îles Féroé","ja":"フェロー諸島","it":"Isole Far Oer","br":"Ilhas Faroé","pt":"Ilhas Faroé","nl":"Faeröer","hr":"Farski Otoci","fa":"جزایر فارو"},"flag":"https://restcountries.eu/data/fro.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":""} +{"name":"Fiji","topLevelDomain":[".fj"],"alpha2Code":"FJ","alpha3Code":"FJI","callingCodes":["679"],"capital":"Suva","altSpellings":["FJ","Viti","Republic of Fiji","Matanitu ko Viti","Fijī Gaṇarājya"],"region":"Oceania","subregion":"Melanesia","population":867000,"latlng":[-18.0,175.0],"demonym":"Fijian","area":18272.0,"gini":42.8,"timezones":["UTC+12:00"],"borders":[],"nativeName":"Fiji","numericCode":"242","currencies":[{"code":"FJD","name":"Fijian dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"fj","iso639_2":"fij","name":"Fijian","nativeName":"vosa Vakaviti"},{"iso639_1":"hi","iso639_2":"hin","name":"Hindi","nativeName":"हिन्दी"},{"iso639_1":"ur","iso639_2":"urd","name":"Urdu","nativeName":"اردو"}],"translations":{"de":"Fidschi","es":"Fiyi","fr":"Fidji","ja":"フィジー","it":"Figi","br":"Fiji","pt":"Fiji","nl":"Fiji","hr":"Fiđi","fa":"فیجی"},"flag":"https://restcountries.eu/data/fji.svg","regionalBlocs":[],"cioc":"FIJ"} +{"name":"Finland","topLevelDomain":[".fi"],"alpha2Code":"FI","alpha3Code":"FIN","callingCodes":["358"],"capital":"Helsinki","altSpellings":["FI","Suomi","Republic of Finland","Suomen tasavalta","Republiken Finland"],"region":"Europe","subregion":"Northern Europe","population":5491817,"latlng":[64.0,26.0],"demonym":"Finnish","area":338424.0,"gini":26.9,"timezones":["UTC+02:00"],"borders":["NOR","SWE","RUS"],"nativeName":"Suomi","numericCode":"246","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"fi","iso639_2":"fin","name":"Finnish","nativeName":"suomi"},{"iso639_1":"sv","iso639_2":"swe","name":"Swedish","nativeName":"svenska"}],"translations":{"de":"Finnland","es":"Finlandia","fr":"Finlande","ja":"フィンランド","it":"Finlandia","br":"Finlândia","pt":"Finlândia","nl":"Finland","hr":"Finska","fa":"فنلاند"},"flag":"https://restcountries.eu/data/fin.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"FIN"} +{"name":"France","topLevelDomain":[".fr"],"alpha2Code":"FR","alpha3Code":"FRA","callingCodes":["33"],"capital":"Paris","altSpellings":["FR","French Republic","République française"],"region":"Europe","subregion":"Western Europe","population":66710000,"latlng":[46.0,2.0],"demonym":"French","area":640679.0,"gini":32.7,"timezones":["UTC-10:00","UTC-09:30","UTC-09:00","UTC-08:00","UTC-04:00","UTC-03:00","UTC+01:00","UTC+03:00","UTC+04:00","UTC+05:00","UTC+11:00","UTC+12:00"],"borders":["AND","BEL","DEU","ITA","LUX","MCO","ESP","CHE"],"nativeName":"France","numericCode":"250","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Frankreich","es":"Francia","fr":"France","ja":"フランス","it":"Francia","br":"França","pt":"França","nl":"Frankrijk","hr":"Francuska","fa":"فرانسه"},"flag":"https://restcountries.eu/data/fra.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"FRA"} +{"name":"French Guiana","topLevelDomain":[".gf"],"alpha2Code":"GF","alpha3Code":"GUF","callingCodes":["594"],"capital":"Cayenne","altSpellings":["GF","Guiana","Guyane"],"region":"Americas","subregion":"South America","population":254541,"latlng":[4.0,-53.0],"demonym":"","area":null,"gini":null,"timezones":["UTC-03:00"],"borders":["BRA","SUR"],"nativeName":"Guyane française","numericCode":"254","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Französisch Guyana","es":"Guayana Francesa","fr":"Guayane","ja":"フランス領ギアナ","it":"Guyana francese","br":"Guiana Francesa","pt":"Guiana Francesa","nl":"Frans-Guyana","hr":"Francuska Gvajana","fa":"گویان فرانسه"},"flag":"https://restcountries.eu/data/guf.svg","regionalBlocs":[{"acronym":"USAN","name":"Union of South American Nations","otherAcronyms":["UNASUR","UNASUL","UZAN"],"otherNames":["Unión de Naciones Suramericanas","União de Nações Sul-Americanas","Unie van Zuid-Amerikaanse Naties","South American Union"]},{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":""} +{"name":"French Polynesia","topLevelDomain":[".pf"],"alpha2Code":"PF","alpha3Code":"PYF","callingCodes":["689"],"capital":"Papeetē","altSpellings":["PF","Polynésie française","French Polynesia","Pōrīnetia Farāni"],"region":"Oceania","subregion":"Polynesia","population":271800,"latlng":[-15.0,-140.0],"demonym":"French Polynesian","area":4167.0,"gini":null,"timezones":["UTC-10:00","UTC-09:30","UTC-09:00"],"borders":[],"nativeName":"Polynésie française","numericCode":"258","currencies":[{"code":"XPF","name":"CFP franc","symbol":"Fr"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Französisch-Polynesien","es":"Polinesia Francesa","fr":"Polynésie française","ja":"フランス領ポリネシア","it":"Polinesia Francese","br":"Polinésia Francesa","pt":"Polinésia Francesa","nl":"Frans-Polynesië","hr":"Francuska Polinezija","fa":"پلی‌نزی فرانسه"},"flag":"https://restcountries.eu/data/pyf.svg","regionalBlocs":[],"cioc":""} +{"name":"French Southern Territories","topLevelDomain":[".tf"],"alpha2Code":"TF","alpha3Code":"ATF","callingCodes":[""],"capital":"Port-aux-Français","altSpellings":["TF"],"region":"Africa","subregion":"Southern Africa","population":140,"latlng":[-49.25,69.167],"demonym":"French","area":7747.0,"gini":null,"timezones":["UTC+05:00"],"borders":[],"nativeName":"Territoire des Terres australes et antarctiques françaises","numericCode":"260","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Französische Süd- und Antarktisgebiete","es":"Tierras Australes y Antárticas Francesas","fr":"Terres australes et antarctiques françaises","ja":"フランス領南方・南極地域","it":"Territori Francesi del Sud","br":"Terras Austrais e Antárticas Francesas","pt":"Terras Austrais e Antárticas Francesas","nl":"Franse Gebieden in de zuidelijke Indische Oceaan","hr":"Francuski južni i antarktički teritoriji","fa":"سرزمین‌های جنوبی و جنوبگانی فرانسه"},"flag":"https://restcountries.eu/data/atf.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":""} +{"name":"Gabon","topLevelDomain":[".ga"],"alpha2Code":"GA","alpha3Code":"GAB","callingCodes":["241"],"capital":"Libreville","altSpellings":["GA","Gabonese Republic","République Gabonaise"],"region":"Africa","subregion":"Middle Africa","population":1802278,"latlng":[-1.0,11.75],"demonym":"Gabonese","area":267668.0,"gini":41.5,"timezones":["UTC+01:00"],"borders":["CMR","COG","GNQ"],"nativeName":"Gabon","numericCode":"266","currencies":[{"code":"XAF","name":"Central African CFA franc","symbol":"Fr"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Gabun","es":"Gabón","fr":"Gabon","ja":"ガボン","it":"Gabon","br":"Gabão","pt":"Gabão","nl":"Gabon","hr":"Gabon","fa":"گابن"},"flag":"https://restcountries.eu/data/gab.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"GAB"} +{"name":"Gambia","topLevelDomain":[".gm"],"alpha2Code":"GM","alpha3Code":"GMB","callingCodes":["220"],"capital":"Banjul","altSpellings":["GM","Republic of the Gambia"],"region":"Africa","subregion":"Western Africa","population":1882450,"latlng":[13.46666666,-16.56666666],"demonym":"Gambian","area":11295.0,"gini":null,"timezones":["UTC+00:00"],"borders":["SEN"],"nativeName":"Gambia","numericCode":"270","currencies":[{"code":"GMD","name":"Gambian dalasi","symbol":"D"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Gambia","es":"Gambia","fr":"Gambie","ja":"ガンビア","it":"Gambia","br":"Gâmbia","pt":"Gâmbia","nl":"Gambia","hr":"Gambija","fa":"گامبیا"},"flag":"https://restcountries.eu/data/gmb.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"GAM"} +{"name":"Georgia","topLevelDomain":[".ge"],"alpha2Code":"GE","alpha3Code":"GEO","callingCodes":["995"],"capital":"Tbilisi","altSpellings":["GE","Sakartvelo"],"region":"Asia","subregion":"Western Asia","population":3720400,"latlng":[42.0,43.5],"demonym":"Georgian","area":69700.0,"gini":41.3,"timezones":["UTC-05:00"],"borders":["ARM","AZE","RUS","TUR"],"nativeName":"საქართველო","numericCode":"268","currencies":[{"code":"GEL","name":"Georgian Lari","symbol":"ლ"}],"languages":[{"iso639_1":"ka","iso639_2":"kat","name":"Georgian","nativeName":"ქართული"}],"translations":{"de":"Georgien","es":"Georgia","fr":"Géorgie","ja":"グルジア","it":"Georgia","br":"Geórgia","pt":"Geórgia","nl":"Georgië","hr":"Gruzija","fa":"گرجستان"},"flag":"https://restcountries.eu/data/geo.svg","regionalBlocs":[],"cioc":"GEO"} +{"name":"Germany","topLevelDomain":[".de"],"alpha2Code":"DE","alpha3Code":"DEU","callingCodes":["49"],"capital":"Berlin","altSpellings":["DE","Federal Republic of Germany","Bundesrepublik Deutschland"],"region":"Europe","subregion":"Western Europe","population":81770900,"latlng":[51.0,9.0],"demonym":"German","area":357114.0,"gini":28.3,"timezones":["UTC+01:00"],"borders":["AUT","BEL","CZE","DNK","FRA","LUX","NLD","POL","CHE"],"nativeName":"Deutschland","numericCode":"276","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"de","iso639_2":"deu","name":"German","nativeName":"Deutsch"}],"translations":{"de":"Deutschland","es":"Alemania","fr":"Allemagne","ja":"ドイツ","it":"Germania","br":"Alemanha","pt":"Alemanha","nl":"Duitsland","hr":"Njemačka","fa":"آلمان"},"flag":"https://restcountries.eu/data/deu.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"GER"} +{"name":"Ghana","topLevelDomain":[".gh"],"alpha2Code":"GH","alpha3Code":"GHA","callingCodes":["233"],"capital":"Accra","altSpellings":["GH"],"region":"Africa","subregion":"Western Africa","population":27670174,"latlng":[8.0,-2.0],"demonym":"Ghanaian","area":238533.0,"gini":42.8,"timezones":["UTC"],"borders":["BFA","CIV","TGO"],"nativeName":"Ghana","numericCode":"288","currencies":[{"code":"GHS","name":"Ghanaian cedi","symbol":"₵"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Ghana","es":"Ghana","fr":"Ghana","ja":"ガーナ","it":"Ghana","br":"Gana","pt":"Gana","nl":"Ghana","hr":"Gana","fa":"غنا"},"flag":"https://restcountries.eu/data/gha.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"GHA"} +{"name":"Gibraltar","topLevelDomain":[".gi"],"alpha2Code":"GI","alpha3Code":"GIB","callingCodes":["350"],"capital":"Gibraltar","altSpellings":["GI"],"region":"Europe","subregion":"Southern Europe","population":33140,"latlng":[36.13333333,-5.35],"demonym":"Gibraltar","area":6.0,"gini":null,"timezones":["UTC+01:00"],"borders":["ESP"],"nativeName":"Gibraltar","numericCode":"292","currencies":[{"code":"GIP","name":"Gibraltar pound","symbol":"£"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Gibraltar","es":"Gibraltar","fr":"Gibraltar","ja":"ジブラルタル","it":"Gibilterra","br":"Gibraltar","pt":"Gibraltar","nl":"Gibraltar","hr":"Gibraltar","fa":"جبل‌طارق"},"flag":"https://restcountries.eu/data/gib.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":""} +{"name":"Greece","topLevelDomain":[".gr"],"alpha2Code":"GR","alpha3Code":"GRC","callingCodes":["30"],"capital":"Athens","altSpellings":["GR","Elláda","Hellenic Republic","Ελληνική Δημοκρατία"],"region":"Europe","subregion":"Southern Europe","population":10858018,"latlng":[39.0,22.0],"demonym":"Greek","area":131990.0,"gini":34.3,"timezones":["UTC+02:00"],"borders":["ALB","BGR","TUR","MKD"],"nativeName":"Ελλάδα","numericCode":"300","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"el","iso639_2":"ell","name":"Greek (modern)","nativeName":"ελληνικά"}],"translations":{"de":"Griechenland","es":"Grecia","fr":"Grèce","ja":"ギリシャ","it":"Grecia","br":"Grécia","pt":"Grécia","nl":"Griekenland","hr":"Grčka","fa":"یونان"},"flag":"https://restcountries.eu/data/grc.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"GRE"} +{"name":"Greenland","topLevelDomain":[".gl"],"alpha2Code":"GL","alpha3Code":"GRL","callingCodes":["299"],"capital":"Nuuk","altSpellings":["GL","Grønland"],"region":"Americas","subregion":"Northern America","population":55847,"latlng":[72.0,-40.0],"demonym":"Greenlandic","area":2166086.0,"gini":null,"timezones":["UTC-04:00","UTC-03:00","UTC-01:00","UTC+00:00"],"borders":[],"nativeName":"Kalaallit Nunaat","numericCode":"304","currencies":[{"code":"DKK","name":"Danish krone","symbol":"kr"}],"languages":[{"iso639_1":"kl","iso639_2":"kal","name":"Kalaallisut","nativeName":"kalaallisut"}],"translations":{"de":"Grönland","es":"Groenlandia","fr":"Groenland","ja":"グリーンランド","it":"Groenlandia","br":"Groelândia","pt":"Gronelândia","nl":"Groenland","hr":"Grenland","fa":"گرینلند"},"flag":"https://restcountries.eu/data/grl.svg","regionalBlocs":[],"cioc":""} +{"name":"Grenada","topLevelDomain":[".gd"],"alpha2Code":"GD","alpha3Code":"GRD","callingCodes":["1473"],"capital":"St. George's","altSpellings":["GD"],"region":"Americas","subregion":"Caribbean","population":103328,"latlng":[12.11666666,-61.66666666],"demonym":"Grenadian","area":344.0,"gini":null,"timezones":["UTC-04:00"],"borders":[],"nativeName":"Grenada","numericCode":"308","currencies":[{"code":"XCD","name":"East Caribbean dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Grenada","es":"Grenada","fr":"Grenade","ja":"グレナダ","it":"Grenada","br":"Granada","pt":"Granada","nl":"Grenada","hr":"Grenada","fa":"گرنادا"},"flag":"https://restcountries.eu/data/grd.svg","regionalBlocs":[{"acronym":"CARICOM","name":"Caribbean Community","otherAcronyms":[],"otherNames":["Comunidad del Caribe","Communauté Caribéenne","Caribische Gemeenschap"]}],"cioc":"GRN"} +{"name":"Guadeloupe","topLevelDomain":[".gp"],"alpha2Code":"GP","alpha3Code":"GLP","callingCodes":["590"],"capital":"Basse-Terre","altSpellings":["GP","Gwadloup"],"region":"Americas","subregion":"Caribbean","population":400132,"latlng":[16.25,-61.583333],"demonym":"Guadeloupian","area":null,"gini":null,"timezones":["UTC-04:00"],"borders":[],"nativeName":"Guadeloupe","numericCode":"312","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Guadeloupe","es":"Guadalupe","fr":"Guadeloupe","ja":"グアドループ","it":"Guadeloupa","br":"Guadalupe","pt":"Guadalupe","nl":"Guadeloupe","hr":"Gvadalupa","fa":"جزیره گوادلوپ"},"flag":"https://restcountries.eu/data/glp.svg","regionalBlocs":[],"cioc":""} +{"name":"Guam","topLevelDomain":[".gu"],"alpha2Code":"GU","alpha3Code":"GUM","callingCodes":["1671"],"capital":"Hagåtña","altSpellings":["GU","Guåhån"],"region":"Oceania","subregion":"Micronesia","population":184200,"latlng":[13.46666666,144.78333333],"demonym":"Guamanian","area":549.0,"gini":null,"timezones":["UTC+10:00"],"borders":[],"nativeName":"Guam","numericCode":"316","currencies":[{"code":"USD","name":"United States dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"ch","iso639_2":"cha","name":"Chamorro","nativeName":"Chamoru"},{"iso639_1":"es","iso639_2":"spa","name":"Spanish","nativeName":"Español"}],"translations":{"de":"Guam","es":"Guam","fr":"Guam","ja":"グアム","it":"Guam","br":"Guam","pt":"Guame","nl":"Guam","hr":"Guam","fa":"گوام"},"flag":"https://restcountries.eu/data/gum.svg","regionalBlocs":[],"cioc":"GUM"} +{"name":"Guatemala","topLevelDomain":[".gt"],"alpha2Code":"GT","alpha3Code":"GTM","callingCodes":["502"],"capital":"Guatemala City","altSpellings":["GT"],"region":"Americas","subregion":"Central America","population":16176133,"latlng":[15.5,-90.25],"demonym":"Guatemalan","area":108889.0,"gini":55.9,"timezones":["UTC-06:00"],"borders":["BLZ","SLV","HND","MEX"],"nativeName":"Guatemala","numericCode":"320","currencies":[{"code":"GTQ","name":"Guatemalan quetzal","symbol":"Q"}],"languages":[{"iso639_1":"es","iso639_2":"spa","name":"Spanish","nativeName":"Español"}],"translations":{"de":"Guatemala","es":"Guatemala","fr":"Guatemala","ja":"グアテマラ","it":"Guatemala","br":"Guatemala","pt":"Guatemala","nl":"Guatemala","hr":"Gvatemala","fa":"گواتمالا"},"flag":"https://restcountries.eu/data/gtm.svg","regionalBlocs":[{"acronym":"CAIS","name":"Central American Integration System","otherAcronyms":["SICA"],"otherNames":["Sistema de la Integración Centroamericana,"]}],"cioc":"GUA"} +{"name":"Guernsey","topLevelDomain":[".gg"],"alpha2Code":"GG","alpha3Code":"GGY","callingCodes":["44"],"capital":"St. Peter Port","altSpellings":["GG","Bailiwick of Guernsey","Bailliage de Guernesey"],"region":"Europe","subregion":"Northern Europe","population":62999,"latlng":[49.46666666,-2.58333333],"demonym":"Channel Islander","area":78.0,"gini":null,"timezones":["UTC+00:00"],"borders":[],"nativeName":"Guernsey","numericCode":"831","currencies":[{"code":"GBP","name":"British pound","symbol":"£"},{"code":"(none)","name":"Guernsey pound","symbol":"£"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Guernsey","es":"Guernsey","fr":"Guernesey","ja":"ガーンジー","it":"Guernsey","br":"Guernsey","pt":"Guernsey","nl":"Guernsey","hr":"Guernsey","fa":"گرنزی"},"flag":"https://restcountries.eu/data/ggy.svg","regionalBlocs":[],"cioc":""} +{"name":"Guinea","topLevelDomain":[".gn"],"alpha2Code":"GN","alpha3Code":"GIN","callingCodes":["224"],"capital":"Conakry","altSpellings":["GN","Republic of Guinea","République de Guinée"],"region":"Africa","subregion":"Western Africa","population":12947000,"latlng":[11.0,-10.0],"demonym":"Guinean","area":245857.0,"gini":39.4,"timezones":["UTC"],"borders":["CIV","GNB","LBR","MLI","SEN","SLE"],"nativeName":"Guinée","numericCode":"324","currencies":[{"code":"GNF","name":"Guinean franc","symbol":"Fr"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"},{"iso639_1":"ff","iso639_2":"ful","name":"Fula","nativeName":"Fulfulde"}],"translations":{"de":"Guinea","es":"Guinea","fr":"Guinée","ja":"ギニア","it":"Guinea","br":"Guiné","pt":"Guiné","nl":"Guinee","hr":"Gvineja","fa":"گینه"},"flag":"https://restcountries.eu/data/gin.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"GUI"} +{"name":"Guinea-Bissau","topLevelDomain":[".gw"],"alpha2Code":"GW","alpha3Code":"GNB","callingCodes":["245"],"capital":"Bissau","altSpellings":["GW","Republic of Guinea-Bissau","República da Guiné-Bissau"],"region":"Africa","subregion":"Western Africa","population":1547777,"latlng":[12.0,-15.0],"demonym":"Guinea-Bissauan","area":36125.0,"gini":35.5,"timezones":["UTC"],"borders":["GIN","SEN"],"nativeName":"Guiné-Bissau","numericCode":"624","currencies":[{"code":"XOF","name":"West African CFA franc","symbol":"Fr"}],"languages":[{"iso639_1":"pt","iso639_2":"por","name":"Portuguese","nativeName":"Português"}],"translations":{"de":"Guinea-Bissau","es":"Guinea-Bisáu","fr":"Guinée-Bissau","ja":"ギニアビサウ","it":"Guinea-Bissau","br":"Guiné-Bissau","pt":"Guiné-Bissau","nl":"Guinee-Bissau","hr":"Gvineja Bisau","fa":"گینه بیسائو"},"flag":"https://restcountries.eu/data/gnb.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"GBS"} +{"name":"Guyana","topLevelDomain":[".gy"],"alpha2Code":"GY","alpha3Code":"GUY","callingCodes":["592"],"capital":"Georgetown","altSpellings":["GY","Co-operative Republic of Guyana"],"region":"Americas","subregion":"South America","population":746900,"latlng":[5.0,-59.0],"demonym":"Guyanese","area":214969.0,"gini":44.5,"timezones":["UTC-04:00"],"borders":["BRA","SUR","VEN"],"nativeName":"Guyana","numericCode":"328","currencies":[{"code":"GYD","name":"Guyanese dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Guyana","es":"Guyana","fr":"Guyane","ja":"ガイアナ","it":"Guyana","br":"Guiana","pt":"Guiana","nl":"Guyana","hr":"Gvajana","fa":"گویان"},"flag":"https://restcountries.eu/data/guy.svg","regionalBlocs":[{"acronym":"CARICOM","name":"Caribbean Community","otherAcronyms":[],"otherNames":["Comunidad del Caribe","Communauté Caribéenne","Caribische Gemeenschap"]},{"acronym":"USAN","name":"Union of South American Nations","otherAcronyms":["UNASUR","UNASUL","UZAN"],"otherNames":["Unión de Naciones Suramericanas","União de Nações Sul-Americanas","Unie van Zuid-Amerikaanse Naties","South American Union"]}],"cioc":"GUY"} +{"name":"Haiti","topLevelDomain":[".ht"],"alpha2Code":"HT","alpha3Code":"HTI","callingCodes":["509"],"capital":"Port-au-Prince","altSpellings":["HT","Republic of Haiti","République d'Haïti","Repiblik Ayiti"],"region":"Americas","subregion":"Caribbean","population":11078033,"latlng":[19.0,-72.41666666],"demonym":"Haitian","area":27750.0,"gini":59.2,"timezones":["UTC-05:00"],"borders":["DOM"],"nativeName":"Haïti","numericCode":"332","currencies":[{"code":"HTG","name":"Haitian gourde","symbol":"G"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"},{"iso639_1":"ht","iso639_2":"hat","name":"Haitian","nativeName":"Kreyòl ayisyen"}],"translations":{"de":"Haiti","es":"Haiti","fr":"Haïti","ja":"ハイチ","it":"Haiti","br":"Haiti","pt":"Haiti","nl":"Haïti","hr":"Haiti","fa":"هائیتی"},"flag":"https://restcountries.eu/data/hti.svg","regionalBlocs":[{"acronym":"CARICOM","name":"Caribbean Community","otherAcronyms":[],"otherNames":["Comunidad del Caribe","Communauté Caribéenne","Caribische Gemeenschap"]}],"cioc":"HAI"} +{"name":"Heard Island and McDonald Islands","topLevelDomain":[".hm",".aq"],"alpha2Code":"HM","alpha3Code":"HMD","callingCodes":[""],"capital":"","altSpellings":["HM"],"region":"","subregion":"","population":0,"latlng":[-53.1,72.51666666],"demonym":"Heard and McDonald Islander","area":412.0,"gini":null,"timezones":["UTC+05:00"],"borders":[],"nativeName":"Heard Island and McDonald Islands","numericCode":"334","currencies":[{"code":"AUD","name":"Australian dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Heard und die McDonaldinseln","es":"Islas Heard y McDonald","fr":"Îles Heard-et-MacDonald","ja":"ハード島とマクドナルド諸島","it":"Isole Heard e McDonald","br":"Ilha Heard e Ilhas McDonald","pt":"Ilha Heard e Ilhas McDonald","nl":"Heard- en McDonaldeilanden","hr":"Otok Heard i otočje McDonald","fa":"جزیره هرد و جزایر مک‌دونالد"},"flag":"https://restcountries.eu/data/hmd.svg","regionalBlocs":[],"cioc":""} +{"name":"Holy See","topLevelDomain":[".va"],"alpha2Code":"VA","alpha3Code":"VAT","callingCodes":["379"],"capital":"Rome","altSpellings":["Sancta Sedes","Vatican","The Vatican"],"region":"Europe","subregion":"Southern Europe","population":451,"latlng":[41.9,12.45],"demonym":"","area":0.44,"gini":null,"timezones":["UTC+01:00"],"borders":["ITA"],"nativeName":"Sancta Sedes","numericCode":"336","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"la","iso639_2":"lat","name":"Latin","nativeName":"latine"},{"iso639_1":"it","iso639_2":"ita","name":"Italian","nativeName":"Italiano"},{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"},{"iso639_1":"de","iso639_2":"deu","name":"German","nativeName":"Deutsch"}],"translations":{"de":"Heiliger Stuhl","es":"Santa Sede","fr":"voir Saint","ja":"聖座","it":"Santa Sede","br":"Vaticano","pt":"Vaticano","nl":"Heilige Stoel","hr":"Sveta Stolica","fa":"سریر مقدس"},"flag":"https://restcountries.eu/data/vat.svg","regionalBlocs":[],"cioc":""} +{"name":"Honduras","topLevelDomain":[".hn"],"alpha2Code":"HN","alpha3Code":"HND","callingCodes":["504"],"capital":"Tegucigalpa","altSpellings":["HN","Republic of Honduras","República de Honduras"],"region":"Americas","subregion":"Central America","population":8576532,"latlng":[15.0,-86.5],"demonym":"Honduran","area":112492.0,"gini":57.0,"timezones":["UTC-06:00"],"borders":["GTM","SLV","NIC"],"nativeName":"Honduras","numericCode":"340","currencies":[{"code":"HNL","name":"Honduran lempira","symbol":"L"}],"languages":[{"iso639_1":"es","iso639_2":"spa","name":"Spanish","nativeName":"Español"}],"translations":{"de":"Honduras","es":"Honduras","fr":"Honduras","ja":"ホンジュラス","it":"Honduras","br":"Honduras","pt":"Honduras","nl":"Honduras","hr":"Honduras","fa":"هندوراس"},"flag":"https://restcountries.eu/data/hnd.svg","regionalBlocs":[{"acronym":"CAIS","name":"Central American Integration System","otherAcronyms":["SICA"],"otherNames":["Sistema de la Integración Centroamericana,"]}],"cioc":"HON"} +{"name":"Hong Kong","topLevelDomain":[".hk"],"alpha2Code":"HK","alpha3Code":"HKG","callingCodes":["852"],"capital":"City of Victoria","altSpellings":["HK","香港"],"region":"Asia","subregion":"Eastern Asia","population":7324300,"latlng":[22.25,114.16666666],"demonym":"Chinese","area":1104.0,"gini":53.3,"timezones":["UTC+08:00"],"borders":["CHN"],"nativeName":"香港","numericCode":"344","currencies":[{"code":"HKD","name":"Hong Kong dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"zh","iso639_2":"zho","name":"Chinese","nativeName":"中文 (Zhōngwén)"}],"translations":{"de":"Hong Kong","es":"Hong Kong","fr":"Hong Kong","ja":"香港","it":"Hong Kong","br":"Hong Kong","pt":"Hong Kong","nl":"Hongkong","hr":"Hong Kong","fa":"هنگ‌کنگ"},"flag":"https://restcountries.eu/data/hkg.svg","regionalBlocs":[],"cioc":"HKG"} +{"name":"Hungary","topLevelDomain":[".hu"],"alpha2Code":"HU","alpha3Code":"HUN","callingCodes":["36"],"capital":"Budapest","altSpellings":["HU"],"region":"Europe","subregion":"Eastern Europe","population":9823000,"latlng":[47.0,20.0],"demonym":"Hungarian","area":93028.0,"gini":31.2,"timezones":["UTC+01:00"],"borders":["AUT","HRV","ROU","SRB","SVK","SVN","UKR"],"nativeName":"Magyarország","numericCode":"348","currencies":[{"code":"HUF","name":"Hungarian forint","symbol":"Ft"}],"languages":[{"iso639_1":"hu","iso639_2":"hun","name":"Hungarian","nativeName":"magyar"}],"translations":{"de":"Ungarn","es":"Hungría","fr":"Hongrie","ja":"ハンガリー","it":"Ungheria","br":"Hungria","pt":"Hungria","nl":"Hongarije","hr":"Mađarska","fa":"مجارستان"},"flag":"https://restcountries.eu/data/hun.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"HUN"} +{"name":"Iceland","topLevelDomain":[".is"],"alpha2Code":"IS","alpha3Code":"ISL","callingCodes":["354"],"capital":"Reykjavík","altSpellings":["IS","Island","Republic of Iceland","Lýðveldið Ísland"],"region":"Europe","subregion":"Northern Europe","population":334300,"latlng":[65.0,-18.0],"demonym":"Icelander","area":103000.0,"gini":null,"timezones":["UTC"],"borders":[],"nativeName":"Ísland","numericCode":"352","currencies":[{"code":"ISK","name":"Icelandic króna","symbol":"kr"}],"languages":[{"iso639_1":"is","iso639_2":"isl","name":"Icelandic","nativeName":"Íslenska"}],"translations":{"de":"Island","es":"Islandia","fr":"Islande","ja":"アイスランド","it":"Islanda","br":"Islândia","pt":"Islândia","nl":"IJsland","hr":"Island","fa":"ایسلند"},"flag":"https://restcountries.eu/data/isl.svg","regionalBlocs":[{"acronym":"EFTA","name":"European Free Trade Association","otherAcronyms":[],"otherNames":[]}],"cioc":"ISL"} +{"name":"India","topLevelDomain":[".in"],"alpha2Code":"IN","alpha3Code":"IND","callingCodes":["91"],"capital":"New Delhi","altSpellings":["IN","Bhārat","Republic of India","Bharat Ganrajya"],"region":"Asia","subregion":"Southern Asia","population":1295210000,"latlng":[20.0,77.0],"demonym":"Indian","area":3287590.0,"gini":33.4,"timezones":["UTC+05:30"],"borders":["AFG","BGD","BTN","MMR","CHN","NPL","PAK","LKA"],"nativeName":"भारत","numericCode":"356","currencies":[{"code":"INR","name":"Indian rupee","symbol":"₹"}],"languages":[{"iso639_1":"hi","iso639_2":"hin","name":"Hindi","nativeName":"हिन्दी"},{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Indien","es":"India","fr":"Inde","ja":"インド","it":"India","br":"Índia","pt":"Índia","nl":"India","hr":"Indija","fa":"هند"},"flag":"https://restcountries.eu/data/ind.svg","regionalBlocs":[{"acronym":"SAARC","name":"South Asian Association for Regional Cooperation","otherAcronyms":[],"otherNames":[]}],"cioc":"IND"} +{"name":"Indonesia","topLevelDomain":[".id"],"alpha2Code":"ID","alpha3Code":"IDN","callingCodes":["62"],"capital":"Jakarta","altSpellings":["ID","Republic of Indonesia","Republik Indonesia"],"region":"Asia","subregion":"South-Eastern Asia","population":258705000,"latlng":[-5.0,120.0],"demonym":"Indonesian","area":1904569.0,"gini":34.0,"timezones":["UTC+07:00","UTC+08:00","UTC+09:00"],"borders":["TLS","MYS","PNG"],"nativeName":"Indonesia","numericCode":"360","currencies":[{"code":"IDR","name":"Indonesian rupiah","symbol":"Rp"}],"languages":[{"iso639_1":"id","iso639_2":"ind","name":"Indonesian","nativeName":"Bahasa Indonesia"}],"translations":{"de":"Indonesien","es":"Indonesia","fr":"Indonésie","ja":"インドネシア","it":"Indonesia","br":"Indonésia","pt":"Indonésia","nl":"Indonesië","hr":"Indonezija","fa":"اندونزی"},"flag":"https://restcountries.eu/data/idn.svg","regionalBlocs":[{"acronym":"ASEAN","name":"Association of Southeast Asian Nations","otherAcronyms":[],"otherNames":[]}],"cioc":"INA"} +{"name":"Côte d'Ivoire","topLevelDomain":[".ci"],"alpha2Code":"CI","alpha3Code":"CIV","callingCodes":["225"],"capital":"Yamoussoukro","altSpellings":["CI","Ivory Coast","Republic of Côte d'Ivoire","République de Côte d'Ivoire"],"region":"Africa","subregion":"Western Africa","population":22671331,"latlng":[8.0,-5.0],"demonym":"Ivorian","area":322463.0,"gini":41.5,"timezones":["UTC"],"borders":["BFA","GHA","GIN","LBR","MLI"],"nativeName":"Côte d'Ivoire","numericCode":"384","currencies":[{"code":"XOF","name":"West African CFA franc","symbol":"Fr"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Elfenbeinküste","es":"Costa de Marfil","fr":"Côte d'Ivoire","ja":"コートジボワール","it":"Costa D'Avorio","br":"Costa do Marfim","pt":"Costa do Marfim","nl":"Ivoorkust","hr":"Obala Bjelokosti","fa":"ساحل عاج"},"flag":"https://restcountries.eu/data/civ.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"CIV"} +{"name":"Iran (Islamic Republic of)","topLevelDomain":[".ir"],"alpha2Code":"IR","alpha3Code":"IRN","callingCodes":["98"],"capital":"Tehran","altSpellings":["IR","Islamic Republic of Iran","Jomhuri-ye Eslāmi-ye Irān"],"region":"Asia","subregion":"Southern Asia","population":79369900,"latlng":[32.0,53.0],"demonym":"Iranian","area":1648195.0,"gini":38.3,"timezones":["UTC+03:30"],"borders":["AFG","ARM","AZE","IRQ","PAK","TUR","TKM"],"nativeName":"ایران","numericCode":"364","currencies":[{"code":"IRR","name":"Iranian rial","symbol":"﷼"}],"languages":[{"iso639_1":"fa","iso639_2":"fas","name":"Persian (Farsi)","nativeName":"فارسی"}],"translations":{"de":"Iran","es":"Iran","fr":"Iran","ja":"イラン・イスラム共和国","it":null,"br":"Irã","pt":"Irão","nl":"Iran","hr":"Iran","fa":"ایران"},"flag":"https://restcountries.eu/data/irn.svg","regionalBlocs":[],"cioc":"IRI"} +{"name":"Iraq","topLevelDomain":[".iq"],"alpha2Code":"IQ","alpha3Code":"IRQ","callingCodes":["964"],"capital":"Baghdad","altSpellings":["IQ","Republic of Iraq","Jumhūriyyat al-‘Irāq"],"region":"Asia","subregion":"Western Asia","population":37883543,"latlng":[33.0,44.0],"demonym":"Iraqi","area":438317.0,"gini":30.9,"timezones":["UTC+03:00"],"borders":["IRN","JOR","KWT","SAU","SYR","TUR"],"nativeName":"العراق","numericCode":"368","currencies":[{"code":"IQD","name":"Iraqi dinar","symbol":"ع.د"}],"languages":[{"iso639_1":"ar","iso639_2":"ara","name":"Arabic","nativeName":"العربية"},{"iso639_1":"ku","iso639_2":"kur","name":"Kurdish","nativeName":"Kurdî"}],"translations":{"de":"Irak","es":"Irak","fr":"Irak","ja":"イラク","it":"Iraq","br":"Iraque","pt":"Iraque","nl":"Irak","hr":"Irak","fa":"عراق"},"flag":"https://restcountries.eu/data/irq.svg","regionalBlocs":[{"acronym":"AL","name":"Arab League","otherAcronyms":[],"otherNames":["جامعة الدول العربية","Jāmiʻat ad-Duwal al-ʻArabīyah","League of Arab States"]}],"cioc":"IRQ"} +{"name":"Ireland","topLevelDomain":[".ie"],"alpha2Code":"IE","alpha3Code":"IRL","callingCodes":["353"],"capital":"Dublin","altSpellings":["IE","Éire","Republic of Ireland","Poblacht na hÉireann"],"region":"Europe","subregion":"Northern Europe","population":6378000,"latlng":[53.0,-8.0],"demonym":"Irish","area":70273.0,"gini":34.3,"timezones":["UTC"],"borders":["GBR"],"nativeName":"Éire","numericCode":"372","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"ga","iso639_2":"gle","name":"Irish","nativeName":"Gaeilge"},{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Irland","es":"Irlanda","fr":"Irlande","ja":"アイルランド","it":"Irlanda","br":"Irlanda","pt":"Irlanda","nl":"Ierland","hr":"Irska","fa":"ایرلند"},"flag":"https://restcountries.eu/data/irl.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"IRL"} +{"name":"Isle of Man","topLevelDomain":[".im"],"alpha2Code":"IM","alpha3Code":"IMN","callingCodes":["44"],"capital":"Douglas","altSpellings":["IM","Ellan Vannin","Mann","Mannin"],"region":"Europe","subregion":"Northern Europe","population":84497,"latlng":[54.25,-4.5],"demonym":"Manx","area":572.0,"gini":null,"timezones":["UTC+00:00"],"borders":[],"nativeName":"Isle of Man","numericCode":"833","currencies":[{"code":"GBP","name":"British pound","symbol":"£"},{"code":"IMP[G]","name":"Manx pound","symbol":"£"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"gv","iso639_2":"glv","name":"Manx","nativeName":"Gaelg"}],"translations":{"de":"Insel Man","es":"Isla de Man","fr":"Île de Man","ja":"マン島","it":"Isola di Man","br":"Ilha de Man","pt":"Ilha de Man","nl":"Isle of Man","hr":"Otok Man","fa":"جزیره من"},"flag":"https://restcountries.eu/data/imn.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":""} +{"name":"Israel","topLevelDomain":[".il"],"alpha2Code":"IL","alpha3Code":"ISR","callingCodes":["972"],"capital":"Jerusalem","altSpellings":["IL","State of Israel","Medīnat Yisrā'el"],"region":"Asia","subregion":"Western Asia","population":8527400,"latlng":[31.5,34.75],"demonym":"Israeli","area":20770.0,"gini":39.2,"timezones":["UTC+02:00"],"borders":["EGY","JOR","LBN","SYR"],"nativeName":"יִשְׂרָאֵל","numericCode":"376","currencies":[{"code":"ILS","name":"Israeli new shekel","symbol":"₪"}],"languages":[{"iso639_1":"he","iso639_2":"heb","name":"Hebrew (modern)","nativeName":"עברית"},{"iso639_1":"ar","iso639_2":"ara","name":"Arabic","nativeName":"العربية"}],"translations":{"de":"Israel","es":"Israel","fr":"Israël","ja":"イスラエル","it":"Israele","br":"Israel","pt":"Israel","nl":"Israël","hr":"Izrael","fa":"اسرائیل"},"flag":"https://restcountries.eu/data/isr.svg","regionalBlocs":[],"cioc":"ISR"} +{"name":"Italy","topLevelDomain":[".it"],"alpha2Code":"IT","alpha3Code":"ITA","callingCodes":["39"],"capital":"Rome","altSpellings":["IT","Italian Republic","Repubblica italiana"],"region":"Europe","subregion":"Southern Europe","population":60665551,"latlng":[42.83333333,12.83333333],"demonym":"Italian","area":301336.0,"gini":36.0,"timezones":["UTC+01:00"],"borders":["AUT","FRA","SMR","SVN","CHE","VAT"],"nativeName":"Italia","numericCode":"380","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"it","iso639_2":"ita","name":"Italian","nativeName":"Italiano"}],"translations":{"de":"Italien","es":"Italia","fr":"Italie","ja":"イタリア","it":"Italia","br":"Itália","pt":"Itália","nl":"Italië","hr":"Italija","fa":"ایتالیا"},"flag":"https://restcountries.eu/data/ita.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"ITA"} +{"name":"Jamaica","topLevelDomain":[".jm"],"alpha2Code":"JM","alpha3Code":"JAM","callingCodes":["1876"],"capital":"Kingston","altSpellings":["JM"],"region":"Americas","subregion":"Caribbean","population":2723246,"latlng":[18.25,-77.5],"demonym":"Jamaican","area":10991.0,"gini":45.5,"timezones":["UTC-05:00"],"borders":[],"nativeName":"Jamaica","numericCode":"388","currencies":[{"code":"JMD","name":"Jamaican dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Jamaika","es":"Jamaica","fr":"Jamaïque","ja":"ジャマイカ","it":"Giamaica","br":"Jamaica","pt":"Jamaica","nl":"Jamaica","hr":"Jamajka","fa":"جامائیکا"},"flag":"https://restcountries.eu/data/jam.svg","regionalBlocs":[{"acronym":"CARICOM","name":"Caribbean Community","otherAcronyms":[],"otherNames":["Comunidad del Caribe","Communauté Caribéenne","Caribische Gemeenschap"]}],"cioc":"JAM"} +{"name":"Japan","topLevelDomain":[".jp"],"alpha2Code":"JP","alpha3Code":"JPN","callingCodes":["81"],"capital":"Tokyo","altSpellings":["JP","Nippon","Nihon"],"region":"Asia","subregion":"Eastern Asia","population":126960000,"latlng":[36.0,138.0],"demonym":"Japanese","area":377930.0,"gini":38.1,"timezones":["UTC+09:00"],"borders":[],"nativeName":"日本","numericCode":"392","currencies":[{"code":"JPY","name":"Japanese yen","symbol":"¥"}],"languages":[{"iso639_1":"ja","iso639_2":"jpn","name":"Japanese","nativeName":"日本語 (にほんご)"}],"translations":{"de":"Japan","es":"Japón","fr":"Japon","ja":"日本","it":"Giappone","br":"Japão","pt":"Japão","nl":"Japan","hr":"Japan","fa":"ژاپن"},"flag":"https://restcountries.eu/data/jpn.svg","regionalBlocs":[],"cioc":"JPN"} +{"name":"Jersey","topLevelDomain":[".je"],"alpha2Code":"JE","alpha3Code":"JEY","callingCodes":["44"],"capital":"Saint Helier","altSpellings":["JE","Bailiwick of Jersey","Bailliage de Jersey","Bailliage dé Jèrri"],"region":"Europe","subregion":"Northern Europe","population":100800,"latlng":[49.25,-2.16666666],"demonym":"Channel Islander","area":116.0,"gini":null,"timezones":["UTC+01:00"],"borders":[],"nativeName":"Jersey","numericCode":"832","currencies":[{"code":"GBP","name":"British pound","symbol":"£"},{"code":"JEP[G]","name":"Jersey pound","symbol":"£"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Jersey","es":"Jersey","fr":"Jersey","ja":"ジャージー","it":"Isola di Jersey","br":"Jersey","pt":"Jersey","nl":"Jersey","hr":"Jersey","fa":"جرزی"},"flag":"https://restcountries.eu/data/jey.svg","regionalBlocs":[],"cioc":""} +{"name":"Jordan","topLevelDomain":[".jo"],"alpha2Code":"JO","alpha3Code":"JOR","callingCodes":["962"],"capital":"Amman","altSpellings":["JO","Hashemite Kingdom of Jordan","al-Mamlakah al-Urdunīyah al-Hāshimīyah"],"region":"Asia","subregion":"Western Asia","population":9531712,"latlng":[31.0,36.0],"demonym":"Jordanian","area":89342.0,"gini":35.4,"timezones":["UTC+03:00"],"borders":["IRQ","ISR","SAU","SYR"],"nativeName":"الأردن","numericCode":"400","currencies":[{"code":"JOD","name":"Jordanian dinar","symbol":"د.ا"}],"languages":[{"iso639_1":"ar","iso639_2":"ara","name":"Arabic","nativeName":"العربية"}],"translations":{"de":"Jordanien","es":"Jordania","fr":"Jordanie","ja":"ヨルダン","it":"Giordania","br":"Jordânia","pt":"Jordânia","nl":"Jordanië","hr":"Jordan","fa":"اردن"},"flag":"https://restcountries.eu/data/jor.svg","regionalBlocs":[{"acronym":"AL","name":"Arab League","otherAcronyms":[],"otherNames":["جامعة الدول العربية","Jāmiʻat ad-Duwal al-ʻArabīyah","League of Arab States"]}],"cioc":"JOR"} +{"name":"Kazakhstan","topLevelDomain":[".kz",".қаз"],"alpha2Code":"KZ","alpha3Code":"KAZ","callingCodes":["76","77"],"capital":"Astana","altSpellings":["KZ","Qazaqstan","Казахстан","Republic of Kazakhstan","Қазақстан Республикасы","Qazaqstan Respublïkası","Республика Казахстан","Respublika Kazakhstan"],"region":"Asia","subregion":"Central Asia","population":17753200,"latlng":[48.0,68.0],"demonym":"Kazakhstani","area":2724900.0,"gini":29.0,"timezones":["UTC+05:00","UTC+06:00"],"borders":["CHN","KGZ","RUS","TKM","UZB"],"nativeName":"Қазақстан","numericCode":"398","currencies":[{"code":"KZT","name":"Kazakhstani tenge","symbol":null}],"languages":[{"iso639_1":"kk","iso639_2":"kaz","name":"Kazakh","nativeName":"қазақ тілі"},{"iso639_1":"ru","iso639_2":"rus","name":"Russian","nativeName":"Русский"}],"translations":{"de":"Kasachstan","es":"Kazajistán","fr":"Kazakhstan","ja":"カザフスタン","it":"Kazakistan","br":"Cazaquistão","pt":"Cazaquistão","nl":"Kazachstan","hr":"Kazahstan","fa":"قزاقستان"},"flag":"https://restcountries.eu/data/kaz.svg","regionalBlocs":[{"acronym":"EEU","name":"Eurasian Economic Union","otherAcronyms":["EAEU"],"otherNames":[]}],"cioc":"KAZ"} +{"name":"Kenya","topLevelDomain":[".ke"],"alpha2Code":"KE","alpha3Code":"KEN","callingCodes":["254"],"capital":"Nairobi","altSpellings":["KE","Republic of Kenya","Jamhuri ya Kenya"],"region":"Africa","subregion":"Eastern Africa","population":47251000,"latlng":[1.0,38.0],"demonym":"Kenyan","area":580367.0,"gini":47.7,"timezones":["UTC+03:00"],"borders":["ETH","SOM","SSD","TZA","UGA"],"nativeName":"Kenya","numericCode":"404","currencies":[{"code":"KES","name":"Kenyan shilling","symbol":"Sh"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"sw","iso639_2":"swa","name":"Swahili","nativeName":"Kiswahili"}],"translations":{"de":"Kenia","es":"Kenia","fr":"Kenya","ja":"ケニア","it":"Kenya","br":"Quênia","pt":"Quénia","nl":"Kenia","hr":"Kenija","fa":"کنیا"},"flag":"https://restcountries.eu/data/ken.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"KEN"} +{"name":"Kiribati","topLevelDomain":[".ki"],"alpha2Code":"KI","alpha3Code":"KIR","callingCodes":["686"],"capital":"South Tarawa","altSpellings":["KI","Republic of Kiribati","Ribaberiki Kiribati"],"region":"Oceania","subregion":"Micronesia","population":113400,"latlng":[1.41666666,173.0],"demonym":"I-Kiribati","area":811.0,"gini":null,"timezones":["UTC+12:00","UTC+13:00","UTC+14:00"],"borders":[],"nativeName":"Kiribati","numericCode":"296","currencies":[{"code":"AUD","name":"Australian dollar","symbol":"$"},{"code":"(none)","name":"Kiribati dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Kiribati","es":"Kiribati","fr":"Kiribati","ja":"キリバス","it":"Kiribati","br":"Kiribati","pt":"Quiribáti","nl":"Kiribati","hr":"Kiribati","fa":"کیریباتی"},"flag":"https://restcountries.eu/data/kir.svg","regionalBlocs":[],"cioc":"KIR"} +{"name":"Kuwait","topLevelDomain":[".kw"],"alpha2Code":"KW","alpha3Code":"KWT","callingCodes":["965"],"capital":"Kuwait City","altSpellings":["KW","State of Kuwait","Dawlat al-Kuwait"],"region":"Asia","subregion":"Western Asia","population":4183658,"latlng":[29.5,45.75],"demonym":"Kuwaiti","area":17818.0,"gini":null,"timezones":["UTC+03:00"],"borders":["IRN","SAU"],"nativeName":"الكويت","numericCode":"414","currencies":[{"code":"KWD","name":"Kuwaiti dinar","symbol":"د.ك"}],"languages":[{"iso639_1":"ar","iso639_2":"ara","name":"Arabic","nativeName":"العربية"}],"translations":{"de":"Kuwait","es":"Kuwait","fr":"Koweït","ja":"クウェート","it":"Kuwait","br":"Kuwait","pt":"Kuwait","nl":"Koeweit","hr":"Kuvajt","fa":"کویت"},"flag":"https://restcountries.eu/data/kwt.svg","regionalBlocs":[{"acronym":"AL","name":"Arab League","otherAcronyms":[],"otherNames":["جامعة الدول العربية","Jāmiʻat ad-Duwal al-ʻArabīyah","League of Arab States"]}],"cioc":"KUW"} +{"name":"Kyrgyzstan","topLevelDomain":[".kg"],"alpha2Code":"KG","alpha3Code":"KGZ","callingCodes":["996"],"capital":"Bishkek","altSpellings":["KG","Киргизия","Kyrgyz Republic","Кыргыз Республикасы","Kyrgyz Respublikasy"],"region":"Asia","subregion":"Central Asia","population":6047800,"latlng":[41.0,75.0],"demonym":"Kirghiz","area":199951.0,"gini":36.2,"timezones":["UTC+06:00"],"borders":["CHN","KAZ","TJK","UZB"],"nativeName":"Кыргызстан","numericCode":"417","currencies":[{"code":"KGS","name":"Kyrgyzstani som","symbol":"с"}],"languages":[{"iso639_1":"ky","iso639_2":"kir","name":"Kyrgyz","nativeName":"Кыргызча"},{"iso639_1":"ru","iso639_2":"rus","name":"Russian","nativeName":"Русский"}],"translations":{"de":"Kirgisistan","es":"Kirguizistán","fr":"Kirghizistan","ja":"キルギス","it":"Kirghizistan","br":"Quirguistão","pt":"Quirguizistão","nl":"Kirgizië","hr":"Kirgistan","fa":"قرقیزستان"},"flag":"https://restcountries.eu/data/kgz.svg","regionalBlocs":[{"acronym":"EEU","name":"Eurasian Economic Union","otherAcronyms":["EAEU"],"otherNames":[]}],"cioc":"KGZ"} +{"name":"Lao People's Democratic Republic","topLevelDomain":[".la"],"alpha2Code":"LA","alpha3Code":"LAO","callingCodes":["856"],"capital":"Vientiane","altSpellings":["LA","Lao","Laos","Lao People's Democratic Republic","Sathalanalat Paxathipatai Paxaxon Lao"],"region":"Asia","subregion":"South-Eastern Asia","population":6492400,"latlng":[18.0,105.0],"demonym":"Laotian","area":236800.0,"gini":36.7,"timezones":["UTC+07:00"],"borders":["MMR","KHM","CHN","THA","VNM"],"nativeName":"ສປປລາວ","numericCode":"418","currencies":[{"code":"LAK","name":"Lao kip","symbol":"₭"}],"languages":[{"iso639_1":"lo","iso639_2":"lao","name":"Lao","nativeName":"ພາສາລາວ"}],"translations":{"de":"Laos","es":"Laos","fr":"Laos","ja":"ラオス人民民主共和国","it":"Laos","br":"Laos","pt":"Laos","nl":"Laos","hr":"Laos","fa":"لائوس"},"flag":"https://restcountries.eu/data/lao.svg","regionalBlocs":[{"acronym":"ASEAN","name":"Association of Southeast Asian Nations","otherAcronyms":[],"otherNames":[]}],"cioc":"LAO"} +{"name":"Latvia","topLevelDomain":[".lv"],"alpha2Code":"LV","alpha3Code":"LVA","callingCodes":["371"],"capital":"Riga","altSpellings":["LV","Republic of Latvia","Latvijas Republika"],"region":"Europe","subregion":"Northern Europe","population":1961600,"latlng":[57.0,25.0],"demonym":"Latvian","area":64559.0,"gini":36.6,"timezones":["UTC+02:00"],"borders":["BLR","EST","LTU","RUS"],"nativeName":"Latvija","numericCode":"428","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"lv","iso639_2":"lav","name":"Latvian","nativeName":"latviešu valoda"}],"translations":{"de":"Lettland","es":"Letonia","fr":"Lettonie","ja":"ラトビア","it":"Lettonia","br":"Letônia","pt":"Letónia","nl":"Letland","hr":"Latvija","fa":"لتونی"},"flag":"https://restcountries.eu/data/lva.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"LAT"} +{"name":"Lebanon","topLevelDomain":[".lb"],"alpha2Code":"LB","alpha3Code":"LBN","callingCodes":["961"],"capital":"Beirut","altSpellings":["LB","Lebanese Republic","Al-Jumhūrīyah Al-Libnānīyah"],"region":"Asia","subregion":"Western Asia","population":5988000,"latlng":[33.83333333,35.83333333],"demonym":"Lebanese","area":10452.0,"gini":null,"timezones":["UTC+02:00"],"borders":["ISR","SYR"],"nativeName":"لبنان","numericCode":"422","currencies":[{"code":"LBP","name":"Lebanese pound","symbol":"ل.ل"}],"languages":[{"iso639_1":"ar","iso639_2":"ara","name":"Arabic","nativeName":"العربية"},{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Libanon","es":"Líbano","fr":"Liban","ja":"レバノン","it":"Libano","br":"Líbano","pt":"Líbano","nl":"Libanon","hr":"Libanon","fa":"لبنان"},"flag":"https://restcountries.eu/data/lbn.svg","regionalBlocs":[{"acronym":"AL","name":"Arab League","otherAcronyms":[],"otherNames":["جامعة الدول العربية","Jāmiʻat ad-Duwal al-ʻArabīyah","League of Arab States"]}],"cioc":"LIB"} +{"name":"Lesotho","topLevelDomain":[".ls"],"alpha2Code":"LS","alpha3Code":"LSO","callingCodes":["266"],"capital":"Maseru","altSpellings":["LS","Kingdom of Lesotho","Muso oa Lesotho"],"region":"Africa","subregion":"Southern Africa","population":1894194,"latlng":[-29.5,28.5],"demonym":"Mosotho","area":30355.0,"gini":52.5,"timezones":["UTC+02:00"],"borders":["ZAF"],"nativeName":"Lesotho","numericCode":"426","currencies":[{"code":"LSL","name":"Lesotho loti","symbol":"L"},{"code":"ZAR","name":"South African rand","symbol":"R"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"st","iso639_2":"sot","name":"Southern Sotho","nativeName":"Sesotho"}],"translations":{"de":"Lesotho","es":"Lesotho","fr":"Lesotho","ja":"レソト","it":"Lesotho","br":"Lesoto","pt":"Lesoto","nl":"Lesotho","hr":"Lesoto","fa":"لسوتو"},"flag":"https://restcountries.eu/data/lso.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"LES"} +{"name":"Liberia","topLevelDomain":[".lr"],"alpha2Code":"LR","alpha3Code":"LBR","callingCodes":["231"],"capital":"Monrovia","altSpellings":["LR","Republic of Liberia"],"region":"Africa","subregion":"Western Africa","population":4615000,"latlng":[6.5,-9.5],"demonym":"Liberian","area":111369.0,"gini":38.2,"timezones":["UTC"],"borders":["GIN","CIV","SLE"],"nativeName":"Liberia","numericCode":"430","currencies":[{"code":"LRD","name":"Liberian dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Liberia","es":"Liberia","fr":"Liberia","ja":"リベリア","it":"Liberia","br":"Libéria","pt":"Libéria","nl":"Liberia","hr":"Liberija","fa":"لیبریا"},"flag":"https://restcountries.eu/data/lbr.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"LBR"} +{"name":"Libya","topLevelDomain":[".ly"],"alpha2Code":"LY","alpha3Code":"LBY","callingCodes":["218"],"capital":"Tripoli","altSpellings":["LY","State of Libya","Dawlat Libya"],"region":"Africa","subregion":"Northern Africa","population":6385000,"latlng":[25.0,17.0],"demonym":"Libyan","area":1759540.0,"gini":null,"timezones":["UTC+01:00"],"borders":["DZA","TCD","EGY","NER","SDN","TUN"],"nativeName":"‏ليبيا","numericCode":"434","currencies":[{"code":"LYD","name":"Libyan dinar","symbol":"ل.د"}],"languages":[{"iso639_1":"ar","iso639_2":"ara","name":"Arabic","nativeName":"العربية"}],"translations":{"de":"Libyen","es":"Libia","fr":"Libye","ja":"リビア","it":"Libia","br":"Líbia","pt":"Líbia","nl":"Libië","hr":"Libija","fa":"لیبی"},"flag":"https://restcountries.eu/data/lby.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]},{"acronym":"AL","name":"Arab League","otherAcronyms":[],"otherNames":["جامعة الدول العربية","Jāmiʻat ad-Duwal al-ʻArabīyah","League of Arab States"]}],"cioc":"LBA"} +{"name":"Liechtenstein","topLevelDomain":[".li"],"alpha2Code":"LI","alpha3Code":"LIE","callingCodes":["423"],"capital":"Vaduz","altSpellings":["LI","Principality of Liechtenstein","Fürstentum Liechtenstein"],"region":"Europe","subregion":"Western Europe","population":37623,"latlng":[47.26666666,9.53333333],"demonym":"Liechtensteiner","area":160.0,"gini":null,"timezones":["UTC+01:00"],"borders":["AUT","CHE"],"nativeName":"Liechtenstein","numericCode":"438","currencies":[{"code":"CHF","name":"Swiss franc","symbol":"Fr"}],"languages":[{"iso639_1":"de","iso639_2":"deu","name":"German","nativeName":"Deutsch"}],"translations":{"de":"Liechtenstein","es":"Liechtenstein","fr":"Liechtenstein","ja":"リヒテンシュタイン","it":"Liechtenstein","br":"Liechtenstein","pt":"Listenstaine","nl":"Liechtenstein","hr":"Lihtenštajn","fa":"لیختن‌اشتاین"},"flag":"https://restcountries.eu/data/lie.svg","regionalBlocs":[{"acronym":"EFTA","name":"European Free Trade Association","otherAcronyms":[],"otherNames":[]}],"cioc":"LIE"} +{"name":"Lithuania","topLevelDomain":[".lt"],"alpha2Code":"LT","alpha3Code":"LTU","callingCodes":["370"],"capital":"Vilnius","altSpellings":["LT","Republic of Lithuania","Lietuvos Respublika"],"region":"Europe","subregion":"Northern Europe","population":2872294,"latlng":[56.0,24.0],"demonym":"Lithuanian","area":65300.0,"gini":37.6,"timezones":["UTC+02:00"],"borders":["BLR","LVA","POL","RUS"],"nativeName":"Lietuva","numericCode":"440","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"lt","iso639_2":"lit","name":"Lithuanian","nativeName":"lietuvių kalba"}],"translations":{"de":"Litauen","es":"Lituania","fr":"Lituanie","ja":"リトアニア","it":"Lituania","br":"Lituânia","pt":"Lituânia","nl":"Litouwen","hr":"Litva","fa":"لیتوانی"},"flag":"https://restcountries.eu/data/ltu.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"LTU"} +{"name":"Luxembourg","topLevelDomain":[".lu"],"alpha2Code":"LU","alpha3Code":"LUX","callingCodes":["352"],"capital":"Luxembourg","altSpellings":["LU","Grand Duchy of Luxembourg","Grand-Duché de Luxembourg","Großherzogtum Luxemburg","Groussherzogtum Lëtzebuerg"],"region":"Europe","subregion":"Western Europe","population":576200,"latlng":[49.75,6.16666666],"demonym":"Luxembourger","area":2586.0,"gini":30.8,"timezones":["UTC+01:00"],"borders":["BEL","FRA","DEU"],"nativeName":"Luxembourg","numericCode":"442","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"},{"iso639_1":"de","iso639_2":"deu","name":"German","nativeName":"Deutsch"},{"iso639_1":"lb","iso639_2":"ltz","name":"Luxembourgish","nativeName":"Lëtzebuergesch"}],"translations":{"de":"Luxemburg","es":"Luxemburgo","fr":"Luxembourg","ja":"ルクセンブルク","it":"Lussemburgo","br":"Luxemburgo","pt":"Luxemburgo","nl":"Luxemburg","hr":"Luksemburg","fa":"لوکزامبورگ"},"flag":"https://restcountries.eu/data/lux.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"LUX"} +{"name":"Macao","topLevelDomain":[".mo"],"alpha2Code":"MO","alpha3Code":"MAC","callingCodes":["853"],"capital":"","altSpellings":["MO","澳门","Macao Special Administrative Region of the People's Republic of China","中華人民共和國澳門特別行政區","Região Administrativa Especial de Macau da República Popular da China"],"region":"Asia","subregion":"Eastern Asia","population":649100,"latlng":[22.16666666,113.55],"demonym":"Chinese","area":30.0,"gini":null,"timezones":["UTC+08:00"],"borders":["CHN"],"nativeName":"澳門","numericCode":"446","currencies":[{"code":"MOP","name":"Macanese pataca","symbol":"P"}],"languages":[{"iso639_1":"zh","iso639_2":"zho","name":"Chinese","nativeName":"中文 (Zhōngwén)"},{"iso639_1":"pt","iso639_2":"por","name":"Portuguese","nativeName":"Português"}],"translations":{"de":"Macao","es":"Macao","fr":"Macao","ja":"マカオ","it":"Macao","br":"Macau","pt":"Macau","nl":"Macao","hr":"Makao","fa":"مکائو"},"flag":"https://restcountries.eu/data/mac.svg","regionalBlocs":[],"cioc":""} +{"name":"Macedonia (the former Yugoslav Republic of)","topLevelDomain":[".mk"],"alpha2Code":"MK","alpha3Code":"MKD","callingCodes":["389"],"capital":"Skopje","altSpellings":["MK","Republic of Macedonia","Република Македонија"],"region":"Europe","subregion":"Southern Europe","population":2058539,"latlng":[41.83333333,22.0],"demonym":"Macedonian","area":25713.0,"gini":43.2,"timezones":["UTC+01:00"],"borders":["ALB","BGR","GRC","KOS","SRB"],"nativeName":"Македонија","numericCode":"807","currencies":[{"code":"MKD","name":"Macedonian denar","symbol":"ден"}],"languages":[{"iso639_1":"mk","iso639_2":"mkd","name":"Macedonian","nativeName":"македонски јазик"}],"translations":{"de":"Mazedonien","es":"Macedonia","fr":"Macédoine","ja":"マケドニア旧ユーゴスラビア共和国","it":"Macedonia","br":"Macedônia","pt":"Macedónia","nl":"Macedonië","hr":"Makedonija","fa":""},"flag":"https://restcountries.eu/data/mkd.svg","regionalBlocs":[{"acronym":"CEFTA","name":"Central European Free Trade Agreement","otherAcronyms":[],"otherNames":[]}],"cioc":"MKD"} +{"name":"Madagascar","topLevelDomain":[".mg"],"alpha2Code":"MG","alpha3Code":"MDG","callingCodes":["261"],"capital":"Antananarivo","altSpellings":["MG","Republic of Madagascar","Repoblikan'i Madagasikara","République de Madagascar"],"region":"Africa","subregion":"Eastern Africa","population":22434363,"latlng":[-20.0,47.0],"demonym":"Malagasy","area":587041.0,"gini":44.1,"timezones":["UTC+03:00"],"borders":[],"nativeName":"Madagasikara","numericCode":"450","currencies":[{"code":"MGA","name":"Malagasy ariary","symbol":"Ar"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"},{"iso639_1":"mg","iso639_2":"mlg","name":"Malagasy","nativeName":"fiteny malagasy"}],"translations":{"de":"Madagaskar","es":"Madagascar","fr":"Madagascar","ja":"マダガスカル","it":"Madagascar","br":"Madagascar","pt":"Madagáscar","nl":"Madagaskar","hr":"Madagaskar","fa":"ماداگاسکار"},"flag":"https://restcountries.eu/data/mdg.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"MAD"} +{"name":"Malawi","topLevelDomain":[".mw"],"alpha2Code":"MW","alpha3Code":"MWI","callingCodes":["265"],"capital":"Lilongwe","altSpellings":["MW","Republic of Malawi"],"region":"Africa","subregion":"Eastern Africa","population":16832910,"latlng":[-13.5,34.0],"demonym":"Malawian","area":118484.0,"gini":39.0,"timezones":["UTC+02:00"],"borders":["MOZ","TZA","ZMB"],"nativeName":"Malawi","numericCode":"454","currencies":[{"code":"MWK","name":"Malawian kwacha","symbol":"MK"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"ny","iso639_2":"nya","name":"Chichewa","nativeName":"chiCheŵa"}],"translations":{"de":"Malawi","es":"Malawi","fr":"Malawi","ja":"マラウイ","it":"Malawi","br":"Malawi","pt":"Malávi","nl":"Malawi","hr":"Malavi","fa":"مالاوی"},"flag":"https://restcountries.eu/data/mwi.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"MAW"} +{"name":"Malaysia","topLevelDomain":[".my"],"alpha2Code":"MY","alpha3Code":"MYS","callingCodes":["60"],"capital":"Kuala Lumpur","altSpellings":["MY"],"region":"Asia","subregion":"South-Eastern Asia","population":31405416,"latlng":[2.5,112.5],"demonym":"Malaysian","area":330803.0,"gini":46.2,"timezones":["UTC+08:00"],"borders":["BRN","IDN","THA"],"nativeName":"Malaysia","numericCode":"458","currencies":[{"code":"MYR","name":"Malaysian ringgit","symbol":"RM"}],"languages":[{"iso639_1":null,"iso639_2":"zsm","name":"Malaysian","nativeName":"بهاس مليسيا"}],"translations":{"de":"Malaysia","es":"Malasia","fr":"Malaisie","ja":"マレーシア","it":"Malesia","br":"Malásia","pt":"Malásia","nl":"Maleisië","hr":"Malezija","fa":"مالزی"},"flag":"https://restcountries.eu/data/mys.svg","regionalBlocs":[{"acronym":"ASEAN","name":"Association of Southeast Asian Nations","otherAcronyms":[],"otherNames":[]}],"cioc":"MAS"} +{"name":"Maldives","topLevelDomain":[".mv"],"alpha2Code":"MV","alpha3Code":"MDV","callingCodes":["960"],"capital":"Malé","altSpellings":["MV","Maldive Islands","Republic of the Maldives","Dhivehi Raajjeyge Jumhooriyya"],"region":"Asia","subregion":"Southern Asia","population":344023,"latlng":[3.25,73.0],"demonym":"Maldivan","area":300.0,"gini":37.4,"timezones":["UTC+05:00"],"borders":[],"nativeName":"Maldives","numericCode":"462","currencies":[{"code":"MVR","name":"Maldivian rufiyaa","symbol":".ރ"}],"languages":[{"iso639_1":"dv","iso639_2":"div","name":"Divehi","nativeName":"ދިވެހި"}],"translations":{"de":"Malediven","es":"Maldivas","fr":"Maldives","ja":"モルディブ","it":"Maldive","br":"Maldivas","pt":"Maldivas","nl":"Maldiven","hr":"Maldivi","fa":"مالدیو"},"flag":"https://restcountries.eu/data/mdv.svg","regionalBlocs":[{"acronym":"SAARC","name":"South Asian Association for Regional Cooperation","otherAcronyms":[],"otherNames":[]}],"cioc":"MDV"} +{"name":"Mali","topLevelDomain":[".ml"],"alpha2Code":"ML","alpha3Code":"MLI","callingCodes":["223"],"capital":"Bamako","altSpellings":["ML","Republic of Mali","République du Mali"],"region":"Africa","subregion":"Western Africa","population":18135000,"latlng":[17.0,-4.0],"demonym":"Malian","area":1240192.0,"gini":33.0,"timezones":["UTC"],"borders":["DZA","BFA","GIN","CIV","MRT","NER","SEN"],"nativeName":"Mali","numericCode":"466","currencies":[{"code":"XOF","name":"West African CFA franc","symbol":"Fr"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Mali","es":"Mali","fr":"Mali","ja":"マリ","it":"Mali","br":"Mali","pt":"Mali","nl":"Mali","hr":"Mali","fa":"مالی"},"flag":"https://restcountries.eu/data/mli.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"MLI"} +{"name":"Malta","topLevelDomain":[".mt"],"alpha2Code":"MT","alpha3Code":"MLT","callingCodes":["356"],"capital":"Valletta","altSpellings":["MT","Republic of Malta","Repubblika ta' Malta"],"region":"Europe","subregion":"Southern Europe","population":425384,"latlng":[35.83333333,14.58333333],"demonym":"Maltese","area":316.0,"gini":null,"timezones":["UTC+01:00"],"borders":[],"nativeName":"Malta","numericCode":"470","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"mt","iso639_2":"mlt","name":"Maltese","nativeName":"Malti"},{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Malta","es":"Malta","fr":"Malte","ja":"マルタ","it":"Malta","br":"Malta","pt":"Malta","nl":"Malta","hr":"Malta","fa":"مالت"},"flag":"https://restcountries.eu/data/mlt.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"MLT"} +{"name":"Marshall Islands","topLevelDomain":[".mh"],"alpha2Code":"MH","alpha3Code":"MHL","callingCodes":["692"],"capital":"Majuro","altSpellings":["MH","Republic of the Marshall Islands","Aolepān Aorōkin M̧ajeļ"],"region":"Oceania","subregion":"Micronesia","population":54880,"latlng":[9.0,168.0],"demonym":"Marshallese","area":181.0,"gini":null,"timezones":["UTC+12:00"],"borders":[],"nativeName":"M̧ajeļ","numericCode":"584","currencies":[{"code":"USD","name":"United States dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"mh","iso639_2":"mah","name":"Marshallese","nativeName":"Kajin M̧ajeļ"}],"translations":{"de":"Marshallinseln","es":"Islas Marshall","fr":"Îles Marshall","ja":"マーシャル諸島","it":"Isole Marshall","br":"Ilhas Marshall","pt":"Ilhas Marshall","nl":"Marshalleilanden","hr":"Maršalovi Otoci","fa":"جزایر مارشال"},"flag":"https://restcountries.eu/data/mhl.svg","regionalBlocs":[],"cioc":"MHL"} +{"name":"Martinique","topLevelDomain":[".mq"],"alpha2Code":"MQ","alpha3Code":"MTQ","callingCodes":["596"],"capital":"Fort-de-France","altSpellings":["MQ"],"region":"Americas","subregion":"Caribbean","population":378243,"latlng":[14.666667,-61.0],"demonym":"French","area":null,"gini":null,"timezones":["UTC-04:00"],"borders":[],"nativeName":"Martinique","numericCode":"474","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Martinique","es":"Martinica","fr":"Martinique","ja":"マルティニーク","it":"Martinica","br":"Martinica","pt":"Martinica","nl":"Martinique","hr":"Martinique","fa":"مونتسرات"},"flag":"https://restcountries.eu/data/mtq.svg","regionalBlocs":[],"cioc":""} +{"name":"Mauritania","topLevelDomain":[".mr"],"alpha2Code":"MR","alpha3Code":"MRT","callingCodes":["222"],"capital":"Nouakchott","altSpellings":["MR","Islamic Republic of Mauritania","al-Jumhūriyyah al-ʾIslāmiyyah al-Mūrītāniyyah"],"region":"Africa","subregion":"Western Africa","population":3718678,"latlng":[20.0,-12.0],"demonym":"Mauritanian","area":1030700.0,"gini":40.5,"timezones":["UTC"],"borders":["DZA","MLI","SEN","ESH"],"nativeName":"موريتانيا","numericCode":"478","currencies":[{"code":"MRO","name":"Mauritanian ouguiya","symbol":"UM"}],"languages":[{"iso639_1":"ar","iso639_2":"ara","name":"Arabic","nativeName":"العربية"}],"translations":{"de":"Mauretanien","es":"Mauritania","fr":"Mauritanie","ja":"モーリタニア","it":"Mauritania","br":"Mauritânia","pt":"Mauritânia","nl":"Mauritanië","hr":"Mauritanija","fa":"موریتانی"},"flag":"https://restcountries.eu/data/mrt.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]},{"acronym":"AL","name":"Arab League","otherAcronyms":[],"otherNames":["جامعة الدول العربية","Jāmiʻat ad-Duwal al-ʻArabīyah","League of Arab States"]}],"cioc":"MTN"} +{"name":"Mauritius","topLevelDomain":[".mu"],"alpha2Code":"MU","alpha3Code":"MUS","callingCodes":["230"],"capital":"Port Louis","altSpellings":["MU","Republic of Mauritius","République de Maurice"],"region":"Africa","subregion":"Eastern Africa","population":1262879,"latlng":[-20.28333333,57.55],"demonym":"Mauritian","area":2040.0,"gini":null,"timezones":["UTC+04:00"],"borders":[],"nativeName":"Maurice","numericCode":"480","currencies":[{"code":"MUR","name":"Mauritian rupee","symbol":"₨"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Mauritius","es":"Mauricio","fr":"Île Maurice","ja":"モーリシャス","it":"Mauritius","br":"Maurício","pt":"Maurícia","nl":"Mauritius","hr":"Mauricijus","fa":"موریس"},"flag":"https://restcountries.eu/data/mus.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"MRI"} +{"name":"Mayotte","topLevelDomain":[".yt"],"alpha2Code":"YT","alpha3Code":"MYT","callingCodes":["262"],"capital":"Mamoudzou","altSpellings":["YT","Department of Mayotte","Département de Mayotte"],"region":"Africa","subregion":"Eastern Africa","population":226915,"latlng":[-12.83333333,45.16666666],"demonym":"French","area":null,"gini":null,"timezones":["UTC+03:00"],"borders":[],"nativeName":"Mayotte","numericCode":"175","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Mayotte","es":"Mayotte","fr":"Mayotte","ja":"マヨット","it":"Mayotte","br":"Mayotte","pt":"Mayotte","nl":"Mayotte","hr":"Mayotte","fa":"مایوت"},"flag":"https://restcountries.eu/data/myt.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":""} +{"name":"Mexico","topLevelDomain":[".mx"],"alpha2Code":"MX","alpha3Code":"MEX","callingCodes":["52"],"capital":"Mexico City","altSpellings":["MX","Mexicanos","United Mexican States","Estados Unidos Mexicanos"],"region":"Americas","subregion":"Central America","population":122273473,"latlng":[23.0,-102.0],"demonym":"Mexican","area":1964375.0,"gini":47.0,"timezones":["UTC-08:00","UTC-07:00","UTC-06:00"],"borders":["BLZ","GTM","USA"],"nativeName":"México","numericCode":"484","currencies":[{"code":"MXN","name":"Mexican peso","symbol":"$"}],"languages":[{"iso639_1":"es","iso639_2":"spa","name":"Spanish","nativeName":"Español"}],"translations":{"de":"Mexiko","es":"México","fr":"Mexique","ja":"メキシコ","it":"Messico","br":"México","pt":"México","nl":"Mexico","hr":"Meksiko","fa":"مکزیک"},"flag":"https://restcountries.eu/data/mex.svg","regionalBlocs":[{"acronym":"PA","name":"Pacific Alliance","otherAcronyms":[],"otherNames":["Alianza del Pacífico"]},{"acronym":"NAFTA","name":"North American Free Trade Agreement","otherAcronyms":[],"otherNames":["Tratado de Libre Comercio de América del Norte","Accord de Libre-échange Nord-Américain"]}],"cioc":"MEX"} +{"name":"Micronesia (Federated States of)","topLevelDomain":[".fm"],"alpha2Code":"FM","alpha3Code":"FSM","callingCodes":["691"],"capital":"Palikir","altSpellings":["FM","Federated States of Micronesia"],"region":"Oceania","subregion":"Micronesia","population":102800,"latlng":[6.91666666,158.25],"demonym":"Micronesian","area":702.0,"gini":null,"timezones":["UTC+10:00","UTC+11"],"borders":[],"nativeName":"Micronesia","numericCode":"583","currencies":[{"code":null,"name":"[D]","symbol":"$"},{"code":"USD","name":"United States dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Mikronesien","es":"Micronesia","fr":"Micronésie","ja":"ミクロネシア連邦","it":"Micronesia","br":"Micronésia","pt":"Micronésia","nl":"Micronesië","hr":"Mikronezija","fa":"ایالات فدرال میکرونزی"},"flag":"https://restcountries.eu/data/fsm.svg","regionalBlocs":[],"cioc":"FSM"} +{"name":"Moldova (Republic of)","topLevelDomain":[".md"],"alpha2Code":"MD","alpha3Code":"MDA","callingCodes":["373"],"capital":"Chișinău","altSpellings":["MD","Republic of Moldova","Republica Moldova"],"region":"Europe","subregion":"Eastern Europe","population":3553100,"latlng":[47.0,29.0],"demonym":"Moldovan","area":33846.0,"gini":33.0,"timezones":["UTC+02:00"],"borders":["ROU","UKR"],"nativeName":"Moldova","numericCode":"498","currencies":[{"code":"MDL","name":"Moldovan leu","symbol":"L"}],"languages":[{"iso639_1":"ro","iso639_2":"ron","name":"Romanian","nativeName":"Română"}],"translations":{"de":"Moldawie","es":"Moldavia","fr":"Moldavie","ja":"モルドバ共和国","it":"Moldavia","br":"Moldávia","pt":"Moldávia","nl":"Moldavië","hr":"Moldova","fa":"مولداوی"},"flag":"https://restcountries.eu/data/mda.svg","regionalBlocs":[{"acronym":"CEFTA","name":"Central European Free Trade Agreement","otherAcronyms":[],"otherNames":[]}],"cioc":"MDA"} +{"name":"Monaco","topLevelDomain":[".mc"],"alpha2Code":"MC","alpha3Code":"MCO","callingCodes":["377"],"capital":"Monaco","altSpellings":["MC","Principality of Monaco","Principauté de Monaco"],"region":"Europe","subregion":"Western Europe","population":38400,"latlng":[43.73333333,7.4],"demonym":"Monegasque","area":2.02,"gini":null,"timezones":["UTC+01:00"],"borders":["FRA"],"nativeName":"Monaco","numericCode":"492","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Monaco","es":"Mónaco","fr":"Monaco","ja":"モナコ","it":"Principato di Monaco","br":"Mônaco","pt":"Mónaco","nl":"Monaco","hr":"Monako","fa":"موناکو"},"flag":"https://restcountries.eu/data/mco.svg","regionalBlocs":[],"cioc":"MON"} +{"name":"Mongolia","topLevelDomain":[".mn"],"alpha2Code":"MN","alpha3Code":"MNG","callingCodes":["976"],"capital":"Ulan Bator","altSpellings":["MN"],"region":"Asia","subregion":"Eastern Asia","population":3093100,"latlng":[46.0,105.0],"demonym":"Mongolian","area":1564110.0,"gini":36.5,"timezones":["UTC+07:00","UTC+08:00"],"borders":["CHN","RUS"],"nativeName":"Монгол улс","numericCode":"496","currencies":[{"code":"MNT","name":"Mongolian tögrög","symbol":"₮"}],"languages":[{"iso639_1":"mn","iso639_2":"mon","name":"Mongolian","nativeName":"Монгол хэл"}],"translations":{"de":"Mongolei","es":"Mongolia","fr":"Mongolie","ja":"モンゴル","it":"Mongolia","br":"Mongólia","pt":"Mongólia","nl":"Mongolië","hr":"Mongolija","fa":"مغولستان"},"flag":"https://restcountries.eu/data/mng.svg","regionalBlocs":[],"cioc":"MGL"} +{"name":"Montenegro","topLevelDomain":[".me"],"alpha2Code":"ME","alpha3Code":"MNE","callingCodes":["382"],"capital":"Podgorica","altSpellings":["ME","Crna Gora"],"region":"Europe","subregion":"Southern Europe","population":621810,"latlng":[42.5,19.3],"demonym":"Montenegrin","area":13812.0,"gini":30.0,"timezones":["UTC+01:00"],"borders":["ALB","BIH","HRV","KOS","SRB"],"nativeName":"Црна Гора","numericCode":"499","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"sr","iso639_2":"srp","name":"Serbian","nativeName":"српски језик"},{"iso639_1":"bs","iso639_2":"bos","name":"Bosnian","nativeName":"bosanski jezik"},{"iso639_1":"sq","iso639_2":"sqi","name":"Albanian","nativeName":"Shqip"},{"iso639_1":"hr","iso639_2":"hrv","name":"Croatian","nativeName":"hrvatski jezik"}],"translations":{"de":"Montenegro","es":"Montenegro","fr":"Monténégro","ja":"モンテネグロ","it":"Montenegro","br":"Montenegro","pt":"Montenegro","nl":"Montenegro","hr":"Crna Gora","fa":"مونته‌نگرو"},"flag":"https://restcountries.eu/data/mne.svg","regionalBlocs":[{"acronym":"CEFTA","name":"Central European Free Trade Agreement","otherAcronyms":[],"otherNames":[]}],"cioc":"MNE"} +{"name":"Montserrat","topLevelDomain":[".ms"],"alpha2Code":"MS","alpha3Code":"MSR","callingCodes":["1664"],"capital":"Plymouth","altSpellings":["MS"],"region":"Americas","subregion":"Caribbean","population":4922,"latlng":[16.75,-62.2],"demonym":"Montserratian","area":102.0,"gini":null,"timezones":["UTC-04:00"],"borders":[],"nativeName":"Montserrat","numericCode":"500","currencies":[{"code":"XCD","name":"East Caribbean dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Montserrat","es":"Montserrat","fr":"Montserrat","ja":"モントセラト","it":"Montserrat","br":"Montserrat","pt":"Monserrate","nl":"Montserrat","hr":"Montserrat","fa":"مایوت"},"flag":"https://restcountries.eu/data/msr.svg","regionalBlocs":[{"acronym":"CARICOM","name":"Caribbean Community","otherAcronyms":[],"otherNames":["Comunidad del Caribe","Communauté Caribéenne","Caribische Gemeenschap"]}],"cioc":""} +{"name":"Morocco","topLevelDomain":[".ma"],"alpha2Code":"MA","alpha3Code":"MAR","callingCodes":["212"],"capital":"Rabat","altSpellings":["MA","Kingdom of Morocco","Al-Mamlakah al-Maġribiyah"],"region":"Africa","subregion":"Northern Africa","population":33337529,"latlng":[32.0,-5.0],"demonym":"Moroccan","area":446550.0,"gini":40.9,"timezones":["UTC"],"borders":["DZA","ESH","ESP"],"nativeName":"المغرب","numericCode":"504","currencies":[{"code":"MAD","name":"Moroccan dirham","symbol":"د.م."}],"languages":[{"iso639_1":"ar","iso639_2":"ara","name":"Arabic","nativeName":"العربية"}],"translations":{"de":"Marokko","es":"Marruecos","fr":"Maroc","ja":"モロッコ","it":"Marocco","br":"Marrocos","pt":"Marrocos","nl":"Marokko","hr":"Maroko","fa":"مراکش"},"flag":"https://restcountries.eu/data/mar.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]},{"acronym":"AL","name":"Arab League","otherAcronyms":[],"otherNames":["جامعة الدول العربية","Jāmiʻat ad-Duwal al-ʻArabīyah","League of Arab States"]}],"cioc":"MAR"} +{"name":"Mozambique","topLevelDomain":[".mz"],"alpha2Code":"MZ","alpha3Code":"MOZ","callingCodes":["258"],"capital":"Maputo","altSpellings":["MZ","Republic of Mozambique","República de Moçambique"],"region":"Africa","subregion":"Eastern Africa","population":26423700,"latlng":[-18.25,35.0],"demonym":"Mozambican","area":801590.0,"gini":45.7,"timezones":["UTC+02:00"],"borders":["MWI","ZAF","SWZ","TZA","ZMB","ZWE"],"nativeName":"Moçambique","numericCode":"508","currencies":[{"code":"MZN","name":"Mozambican metical","symbol":"MT"}],"languages":[{"iso639_1":"pt","iso639_2":"por","name":"Portuguese","nativeName":"Português"}],"translations":{"de":"Mosambik","es":"Mozambique","fr":"Mozambique","ja":"モザンビーク","it":"Mozambico","br":"Moçambique","pt":"Moçambique","nl":"Mozambique","hr":"Mozambik","fa":"موزامبیک"},"flag":"https://restcountries.eu/data/moz.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"MOZ"} +{"name":"Myanmar","topLevelDomain":[".mm"],"alpha2Code":"MM","alpha3Code":"MMR","callingCodes":["95"],"capital":"Naypyidaw","altSpellings":["MM","Burma","Republic of the Union of Myanmar","Pyidaunzu Thanmăda Myăma Nainngandaw"],"region":"Asia","subregion":"South-Eastern Asia","population":51419420,"latlng":[22.0,98.0],"demonym":"Burmese","area":676578.0,"gini":null,"timezones":["UTC+06:30"],"borders":["BGD","CHN","IND","LAO","THA"],"nativeName":"Myanma","numericCode":"104","currencies":[{"code":"MMK","name":"Burmese kyat","symbol":"Ks"}],"languages":[{"iso639_1":"my","iso639_2":"mya","name":"Burmese","nativeName":"ဗမာစာ"}],"translations":{"de":"Myanmar","es":"Myanmar","fr":"Myanmar","ja":"ミャンマー","it":"Birmania","br":"Myanmar","pt":"Myanmar","nl":"Myanmar","hr":"Mijanmar","fa":"میانمار"},"flag":"https://restcountries.eu/data/mmr.svg","regionalBlocs":[{"acronym":"ASEAN","name":"Association of Southeast Asian Nations","otherAcronyms":[],"otherNames":[]}],"cioc":"MYA"} +{"name":"Namibia","topLevelDomain":[".na"],"alpha2Code":"NA","alpha3Code":"NAM","callingCodes":["264"],"capital":"Windhoek","altSpellings":["NA","Namibië","Republic of Namibia"],"region":"Africa","subregion":"Southern Africa","population":2324388,"latlng":[-22.0,17.0],"demonym":"Namibian","area":825615.0,"gini":63.9,"timezones":["UTC+01:00"],"borders":["AGO","BWA","ZAF","ZMB"],"nativeName":"Namibia","numericCode":"516","currencies":[{"code":"NAD","name":"Namibian dollar","symbol":"$"},{"code":"ZAR","name":"South African rand","symbol":"R"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"af","iso639_2":"afr","name":"Afrikaans","nativeName":"Afrikaans"}],"translations":{"de":"Namibia","es":"Namibia","fr":"Namibie","ja":"ナミビア","it":"Namibia","br":"Namíbia","pt":"Namíbia","nl":"Namibië","hr":"Namibija","fa":"نامیبیا"},"flag":"https://restcountries.eu/data/nam.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"NAM"} +{"name":"Nauru","topLevelDomain":[".nr"],"alpha2Code":"NR","alpha3Code":"NRU","callingCodes":["674"],"capital":"Yaren","altSpellings":["NR","Naoero","Pleasant Island","Republic of Nauru","Ripublik Naoero"],"region":"Oceania","subregion":"Micronesia","population":10084,"latlng":[-0.53333333,166.91666666],"demonym":"Nauruan","area":21.0,"gini":null,"timezones":["UTC+12:00"],"borders":[],"nativeName":"Nauru","numericCode":"520","currencies":[{"code":"AUD","name":"Australian dollar","symbol":"$"},{"code":"(none)","name":null,"symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"na","iso639_2":"nau","name":"Nauruan","nativeName":"Dorerin Naoero"}],"translations":{"de":"Nauru","es":"Nauru","fr":"Nauru","ja":"ナウル","it":"Nauru","br":"Nauru","pt":"Nauru","nl":"Nauru","hr":"Nauru","fa":"نائورو"},"flag":"https://restcountries.eu/data/nru.svg","regionalBlocs":[],"cioc":"NRU"} +{"name":"Nepal","topLevelDomain":[".np"],"alpha2Code":"NP","alpha3Code":"NPL","callingCodes":["977"],"capital":"Kathmandu","altSpellings":["NP","Federal Democratic Republic of Nepal","Loktāntrik Ganatantra Nepāl"],"region":"Asia","subregion":"Southern Asia","population":28431500,"latlng":[28.0,84.0],"demonym":"Nepalese","area":147181.0,"gini":32.8,"timezones":["UTC+05:45"],"borders":["CHN","IND"],"nativeName":"नेपाल","numericCode":"524","currencies":[{"code":"NPR","name":"Nepalese rupee","symbol":"₨"}],"languages":[{"iso639_1":"ne","iso639_2":"nep","name":"Nepali","nativeName":"नेपाली"}],"translations":{"de":"Népal","es":"Nepal","fr":"Népal","ja":"ネパール","it":"Nepal","br":"Nepal","pt":"Nepal","nl":"Nepal","hr":"Nepal","fa":"نپال"},"flag":"https://restcountries.eu/data/npl.svg","regionalBlocs":[{"acronym":"SAARC","name":"South Asian Association for Regional Cooperation","otherAcronyms":[],"otherNames":[]}],"cioc":"NEP"} +{"name":"Netherlands","topLevelDomain":[".nl"],"alpha2Code":"NL","alpha3Code":"NLD","callingCodes":["31"],"capital":"Amsterdam","altSpellings":["NL","Holland","Nederland"],"region":"Europe","subregion":"Western Europe","population":17019800,"latlng":[52.5,5.75],"demonym":"Dutch","area":41850.0,"gini":30.9,"timezones":["UTC-04:00","UTC+01:00"],"borders":["BEL","DEU"],"nativeName":"Nederland","numericCode":"528","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"nl","iso639_2":"nld","name":"Dutch","nativeName":"Nederlands"}],"translations":{"de":"Niederlande","es":"Países Bajos","fr":"Pays-Bas","ja":"オランダ","it":"Paesi Bassi","br":"Holanda","pt":"Países Baixos","nl":"Nederland","hr":"Nizozemska","fa":"پادشاهی هلند"},"flag":"https://restcountries.eu/data/nld.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"NED"} +{"name":"New Caledonia","topLevelDomain":[".nc"],"alpha2Code":"NC","alpha3Code":"NCL","callingCodes":["687"],"capital":"Nouméa","altSpellings":["NC"],"region":"Oceania","subregion":"Melanesia","population":268767,"latlng":[-21.5,165.5],"demonym":"New Caledonian","area":18575.0,"gini":null,"timezones":["UTC+11:00"],"borders":[],"nativeName":"Nouvelle-Calédonie","numericCode":"540","currencies":[{"code":"XPF","name":"CFP franc","symbol":"Fr"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Neukaledonien","es":"Nueva Caledonia","fr":"Nouvelle-Calédonie","ja":"ニューカレドニア","it":"Nuova Caledonia","br":"Nova Caledônia","pt":"Nova Caledónia","nl":"Nieuw-Caledonië","hr":"Nova Kaledonija","fa":"کالدونیای جدید"},"flag":"https://restcountries.eu/data/ncl.svg","regionalBlocs":[],"cioc":""} +{"name":"New Zealand","topLevelDomain":[".nz"],"alpha2Code":"NZ","alpha3Code":"NZL","callingCodes":["64"],"capital":"Wellington","altSpellings":["NZ","Aotearoa"],"region":"Oceania","subregion":"Australia and New Zealand","population":4697854,"latlng":[-41.0,174.0],"demonym":"New Zealander","area":270467.0,"gini":36.2,"timezones":["UTC-11:00","UTC-10:00","UTC+12:00","UTC+12:45","UTC+13:00"],"borders":[],"nativeName":"New Zealand","numericCode":"554","currencies":[{"code":"NZD","name":"New Zealand dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"mi","iso639_2":"mri","name":"Māori","nativeName":"te reo Māori"}],"translations":{"de":"Neuseeland","es":"Nueva Zelanda","fr":"Nouvelle-Zélande","ja":"ニュージーランド","it":"Nuova Zelanda","br":"Nova Zelândia","pt":"Nova Zelândia","nl":"Nieuw-Zeeland","hr":"Novi Zeland","fa":"نیوزیلند"},"flag":"https://restcountries.eu/data/nzl.svg","regionalBlocs":[],"cioc":"NZL"} +{"name":"Nicaragua","topLevelDomain":[".ni"],"alpha2Code":"NI","alpha3Code":"NIC","callingCodes":["505"],"capital":"Managua","altSpellings":["NI","Republic of Nicaragua","República de Nicaragua"],"region":"Americas","subregion":"Central America","population":6262703,"latlng":[13.0,-85.0],"demonym":"Nicaraguan","area":130373.0,"gini":40.5,"timezones":["UTC-06:00"],"borders":["CRI","HND"],"nativeName":"Nicaragua","numericCode":"558","currencies":[{"code":"NIO","name":"Nicaraguan córdoba","symbol":"C$"}],"languages":[{"iso639_1":"es","iso639_2":"spa","name":"Spanish","nativeName":"Español"}],"translations":{"de":"Nicaragua","es":"Nicaragua","fr":"Nicaragua","ja":"ニカラグア","it":"Nicaragua","br":"Nicarágua","pt":"Nicarágua","nl":"Nicaragua","hr":"Nikaragva","fa":"نیکاراگوئه"},"flag":"https://restcountries.eu/data/nic.svg","regionalBlocs":[{"acronym":"CAIS","name":"Central American Integration System","otherAcronyms":["SICA"],"otherNames":["Sistema de la Integración Centroamericana,"]}],"cioc":"NCA"} +{"name":"Niger","topLevelDomain":[".ne"],"alpha2Code":"NE","alpha3Code":"NER","callingCodes":["227"],"capital":"Niamey","altSpellings":["NE","Nijar","Republic of Niger","République du Niger"],"region":"Africa","subregion":"Western Africa","population":20715000,"latlng":[16.0,8.0],"demonym":"Nigerien","area":1267000.0,"gini":34.6,"timezones":["UTC+01:00"],"borders":["DZA","BEN","BFA","TCD","LBY","MLI","NGA"],"nativeName":"Niger","numericCode":"562","currencies":[{"code":"XOF","name":"West African CFA franc","symbol":"Fr"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Niger","es":"Níger","fr":"Niger","ja":"ニジェール","it":"Niger","br":"Níger","pt":"Níger","nl":"Niger","hr":"Niger","fa":"نیجر"},"flag":"https://restcountries.eu/data/ner.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"NIG"} +{"name":"Nigeria","topLevelDomain":[".ng"],"alpha2Code":"NG","alpha3Code":"NGA","callingCodes":["234"],"capital":"Abuja","altSpellings":["NG","Nijeriya","Naíjíríà","Federal Republic of Nigeria"],"region":"Africa","subregion":"Western Africa","population":186988000,"latlng":[10.0,8.0],"demonym":"Nigerian","area":923768.0,"gini":48.8,"timezones":["UTC+01:00"],"borders":["BEN","CMR","TCD","NER"],"nativeName":"Nigeria","numericCode":"566","currencies":[{"code":"NGN","name":"Nigerian naira","symbol":"₦"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Nigeria","es":"Nigeria","fr":"Nigéria","ja":"ナイジェリア","it":"Nigeria","br":"Nigéria","pt":"Nigéria","nl":"Nigeria","hr":"Nigerija","fa":"نیجریه"},"flag":"https://restcountries.eu/data/nga.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"NGR"} +{"name":"Niue","topLevelDomain":[".nu"],"alpha2Code":"NU","alpha3Code":"NIU","callingCodes":["683"],"capital":"Alofi","altSpellings":["NU"],"region":"Oceania","subregion":"Polynesia","population":1470,"latlng":[-19.03333333,-169.86666666],"demonym":"Niuean","area":260.0,"gini":null,"timezones":["UTC-11:00"],"borders":[],"nativeName":"Niuē","numericCode":"570","currencies":[{"code":"NZD","name":"New Zealand dollar","symbol":"$"},{"code":"(none)","name":"Niue dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Niue","es":"Niue","fr":"Niue","ja":"ニウエ","it":"Niue","br":"Niue","pt":"Niue","nl":"Niue","hr":"Niue","fa":"نیووی"},"flag":"https://restcountries.eu/data/niu.svg","regionalBlocs":[],"cioc":""} +{"name":"Norfolk Island","topLevelDomain":[".nf"],"alpha2Code":"NF","alpha3Code":"NFK","callingCodes":["672"],"capital":"Kingston","altSpellings":["NF","Territory of Norfolk Island","Teratri of Norf'k Ailen"],"region":"Oceania","subregion":"Australia and New Zealand","population":2302,"latlng":[-29.03333333,167.95],"demonym":"Norfolk Islander","area":36.0,"gini":null,"timezones":["UTC+11:30"],"borders":[],"nativeName":"Norfolk Island","numericCode":"574","currencies":[{"code":"AUD","name":"Australian dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Norfolkinsel","es":"Isla de Norfolk","fr":"Île de Norfolk","ja":"ノーフォーク島","it":"Isola Norfolk","br":"Ilha Norfolk","pt":"Ilha Norfolk","nl":"Norfolkeiland","hr":"Otok Norfolk","fa":"جزیره نورفک"},"flag":"https://restcountries.eu/data/nfk.svg","regionalBlocs":[],"cioc":""} +{"name":"Korea (Democratic People's Republic of)","topLevelDomain":[".kp"],"alpha2Code":"KP","alpha3Code":"PRK","callingCodes":["850"],"capital":"Pyongyang","altSpellings":["KP","Democratic People's Republic of Korea","조선민주주의인민공화국","Chosŏn Minjujuŭi Inmin Konghwaguk"],"region":"Asia","subregion":"Eastern Asia","population":25281000,"latlng":[40.0,127.0],"demonym":"North Korean","area":120538.0,"gini":null,"timezones":["UTC+09:00"],"borders":["CHN","KOR","RUS"],"nativeName":"북한","numericCode":"408","currencies":[{"code":"KPW","name":"North Korean won","symbol":"₩"}],"languages":[{"iso639_1":"ko","iso639_2":"kor","name":"Korean","nativeName":"한국어"}],"translations":{"de":"Nordkorea","es":"Corea del Norte","fr":"Corée du Nord","ja":"朝鮮民主主義人民共和国","it":"Corea del Nord","br":"Coreia do Norte","pt":"Coreia do Norte","nl":"Noord-Korea","hr":"Sjeverna Koreja","fa":"کره جنوبی"},"flag":"https://restcountries.eu/data/prk.svg","regionalBlocs":[],"cioc":"PRK"} +{"name":"Northern Mariana Islands","topLevelDomain":[".mp"],"alpha2Code":"MP","alpha3Code":"MNP","callingCodes":["1670"],"capital":"Saipan","altSpellings":["MP","Commonwealth of the Northern Mariana Islands","Sankattan Siha Na Islas Mariånas"],"region":"Oceania","subregion":"Micronesia","population":56940,"latlng":[15.2,145.75],"demonym":"American","area":464.0,"gini":null,"timezones":["UTC+10:00"],"borders":[],"nativeName":"Northern Mariana Islands","numericCode":"580","currencies":[{"code":"USD","name":"United States dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"ch","iso639_2":"cha","name":"Chamorro","nativeName":"Chamoru"}],"translations":{"de":"Nördliche Marianen","es":"Islas Marianas del Norte","fr":"Îles Mariannes du Nord","ja":"北マリアナ諸島","it":"Isole Marianne Settentrionali","br":"Ilhas Marianas","pt":"Ilhas Marianas","nl":"Noordelijke Marianeneilanden","hr":"Sjevernomarijanski otoci","fa":"جزایر ماریانای شمالی"},"flag":"https://restcountries.eu/data/mnp.svg","regionalBlocs":[],"cioc":""} +{"name":"Norway","topLevelDomain":[".no"],"alpha2Code":"NO","alpha3Code":"NOR","callingCodes":["47"],"capital":"Oslo","altSpellings":["NO","Norge","Noreg","Kingdom of Norway","Kongeriket Norge","Kongeriket Noreg"],"region":"Europe","subregion":"Northern Europe","population":5223256,"latlng":[62.0,10.0],"demonym":"Norwegian","area":323802.0,"gini":25.8,"timezones":["UTC+01:00"],"borders":["FIN","SWE","RUS"],"nativeName":"Norge","numericCode":"578","currencies":[{"code":"NOK","name":"Norwegian krone","symbol":"kr"}],"languages":[{"iso639_1":"no","iso639_2":"nor","name":"Norwegian","nativeName":"Norsk"},{"iso639_1":"nb","iso639_2":"nob","name":"Norwegian Bokmål","nativeName":"Norsk bokmål"},{"iso639_1":"nn","iso639_2":"nno","name":"Norwegian Nynorsk","nativeName":"Norsk nynorsk"}],"translations":{"de":"Norwegen","es":"Noruega","fr":"Norvège","ja":"ノルウェー","it":"Norvegia","br":"Noruega","pt":"Noruega","nl":"Noorwegen","hr":"Norveška","fa":"نروژ"},"flag":"https://restcountries.eu/data/nor.svg","regionalBlocs":[{"acronym":"EFTA","name":"European Free Trade Association","otherAcronyms":[],"otherNames":[]}],"cioc":"NOR"} +{"name":"Oman","topLevelDomain":[".om"],"alpha2Code":"OM","alpha3Code":"OMN","callingCodes":["968"],"capital":"Muscat","altSpellings":["OM","Sultanate of Oman","Salṭanat ʻUmān"],"region":"Asia","subregion":"Western Asia","population":4420133,"latlng":[21.0,57.0],"demonym":"Omani","area":309500.0,"gini":null,"timezones":["UTC+04:00"],"borders":["SAU","ARE","YEM"],"nativeName":"عمان","numericCode":"512","currencies":[{"code":"OMR","name":"Omani rial","symbol":"ر.ع."}],"languages":[{"iso639_1":"ar","iso639_2":"ara","name":"Arabic","nativeName":"العربية"}],"translations":{"de":"Oman","es":"Omán","fr":"Oman","ja":"オマーン","it":"oman","br":"Omã","pt":"Omã","nl":"Oman","hr":"Oman","fa":"عمان"},"flag":"https://restcountries.eu/data/omn.svg","regionalBlocs":[{"acronym":"AL","name":"Arab League","otherAcronyms":[],"otherNames":["جامعة الدول العربية","Jāmiʻat ad-Duwal al-ʻArabīyah","League of Arab States"]}],"cioc":"OMA"} +{"name":"Pakistan","topLevelDomain":[".pk"],"alpha2Code":"PK","alpha3Code":"PAK","callingCodes":["92"],"capital":"Islamabad","altSpellings":["PK","Pākistān","Islamic Republic of Pakistan","Islāmī Jumhūriya'eh Pākistān"],"region":"Asia","subregion":"Southern Asia","population":194125062,"latlng":[30.0,70.0],"demonym":"Pakistani","area":881912.0,"gini":30.0,"timezones":["UTC+05:00"],"borders":["AFG","CHN","IND","IRN"],"nativeName":"Pakistan","numericCode":"586","currencies":[{"code":"PKR","name":"Pakistani rupee","symbol":"₨"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"ur","iso639_2":"urd","name":"Urdu","nativeName":"اردو"}],"translations":{"de":"Pakistan","es":"Pakistán","fr":"Pakistan","ja":"パキスタン","it":"Pakistan","br":"Paquistão","pt":"Paquistão","nl":"Pakistan","hr":"Pakistan","fa":"پاکستان"},"flag":"https://restcountries.eu/data/pak.svg","regionalBlocs":[{"acronym":"SAARC","name":"South Asian Association for Regional Cooperation","otherAcronyms":[],"otherNames":[]}],"cioc":"PAK"} +{"name":"Palau","topLevelDomain":[".pw"],"alpha2Code":"PW","alpha3Code":"PLW","callingCodes":["680"],"capital":"Ngerulmud","altSpellings":["PW","Republic of Palau","Beluu er a Belau"],"region":"Oceania","subregion":"Micronesia","population":17950,"latlng":[7.5,134.5],"demonym":"Palauan","area":459.0,"gini":null,"timezones":["UTC+09:00"],"borders":[],"nativeName":"Palau","numericCode":"585","currencies":[{"code":"(none)","name":"[E]","symbol":"$"},{"code":"USD","name":"United States dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Palau","es":"Palau","fr":"Palaos","ja":"パラオ","it":"Palau","br":"Palau","pt":"Palau","nl":"Palau","hr":"Palau","fa":"پالائو"},"flag":"https://restcountries.eu/data/plw.svg","regionalBlocs":[],"cioc":"PLW"} +{"name":"Palestine, State of","topLevelDomain":[".ps"],"alpha2Code":"PS","alpha3Code":"PSE","callingCodes":["970"],"capital":"Ramallah","altSpellings":["PS","State of Palestine","Dawlat Filasṭin"],"region":"Asia","subregion":"Western Asia","population":4682467,"latlng":[31.9,35.2],"demonym":"Palestinian","area":null,"gini":35.5,"timezones":["UTC+02:00"],"borders":["ISR","EGY","JOR"],"nativeName":"فلسطين","numericCode":"275","currencies":[{"code":"ILS","name":"Israeli new sheqel","symbol":"₪"}],"languages":[{"iso639_1":"ar","iso639_2":"ara","name":"Arabic","nativeName":"العربية"}],"translations":{"de":"Palästina","es":"Palestina","fr":"Palestine","ja":"パレスチナ","it":"Palestina","br":"Palestina","pt":"Palestina","nl":"Palestijnse gebieden","hr":"Palestina","fa":"فلسطین"},"flag":"https://restcountries.eu/data/pse.svg","regionalBlocs":[{"acronym":"AL","name":"Arab League","otherAcronyms":[],"otherNames":["جامعة الدول العربية","Jāmiʻat ad-Duwal al-ʻArabīyah","League of Arab States"]}],"cioc":"PLE"} +{"name":"Panama","topLevelDomain":[".pa"],"alpha2Code":"PA","alpha3Code":"PAN","callingCodes":["507"],"capital":"Panama City","altSpellings":["PA","Republic of Panama","República de Panamá"],"region":"Americas","subregion":"Central America","population":3814672,"latlng":[9.0,-80.0],"demonym":"Panamanian","area":75417.0,"gini":51.9,"timezones":["UTC-05:00"],"borders":["COL","CRI"],"nativeName":"Panamá","numericCode":"591","currencies":[{"code":"PAB","name":"Panamanian balboa","symbol":"B/."},{"code":"USD","name":"United States dollar","symbol":"$"}],"languages":[{"iso639_1":"es","iso639_2":"spa","name":"Spanish","nativeName":"Español"}],"translations":{"de":"Panama","es":"Panamá","fr":"Panama","ja":"パナマ","it":"Panama","br":"Panamá","pt":"Panamá","nl":"Panama","hr":"Panama","fa":"پاناما"},"flag":"https://restcountries.eu/data/pan.svg","regionalBlocs":[{"acronym":"CAIS","name":"Central American Integration System","otherAcronyms":["SICA"],"otherNames":["Sistema de la Integración Centroamericana,"]}],"cioc":"PAN"} +{"name":"Papua New Guinea","topLevelDomain":[".pg"],"alpha2Code":"PG","alpha3Code":"PNG","callingCodes":["675"],"capital":"Port Moresby","altSpellings":["PG","Independent State of Papua New Guinea","Independen Stet bilong Papua Niugini"],"region":"Oceania","subregion":"Melanesia","population":8083700,"latlng":[-6.0,147.0],"demonym":"Papua New Guinean","area":462840.0,"gini":50.9,"timezones":["UTC+10:00"],"borders":["IDN"],"nativeName":"Papua Niugini","numericCode":"598","currencies":[{"code":"PGK","name":"Papua New Guinean kina","symbol":"K"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Papua-Neuguinea","es":"Papúa Nueva Guinea","fr":"Papouasie-Nouvelle-Guinée","ja":"パプアニューギニア","it":"Papua Nuova Guinea","br":"Papua Nova Guiné","pt":"Papua Nova Guiné","nl":"Papoea-Nieuw-Guinea","hr":"Papua Nova Gvineja","fa":"پاپوآ گینه نو"},"flag":"https://restcountries.eu/data/png.svg","regionalBlocs":[],"cioc":"PNG"} +{"name":"Paraguay","topLevelDomain":[".py"],"alpha2Code":"PY","alpha3Code":"PRY","callingCodes":["595"],"capital":"Asunción","altSpellings":["PY","Republic of Paraguay","República del Paraguay","Tetã Paraguái"],"region":"Americas","subregion":"South America","population":6854536,"latlng":[-23.0,-58.0],"demonym":"Paraguayan","area":406752.0,"gini":52.4,"timezones":["UTC-04:00"],"borders":["ARG","BOL","BRA"],"nativeName":"Paraguay","numericCode":"600","currencies":[{"code":"PYG","name":"Paraguayan guaraní","symbol":"₲"}],"languages":[{"iso639_1":"es","iso639_2":"spa","name":"Spanish","nativeName":"Español"},{"iso639_1":"gn","iso639_2":"grn","name":"Guaraní","nativeName":"Avañe'ẽ"}],"translations":{"de":"Paraguay","es":"Paraguay","fr":"Paraguay","ja":"パラグアイ","it":"Paraguay","br":"Paraguai","pt":"Paraguai","nl":"Paraguay","hr":"Paragvaj","fa":"پاراگوئه"},"flag":"https://restcountries.eu/data/pry.svg","regionalBlocs":[{"acronym":"USAN","name":"Union of South American Nations","otherAcronyms":["UNASUR","UNASUL","UZAN"],"otherNames":["Unión de Naciones Suramericanas","União de Nações Sul-Americanas","Unie van Zuid-Amerikaanse Naties","South American Union"]}],"cioc":"PAR"} +{"name":"Peru","topLevelDomain":[".pe"],"alpha2Code":"PE","alpha3Code":"PER","callingCodes":["51"],"capital":"Lima","altSpellings":["PE","Republic of Peru"," República del Perú"],"region":"Americas","subregion":"South America","population":31488700,"latlng":[-10.0,-76.0],"demonym":"Peruvian","area":1285216.0,"gini":48.1,"timezones":["UTC-05:00"],"borders":["BOL","BRA","CHL","COL","ECU"],"nativeName":"Perú","numericCode":"604","currencies":[{"code":"PEN","name":"Peruvian sol","symbol":"S/."}],"languages":[{"iso639_1":"es","iso639_2":"spa","name":"Spanish","nativeName":"Español"}],"translations":{"de":"Peru","es":"Perú","fr":"Pérou","ja":"ペルー","it":"Perù","br":"Peru","pt":"Peru","nl":"Peru","hr":"Peru","fa":"پرو"},"flag":"https://restcountries.eu/data/per.svg","regionalBlocs":[{"acronym":"PA","name":"Pacific Alliance","otherAcronyms":[],"otherNames":["Alianza del Pacífico"]},{"acronym":"USAN","name":"Union of South American Nations","otherAcronyms":["UNASUR","UNASUL","UZAN"],"otherNames":["Unión de Naciones Suramericanas","União de Nações Sul-Americanas","Unie van Zuid-Amerikaanse Naties","South American Union"]}],"cioc":"PER"} +{"name":"Philippines","topLevelDomain":[".ph"],"alpha2Code":"PH","alpha3Code":"PHL","callingCodes":["63"],"capital":"Manila","altSpellings":["PH","Republic of the Philippines","Repúblika ng Pilipinas"],"region":"Asia","subregion":"South-Eastern Asia","population":103279800,"latlng":[13.0,122.0],"demonym":"Filipino","area":342353.0,"gini":43.0,"timezones":["UTC+08:00"],"borders":[],"nativeName":"Pilipinas","numericCode":"608","currencies":[{"code":"PHP","name":"Philippine peso","symbol":"₱"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Philippinen","es":"Filipinas","fr":"Philippines","ja":"フィリピン","it":"Filippine","br":"Filipinas","pt":"Filipinas","nl":"Filipijnen","hr":"Filipini","fa":"جزایر الندفیلیپین"},"flag":"https://restcountries.eu/data/phl.svg","regionalBlocs":[{"acronym":"ASEAN","name":"Association of Southeast Asian Nations","otherAcronyms":[],"otherNames":[]}],"cioc":"PHI"} +{"name":"Pitcairn","topLevelDomain":[".pn"],"alpha2Code":"PN","alpha3Code":"PCN","callingCodes":["64"],"capital":"Adamstown","altSpellings":["PN","Pitcairn Henderson Ducie and Oeno Islands"],"region":"Oceania","subregion":"Polynesia","population":56,"latlng":[-25.06666666,-130.1],"demonym":"Pitcairn Islander","area":47.0,"gini":null,"timezones":["UTC-08:00"],"borders":[],"nativeName":"Pitcairn Islands","numericCode":"612","currencies":[{"code":"NZD","name":"New Zealand dollar","symbol":"$"},{"code":null,"name":"Pitcairn Islands dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Pitcairn","es":"Islas Pitcairn","fr":"Îles Pitcairn","ja":"ピトケアン","it":"Isole Pitcairn","br":"Ilhas Pitcairn","pt":"Ilhas Picárnia","nl":"Pitcairneilanden","hr":"Pitcairnovo otočje","fa":"پیتکرن"},"flag":"https://restcountries.eu/data/pcn.svg","regionalBlocs":[],"cioc":""} +{"name":"Poland","topLevelDomain":[".pl"],"alpha2Code":"PL","alpha3Code":"POL","callingCodes":["48"],"capital":"Warsaw","altSpellings":["PL","Republic of Poland","Rzeczpospolita Polska"],"region":"Europe","subregion":"Eastern Europe","population":38437239,"latlng":[52.0,20.0],"demonym":"Polish","area":312679.0,"gini":34.1,"timezones":["UTC+01:00"],"borders":["BLR","CZE","DEU","LTU","RUS","SVK","UKR"],"nativeName":"Polska","numericCode":"616","currencies":[{"code":"PLN","name":"Polish złoty","symbol":"zł"}],"languages":[{"iso639_1":"pl","iso639_2":"pol","name":"Polish","nativeName":"język polski"}],"translations":{"de":"Polen","es":"Polonia","fr":"Pologne","ja":"ポーランド","it":"Polonia","br":"Polônia","pt":"Polónia","nl":"Polen","hr":"Poljska","fa":"لهستان"},"flag":"https://restcountries.eu/data/pol.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"POL"} +{"name":"Portugal","topLevelDomain":[".pt"],"alpha2Code":"PT","alpha3Code":"PRT","callingCodes":["351"],"capital":"Lisbon","altSpellings":["PT","Portuguesa","Portuguese Republic","República Portuguesa"],"region":"Europe","subregion":"Southern Europe","population":10374822,"latlng":[39.5,-8.0],"demonym":"Portuguese","area":92090.0,"gini":38.5,"timezones":["UTC-01:00","UTC"],"borders":["ESP"],"nativeName":"Portugal","numericCode":"620","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"pt","iso639_2":"por","name":"Portuguese","nativeName":"Português"}],"translations":{"de":"Portugal","es":"Portugal","fr":"Portugal","ja":"ポルトガル","it":"Portogallo","br":"Portugal","pt":"Portugal","nl":"Portugal","hr":"Portugal","fa":"پرتغال"},"flag":"https://restcountries.eu/data/prt.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"POR"} +{"name":"Puerto Rico","topLevelDomain":[".pr"],"alpha2Code":"PR","alpha3Code":"PRI","callingCodes":["1787","1939"],"capital":"San Juan","altSpellings":["PR","Commonwealth of Puerto Rico","Estado Libre Asociado de Puerto Rico"],"region":"Americas","subregion":"Caribbean","population":3474182,"latlng":[18.25,-66.5],"demonym":"Puerto Rican","area":8870.0,"gini":null,"timezones":["UTC-04:00"],"borders":[],"nativeName":"Puerto Rico","numericCode":"630","currencies":[{"code":"USD","name":"United States dollar","symbol":"$"}],"languages":[{"iso639_1":"es","iso639_2":"spa","name":"Spanish","nativeName":"Español"},{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Puerto Rico","es":"Puerto Rico","fr":"Porto Rico","ja":"プエルトリコ","it":"Porto Rico","br":"Porto Rico","pt":"Porto Rico","nl":"Puerto Rico","hr":"Portoriko","fa":"پورتو ریکو"},"flag":"https://restcountries.eu/data/pri.svg","regionalBlocs":[],"cioc":"PUR"} +{"name":"Qatar","topLevelDomain":[".qa"],"alpha2Code":"QA","alpha3Code":"QAT","callingCodes":["974"],"capital":"Doha","altSpellings":["QA","State of Qatar","Dawlat Qaṭar"],"region":"Asia","subregion":"Western Asia","population":2587564,"latlng":[25.5,51.25],"demonym":"Qatari","area":11586.0,"gini":41.1,"timezones":["UTC+03:00"],"borders":["SAU"],"nativeName":"قطر","numericCode":"634","currencies":[{"code":"QAR","name":"Qatari riyal","symbol":"ر.ق"}],"languages":[{"iso639_1":"ar","iso639_2":"ara","name":"Arabic","nativeName":"العربية"}],"translations":{"de":"Katar","es":"Catar","fr":"Qatar","ja":"カタール","it":"Qatar","br":"Catar","pt":"Catar","nl":"Qatar","hr":"Katar","fa":"قطر"},"flag":"https://restcountries.eu/data/qat.svg","regionalBlocs":[{"acronym":"AL","name":"Arab League","otherAcronyms":[],"otherNames":["جامعة الدول العربية","Jāmiʻat ad-Duwal al-ʻArabīyah","League of Arab States"]}],"cioc":"QAT"} +{"name":"Republic of Kosovo","topLevelDomain":[""],"alpha2Code":"XK","alpha3Code":"KOS","callingCodes":["383"],"capital":"Pristina","altSpellings":["XK","Република Косово"],"region":"Europe","subregion":"Eastern Europe","population":1733842,"latlng":[42.666667,21.166667],"demonym":"Kosovar","area":10908.0,"gini":null,"timezones":["UTC+01:00"],"borders":["ALB","MKD","MNE","SRB"],"nativeName":"Republika e Kosovës","numericCode":null,"currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"sq","iso639_2":"sqi","name":"Albanian","nativeName":"Shqip"},{"iso639_1":"sr","iso639_2":"srp","name":"Serbian","nativeName":"српски језик"}],"translations":{"de":null,"es":"Kosovo","fr":null,"ja":null,"it":null,"br":"Kosovo","pt":"Kosovo","nl":null,"hr":"Kosovo","fa":"کوزوو"},"flag":"https://restcountries.eu/data/kos.svg","regionalBlocs":[{"acronym":"CEFTA","name":"Central European Free Trade Agreement","otherAcronyms":[],"otherNames":[]}],"cioc":null} +{"name":"Réunion","topLevelDomain":[".re"],"alpha2Code":"RE","alpha3Code":"REU","callingCodes":["262"],"capital":"Saint-Denis","altSpellings":["RE","Reunion"],"region":"Africa","subregion":"Eastern Africa","population":840974,"latlng":[-21.15,55.5],"demonym":"French","area":null,"gini":null,"timezones":["UTC+04:00"],"borders":[],"nativeName":"La Réunion","numericCode":"638","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Réunion","es":"Reunión","fr":"Réunion","ja":"レユニオン","it":"Riunione","br":"Reunião","pt":"Reunião","nl":"Réunion","hr":"Réunion","fa":"رئونیون"},"flag":"https://restcountries.eu/data/reu.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":""} +{"name":"Romania","topLevelDomain":[".ro"],"alpha2Code":"RO","alpha3Code":"ROU","callingCodes":["40"],"capital":"Bucharest","altSpellings":["RO","Rumania","Roumania","România"],"region":"Europe","subregion":"Eastern Europe","population":19861408,"latlng":[46.0,25.0],"demonym":"Romanian","area":238391.0,"gini":30.0,"timezones":["UTC+02:00"],"borders":["BGR","HUN","MDA","SRB","UKR"],"nativeName":"România","numericCode":"642","currencies":[{"code":"RON","name":"Romanian leu","symbol":"lei"}],"languages":[{"iso639_1":"ro","iso639_2":"ron","name":"Romanian","nativeName":"Română"}],"translations":{"de":"Rumänien","es":"Rumania","fr":"Roumanie","ja":"ルーマニア","it":"Romania","br":"Romênia","pt":"Roménia","nl":"Roemenië","hr":"Rumunjska","fa":"رومانی"},"flag":"https://restcountries.eu/data/rou.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"ROU"} +{"name":"Russian Federation","topLevelDomain":[".ru"],"alpha2Code":"RU","alpha3Code":"RUS","callingCodes":["7"],"capital":"Moscow","altSpellings":["RU","Rossiya","Russian Federation","Российская Федерация","Rossiyskaya Federatsiya"],"region":"Europe","subregion":"Eastern Europe","population":146599183,"latlng":[60.0,100.0],"demonym":"Russian","area":1.7124442E7,"gini":40.1,"timezones":["UTC+03:00","UTC+04:00","UTC+06:00","UTC+07:00","UTC+08:00","UTC+09:00","UTC+10:00","UTC+11:00","UTC+12:00"],"borders":["AZE","BLR","CHN","EST","FIN","GEO","KAZ","PRK","LVA","LTU","MNG","NOR","POL","UKR"],"nativeName":"Россия","numericCode":"643","currencies":[{"code":"RUB","name":"Russian ruble","symbol":"₽"}],"languages":[{"iso639_1":"ru","iso639_2":"rus","name":"Russian","nativeName":"Русский"}],"translations":{"de":"Russland","es":"Rusia","fr":"Russie","ja":"ロシア連邦","it":"Russia","br":"Rússia","pt":"Rússia","nl":"Rusland","hr":"Rusija","fa":"روسیه"},"flag":"https://restcountries.eu/data/rus.svg","regionalBlocs":[{"acronym":"EEU","name":"Eurasian Economic Union","otherAcronyms":["EAEU"],"otherNames":[]}],"cioc":"RUS"} +{"name":"Rwanda","topLevelDomain":[".rw"],"alpha2Code":"RW","alpha3Code":"RWA","callingCodes":["250"],"capital":"Kigali","altSpellings":["RW","Republic of Rwanda","Repubulika y'u Rwanda","République du Rwanda"],"region":"Africa","subregion":"Eastern Africa","population":11553188,"latlng":[-2.0,30.0],"demonym":"Rwandan","area":26338.0,"gini":50.8,"timezones":["UTC+02:00"],"borders":["BDI","COD","TZA","UGA"],"nativeName":"Rwanda","numericCode":"646","currencies":[{"code":"RWF","name":"Rwandan franc","symbol":"Fr"}],"languages":[{"iso639_1":"rw","iso639_2":"kin","name":"Kinyarwanda","nativeName":"Ikinyarwanda"},{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Ruanda","es":"Ruanda","fr":"Rwanda","ja":"ルワンダ","it":"Ruanda","br":"Ruanda","pt":"Ruanda","nl":"Rwanda","hr":"Ruanda","fa":"رواندا"},"flag":"https://restcountries.eu/data/rwa.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"RWA"} +{"name":"Saint Barthélemy","topLevelDomain":[".bl"],"alpha2Code":"BL","alpha3Code":"BLM","callingCodes":["590"],"capital":"Gustavia","altSpellings":["BL","St. Barthelemy","Collectivity of Saint Barthélemy","Collectivité de Saint-Barthélemy"],"region":"Americas","subregion":"Caribbean","population":9417,"latlng":[18.5,-63.41666666],"demonym":"Saint Barthélemy Islander","area":21.0,"gini":null,"timezones":["UTC-04:00"],"borders":[],"nativeName":"Saint-Barthélemy","numericCode":"652","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Saint-Barthélemy","es":"San Bartolomé","fr":"Saint-Barthélemy","ja":"サン・バルテルミー","it":"Antille Francesi","br":"São Bartolomeu","pt":"São Bartolomeu","nl":"Saint Barthélemy","hr":"Saint Barthélemy","fa":"سن-بارتلمی"},"flag":"https://restcountries.eu/data/blm.svg","regionalBlocs":[],"cioc":""} +{"name":"Saint Helena, Ascension and Tristan da Cunha","topLevelDomain":[".sh"],"alpha2Code":"SH","alpha3Code":"SHN","callingCodes":["290"],"capital":"Jamestown","altSpellings":["SH"],"region":"Africa","subregion":"Western Africa","population":4255,"latlng":[-15.95,-5.7],"demonym":"Saint Helenian","area":null,"gini":null,"timezones":["UTC+00:00"],"borders":[],"nativeName":"Saint Helena","numericCode":"654","currencies":[{"code":"SHP","name":"Saint Helena pound","symbol":"£"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Sankt Helena","es":"Santa Helena","fr":"Sainte-Hélène","ja":"セントヘレナ・アセンションおよびトリスタンダクーニャ","it":"Sant'Elena","br":"Santa Helena","pt":"Santa Helena","nl":"Sint-Helena","hr":"Sveta Helena","fa":"سنت هلنا، اسنشن و تریستان دا کونا"},"flag":"https://restcountries.eu/data/shn.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":null} +{"name":"Saint Kitts and Nevis","topLevelDomain":[".kn"],"alpha2Code":"KN","alpha3Code":"KNA","callingCodes":["1869"],"capital":"Basseterre","altSpellings":["KN","Federation of Saint Christopher and Nevis"],"region":"Americas","subregion":"Caribbean","population":46204,"latlng":[17.33333333,-62.75],"demonym":"Kittian and Nevisian","area":261.0,"gini":null,"timezones":["UTC-04:00"],"borders":[],"nativeName":"Saint Kitts and Nevis","numericCode":"659","currencies":[{"code":"XCD","name":"East Caribbean dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"St. Kitts und Nevis","es":"San Cristóbal y Nieves","fr":"Saint-Christophe-et-Niévès","ja":"セントクリストファー・ネイビス","it":"Saint Kitts e Nevis","br":"São Cristóvão e Neves","pt":"São Cristóvão e Neves","nl":"Saint Kitts en Nevis","hr":"Sveti Kristof i Nevis","fa":"سنت کیتس و نویس"},"flag":"https://restcountries.eu/data/kna.svg","regionalBlocs":[{"acronym":"CARICOM","name":"Caribbean Community","otherAcronyms":[],"otherNames":["Comunidad del Caribe","Communauté Caribéenne","Caribische Gemeenschap"]}],"cioc":"SKN"} +{"name":"Saint Lucia","topLevelDomain":[".lc"],"alpha2Code":"LC","alpha3Code":"LCA","callingCodes":["1758"],"capital":"Castries","altSpellings":["LC"],"region":"Americas","subregion":"Caribbean","population":186000,"latlng":[13.88333333,-60.96666666],"demonym":"Saint Lucian","area":616.0,"gini":42.6,"timezones":["UTC-04:00"],"borders":[],"nativeName":"Saint Lucia","numericCode":"662","currencies":[{"code":"XCD","name":"East Caribbean dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Saint Lucia","es":"Santa Lucía","fr":"Saint-Lucie","ja":"セントルシア","it":"Santa Lucia","br":"Santa Lúcia","pt":"Santa Lúcia","nl":"Saint Lucia","hr":"Sveta Lucija","fa":"سنت لوسیا"},"flag":"https://restcountries.eu/data/lca.svg","regionalBlocs":[{"acronym":"CARICOM","name":"Caribbean Community","otherAcronyms":[],"otherNames":["Comunidad del Caribe","Communauté Caribéenne","Caribische Gemeenschap"]}],"cioc":"LCA"} +{"name":"Saint Martin (French part)","topLevelDomain":[".mf",".fr",".gp"],"alpha2Code":"MF","alpha3Code":"MAF","callingCodes":["590"],"capital":"Marigot","altSpellings":["MF","Collectivity of Saint Martin","Collectivité de Saint-Martin"],"region":"Americas","subregion":"Caribbean","population":36979,"latlng":[18.08333333,-63.95],"demonym":"Saint Martin Islander","area":53.0,"gini":null,"timezones":["UTC-04:00"],"borders":["SXM","NLD"],"nativeName":"Saint-Martin","numericCode":"663","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"},{"iso639_1":"nl","iso639_2":"nld","name":"Dutch","nativeName":"Nederlands"}],"translations":{"de":"Saint Martin","es":"Saint Martin","fr":"Saint-Martin","ja":"サン・マルタン(フランス領)","it":"Saint Martin","br":"Saint Martin","pt":"Ilha São Martinho","nl":"Saint-Martin","hr":"Sveti Martin","fa":"سینت مارتن"},"flag":"https://restcountries.eu/data/maf.svg","regionalBlocs":[],"cioc":""} +{"name":"Saint Pierre and Miquelon","topLevelDomain":[".pm"],"alpha2Code":"PM","alpha3Code":"SPM","callingCodes":["508"],"capital":"Saint-Pierre","altSpellings":["PM","Collectivité territoriale de Saint-Pierre-et-Miquelon"],"region":"Americas","subregion":"Northern America","population":6069,"latlng":[46.83333333,-56.33333333],"demonym":"French","area":242.0,"gini":null,"timezones":["UTC-03:00"],"borders":[],"nativeName":"Saint-Pierre-et-Miquelon","numericCode":"666","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Saint-Pierre und Miquelon","es":"San Pedro y Miquelón","fr":"Saint-Pierre-et-Miquelon","ja":"サンピエール島・ミクロン島","it":"Saint-Pierre e Miquelon","br":"Saint-Pierre e Miquelon","pt":"São Pedro e Miquelon","nl":"Saint Pierre en Miquelon","hr":"Sveti Petar i Mikelon","fa":"سن پیر و میکلن"},"flag":"https://restcountries.eu/data/spm.svg","regionalBlocs":[],"cioc":""} +{"name":"Saint Vincent and the Grenadines","topLevelDomain":[".vc"],"alpha2Code":"VC","alpha3Code":"VCT","callingCodes":["1784"],"capital":"Kingstown","altSpellings":["VC"],"region":"Americas","subregion":"Caribbean","population":109991,"latlng":[13.25,-61.2],"demonym":"Saint Vincentian","area":389.0,"gini":null,"timezones":["UTC-04:00"],"borders":[],"nativeName":"Saint Vincent and the Grenadines","numericCode":"670","currencies":[{"code":"XCD","name":"East Caribbean dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Saint Vincent und die Grenadinen","es":"San Vicente y Granadinas","fr":"Saint-Vincent-et-les-Grenadines","ja":"セントビンセントおよびグレナディーン諸島","it":"Saint Vincent e Grenadine","br":"São Vicente e Granadinas","pt":"São Vicente e Granadinas","nl":"Saint Vincent en de Grenadines","hr":"Sveti Vincent i Grenadini","fa":"سنت وینسنت و گرنادین‌ها"},"flag":"https://restcountries.eu/data/vct.svg","regionalBlocs":[{"acronym":"CARICOM","name":"Caribbean Community","otherAcronyms":[],"otherNames":["Comunidad del Caribe","Communauté Caribéenne","Caribische Gemeenschap"]}],"cioc":"VIN"} +{"name":"Samoa","topLevelDomain":[".ws"],"alpha2Code":"WS","alpha3Code":"WSM","callingCodes":["685"],"capital":"Apia","altSpellings":["WS","Independent State of Samoa","Malo Saʻoloto Tutoʻatasi o Sāmoa"],"region":"Oceania","subregion":"Polynesia","population":194899,"latlng":[-13.58333333,-172.33333333],"demonym":"Samoan","area":2842.0,"gini":null,"timezones":["UTC+13:00"],"borders":[],"nativeName":"Samoa","numericCode":"882","currencies":[{"code":"WST","name":"Samoan tālā","symbol":"T"}],"languages":[{"iso639_1":"sm","iso639_2":"smo","name":"Samoan","nativeName":"gagana fa'a Samoa"},{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Samoa","es":"Samoa","fr":"Samoa","ja":"サモア","it":"Samoa","br":"Samoa","pt":"Samoa","nl":"Samoa","hr":"Samoa","fa":"ساموآ"},"flag":"https://restcountries.eu/data/wsm.svg","regionalBlocs":[],"cioc":"SAM"} +{"name":"San Marino","topLevelDomain":[".sm"],"alpha2Code":"SM","alpha3Code":"SMR","callingCodes":["378"],"capital":"City of San Marino","altSpellings":["SM","Republic of San Marino","Repubblica di San Marino"],"region":"Europe","subregion":"Southern Europe","population":33005,"latlng":[43.76666666,12.41666666],"demonym":"Sammarinese","area":61.0,"gini":null,"timezones":["UTC+01:00"],"borders":["ITA"],"nativeName":"San Marino","numericCode":"674","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"it","iso639_2":"ita","name":"Italian","nativeName":"Italiano"}],"translations":{"de":"San Marino","es":"San Marino","fr":"Saint-Marin","ja":"サンマリノ","it":"San Marino","br":"San Marino","pt":"São Marinho","nl":"San Marino","hr":"San Marino","fa":"سان مارینو"},"flag":"https://restcountries.eu/data/smr.svg","regionalBlocs":[],"cioc":"SMR"} +{"name":"Sao Tome and Principe","topLevelDomain":[".st"],"alpha2Code":"ST","alpha3Code":"STP","callingCodes":["239"],"capital":"São Tomé","altSpellings":["ST","Democratic Republic of São Tomé and Príncipe","República Democrática de São Tomé e Príncipe"],"region":"Africa","subregion":"Middle Africa","population":187356,"latlng":[1.0,7.0],"demonym":"Sao Tomean","area":964.0,"gini":50.8,"timezones":["UTC"],"borders":[],"nativeName":"São Tomé e Príncipe","numericCode":"678","currencies":[{"code":"STD","name":"São Tomé and Príncipe dobra","symbol":"Db"}],"languages":[{"iso639_1":"pt","iso639_2":"por","name":"Portuguese","nativeName":"Português"}],"translations":{"de":"São Tomé und Príncipe","es":"Santo Tomé y Príncipe","fr":"Sao Tomé-et-Principe","ja":"サントメ・プリンシペ","it":"São Tomé e Príncipe","br":"São Tomé e Príncipe","pt":"São Tomé e Príncipe","nl":"Sao Tomé en Principe","hr":"Sveti Toma i Princip","fa":"کواترو دو فرویرو"},"flag":"https://restcountries.eu/data/stp.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"STP"} +{"name":"Saudi Arabia","topLevelDomain":[".sa"],"alpha2Code":"SA","alpha3Code":"SAU","callingCodes":["966"],"capital":"Riyadh","altSpellings":["SA","Kingdom of Saudi Arabia","Al-Mamlakah al-‘Arabiyyah as-Su‘ūdiyyah"],"region":"Asia","subregion":"Western Asia","population":32248200,"latlng":[25.0,45.0],"demonym":"Saudi Arabian","area":2149690.0,"gini":null,"timezones":["UTC+03:00"],"borders":["IRQ","JOR","KWT","OMN","QAT","ARE","YEM"],"nativeName":"العربية السعودية","numericCode":"682","currencies":[{"code":"SAR","name":"Saudi riyal","symbol":"ر.س"}],"languages":[{"iso639_1":"ar","iso639_2":"ara","name":"Arabic","nativeName":"العربية"}],"translations":{"de":"Saudi-Arabien","es":"Arabia Saudí","fr":"Arabie Saoudite","ja":"サウジアラビア","it":"Arabia Saudita","br":"Arábia Saudita","pt":"Arábia Saudita","nl":"Saoedi-Arabië","hr":"Saudijska Arabija","fa":"عربستان سعودی"},"flag":"https://restcountries.eu/data/sau.svg","regionalBlocs":[{"acronym":"AL","name":"Arab League","otherAcronyms":[],"otherNames":["جامعة الدول العربية","Jāmiʻat ad-Duwal al-ʻArabīyah","League of Arab States"]}],"cioc":"KSA"} +{"name":"Senegal","topLevelDomain":[".sn"],"alpha2Code":"SN","alpha3Code":"SEN","callingCodes":["221"],"capital":"Dakar","altSpellings":["SN","Republic of Senegal","République du Sénégal"],"region":"Africa","subregion":"Western Africa","population":14799859,"latlng":[14.0,-14.0],"demonym":"Senegalese","area":196722.0,"gini":39.2,"timezones":["UTC"],"borders":["GMB","GIN","GNB","MLI","MRT"],"nativeName":"Sénégal","numericCode":"686","currencies":[{"code":"XOF","name":"West African CFA franc","symbol":"Fr"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Senegal","es":"Senegal","fr":"Sénégal","ja":"セネガル","it":"Senegal","br":"Senegal","pt":"Senegal","nl":"Senegal","hr":"Senegal","fa":"سنگال"},"flag":"https://restcountries.eu/data/sen.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"SEN"} +{"name":"Serbia","topLevelDomain":[".rs"],"alpha2Code":"RS","alpha3Code":"SRB","callingCodes":["381"],"capital":"Belgrade","altSpellings":["RS","Srbija","Republic of Serbia","Република Србија","Republika Srbija"],"region":"Europe","subregion":"Southern Europe","population":7076372,"latlng":[44.0,21.0],"demonym":"Serbian","area":88361.0,"gini":27.8,"timezones":["UTC+01:00"],"borders":["BIH","BGR","HRV","HUN","KOS","MKD","MNE","ROU"],"nativeName":"Србија","numericCode":"688","currencies":[{"code":"RSD","name":"Serbian dinar","symbol":"дин."}],"languages":[{"iso639_1":"sr","iso639_2":"srp","name":"Serbian","nativeName":"српски језик"}],"translations":{"de":"Serbien","es":"Serbia","fr":"Serbie","ja":"セルビア","it":"Serbia","br":"Sérvia","pt":"Sérvia","nl":"Servië","hr":"Srbija","fa":"صربستان"},"flag":"https://restcountries.eu/data/srb.svg","regionalBlocs":[{"acronym":"CEFTA","name":"Central European Free Trade Agreement","otherAcronyms":[],"otherNames":[]}],"cioc":"SRB"} +{"name":"Seychelles","topLevelDomain":[".sc"],"alpha2Code":"SC","alpha3Code":"SYC","callingCodes":["248"],"capital":"Victoria","altSpellings":["SC","Republic of Seychelles","Repiblik Sesel","République des Seychelles"],"region":"Africa","subregion":"Eastern Africa","population":91400,"latlng":[-4.58333333,55.66666666],"demonym":"Seychellois","area":452.0,"gini":65.8,"timezones":["UTC+04:00"],"borders":[],"nativeName":"Seychelles","numericCode":"690","currencies":[{"code":"SCR","name":"Seychellois rupee","symbol":"₨"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"},{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Seychellen","es":"Seychelles","fr":"Seychelles","ja":"セーシェル","it":"Seychelles","br":"Seicheles","pt":"Seicheles","nl":"Seychellen","hr":"Sejšeli","fa":"سیشل"},"flag":"https://restcountries.eu/data/syc.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"SEY"} +{"name":"Sierra Leone","topLevelDomain":[".sl"],"alpha2Code":"SL","alpha3Code":"SLE","callingCodes":["232"],"capital":"Freetown","altSpellings":["SL","Republic of Sierra Leone"],"region":"Africa","subregion":"Western Africa","population":7075641,"latlng":[8.5,-11.5],"demonym":"Sierra Leonean","area":71740.0,"gini":42.5,"timezones":["UTC"],"borders":["GIN","LBR"],"nativeName":"Sierra Leone","numericCode":"694","currencies":[{"code":"SLL","name":"Sierra Leonean leone","symbol":"Le"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Sierra Leone","es":"Sierra Leone","fr":"Sierra Leone","ja":"シエラレオネ","it":"Sierra Leone","br":"Serra Leoa","pt":"Serra Leoa","nl":"Sierra Leone","hr":"Sijera Leone","fa":"سیرالئون"},"flag":"https://restcountries.eu/data/sle.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"SLE"} +{"name":"Singapore","topLevelDomain":[".sg"],"alpha2Code":"SG","alpha3Code":"SGP","callingCodes":["65"],"capital":"Singapore","altSpellings":["SG","Singapura","Republik Singapura","新加坡共和国"],"region":"Asia","subregion":"South-Eastern Asia","population":5535000,"latlng":[1.36666666,103.8],"demonym":"Singaporean","area":710.0,"gini":48.1,"timezones":["UTC+08:00"],"borders":[],"nativeName":"Singapore","numericCode":"702","currencies":[{"code":"BND","name":"Brunei dollar","symbol":"$"},{"code":"SGD","name":"Singapore dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"ms","iso639_2":"msa","name":"Malay","nativeName":"bahasa Melayu"},{"iso639_1":"ta","iso639_2":"tam","name":"Tamil","nativeName":"தமிழ்"},{"iso639_1":"zh","iso639_2":"zho","name":"Chinese","nativeName":"中文 (Zhōngwén)"}],"translations":{"de":"Singapur","es":"Singapur","fr":"Singapour","ja":"シンガポール","it":"Singapore","br":"Singapura","pt":"Singapura","nl":"Singapore","hr":"Singapur","fa":"سنگاپور"},"flag":"https://restcountries.eu/data/sgp.svg","regionalBlocs":[{"acronym":"ASEAN","name":"Association of Southeast Asian Nations","otherAcronyms":[],"otherNames":[]}],"cioc":"SIN"} +{"name":"Sint Maarten (Dutch part)","topLevelDomain":[".sx"],"alpha2Code":"SX","alpha3Code":"SXM","callingCodes":["1721"],"capital":"Philipsburg","altSpellings":["SX"],"region":"Americas","subregion":"Caribbean","population":38247,"latlng":[18.033333,-63.05],"demonym":"Dutch","area":34.0,"gini":null,"timezones":["UTC-04:00"],"borders":["MAF"],"nativeName":"Sint Maarten","numericCode":"534","currencies":[{"code":"ANG","name":"Netherlands Antillean guilder","symbol":"ƒ"}],"languages":[{"iso639_1":"nl","iso639_2":"nld","name":"Dutch","nativeName":"Nederlands"},{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Sint Maarten (niederl. Teil)","es":null,"fr":"Saint Martin (partie néerlandaise)","ja":null,"it":"Saint Martin (parte olandese)","br":"Sint Maarten","pt":"São Martinho","nl":"Sint Maarten","hr":null,"fa":"سینت مارتن"},"flag":"https://restcountries.eu/data/sxm.svg","regionalBlocs":[],"cioc":""} +{"name":"Slovakia","topLevelDomain":[".sk"],"alpha2Code":"SK","alpha3Code":"SVK","callingCodes":["421"],"capital":"Bratislava","altSpellings":["SK","Slovak Republic","Slovenská republika"],"region":"Europe","subregion":"Eastern Europe","population":5426252,"latlng":[48.66666666,19.5],"demonym":"Slovak","area":49037.0,"gini":26.0,"timezones":["UTC+01:00"],"borders":["AUT","CZE","HUN","POL","UKR"],"nativeName":"Slovensko","numericCode":"703","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"sk","iso639_2":"slk","name":"Slovak","nativeName":"slovenčina"}],"translations":{"de":"Slowakei","es":"República Eslovaca","fr":"Slovaquie","ja":"スロバキア","it":"Slovacchia","br":"Eslováquia","pt":"Eslováquia","nl":"Slowakije","hr":"Slovačka","fa":"اسلواکی"},"flag":"https://restcountries.eu/data/svk.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"SVK"} +{"name":"Slovenia","topLevelDomain":[".si"],"alpha2Code":"SI","alpha3Code":"SVN","callingCodes":["386"],"capital":"Ljubljana","altSpellings":["SI","Republic of Slovenia","Republika Slovenija"],"region":"Europe","subregion":"Southern Europe","population":2064188,"latlng":[46.11666666,14.81666666],"demonym":"Slovene","area":20273.0,"gini":31.2,"timezones":["UTC+01:00"],"borders":["AUT","HRV","ITA","HUN"],"nativeName":"Slovenija","numericCode":"705","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"sl","iso639_2":"slv","name":"Slovene","nativeName":"slovenski jezik"}],"translations":{"de":"Slowenien","es":"Eslovenia","fr":"Slovénie","ja":"スロベニア","it":"Slovenia","br":"Eslovênia","pt":"Eslovénia","nl":"Slovenië","hr":"Slovenija","fa":"اسلوونی"},"flag":"https://restcountries.eu/data/svn.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"SLO"} +{"name":"Solomon Islands","topLevelDomain":[".sb"],"alpha2Code":"SB","alpha3Code":"SLB","callingCodes":["677"],"capital":"Honiara","altSpellings":["SB"],"region":"Oceania","subregion":"Melanesia","population":642000,"latlng":[-8.0,159.0],"demonym":"Solomon Islander","area":28896.0,"gini":null,"timezones":["UTC+11:00"],"borders":[],"nativeName":"Solomon Islands","numericCode":"090","currencies":[{"code":"SBD","name":"Solomon Islands dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Salomonen","es":"Islas Salomón","fr":"Îles Salomon","ja":"ソロモン諸島","it":"Isole Salomone","br":"Ilhas Salomão","pt":"Ilhas Salomão","nl":"Salomonseilanden","hr":"Solomonski Otoci","fa":"جزایر سلیمان"},"flag":"https://restcountries.eu/data/slb.svg","regionalBlocs":[],"cioc":"SOL"} +{"name":"Somalia","topLevelDomain":[".so"],"alpha2Code":"SO","alpha3Code":"SOM","callingCodes":["252"],"capital":"Mogadishu","altSpellings":["SO","aṣ-Ṣūmāl","Federal Republic of Somalia","Jamhuuriyadda Federaalka Soomaaliya","Jumhūriyyat aṣ-Ṣūmāl al-Fiderāliyya"],"region":"Africa","subregion":"Eastern Africa","population":11079000,"latlng":[10.0,49.0],"demonym":"Somali","area":637657.0,"gini":null,"timezones":["UTC+03:00"],"borders":["DJI","ETH","KEN"],"nativeName":"Soomaaliya","numericCode":"706","currencies":[{"code":"SOS","name":"Somali shilling","symbol":"Sh"}],"languages":[{"iso639_1":"so","iso639_2":"som","name":"Somali","nativeName":"Soomaaliga"},{"iso639_1":"ar","iso639_2":"ara","name":"Arabic","nativeName":"العربية"}],"translations":{"de":"Somalia","es":"Somalia","fr":"Somalie","ja":"ソマリア","it":"Somalia","br":"Somália","pt":"Somália","nl":"Somalië","hr":"Somalija","fa":"سومالی"},"flag":"https://restcountries.eu/data/som.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]},{"acronym":"AL","name":"Arab League","otherAcronyms":[],"otherNames":["جامعة الدول العربية","Jāmiʻat ad-Duwal al-ʻArabīyah","League of Arab States"]}],"cioc":"SOM"} +{"name":"South Africa","topLevelDomain":[".za"],"alpha2Code":"ZA","alpha3Code":"ZAF","callingCodes":["27"],"capital":"Pretoria","altSpellings":["ZA","RSA","Suid-Afrika","Republic of South Africa"],"region":"Africa","subregion":"Southern Africa","population":55653654,"latlng":[-29.0,24.0],"demonym":"South African","area":1221037.0,"gini":63.1,"timezones":["UTC+02:00"],"borders":["BWA","LSO","MOZ","NAM","SWZ","ZWE"],"nativeName":"South Africa","numericCode":"710","currencies":[{"code":"ZAR","name":"South African rand","symbol":"R"}],"languages":[{"iso639_1":"af","iso639_2":"afr","name":"Afrikaans","nativeName":"Afrikaans"},{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"nr","iso639_2":"nbl","name":"Southern Ndebele","nativeName":"isiNdebele"},{"iso639_1":"st","iso639_2":"sot","name":"Southern Sotho","nativeName":"Sesotho"},{"iso639_1":"ss","iso639_2":"ssw","name":"Swati","nativeName":"SiSwati"},{"iso639_1":"tn","iso639_2":"tsn","name":"Tswana","nativeName":"Setswana"},{"iso639_1":"ts","iso639_2":"tso","name":"Tsonga","nativeName":"Xitsonga"},{"iso639_1":"ve","iso639_2":"ven","name":"Venda","nativeName":"Tshivenḓa"},{"iso639_1":"xh","iso639_2":"xho","name":"Xhosa","nativeName":"isiXhosa"},{"iso639_1":"zu","iso639_2":"zul","name":"Zulu","nativeName":"isiZulu"}],"translations":{"de":"Republik Südafrika","es":"República de Sudáfrica","fr":"Afrique du Sud","ja":"南アフリカ","it":"Sud Africa","br":"República Sul-Africana","pt":"República Sul-Africana","nl":"Zuid-Afrika","hr":"Južnoafrička Republika","fa":"آفریقای جنوبی"},"flag":"https://restcountries.eu/data/zaf.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"RSA"} +{"name":"South Georgia and the South Sandwich Islands","topLevelDomain":[".gs"],"alpha2Code":"GS","alpha3Code":"SGS","callingCodes":["500"],"capital":"King Edward Point","altSpellings":["GS","South Georgia and the South Sandwich Islands"],"region":"Americas","subregion":"South America","population":30,"latlng":[-54.5,-37.0],"demonym":"South Georgia and the South Sandwich Islander","area":null,"gini":null,"timezones":["UTC-02:00"],"borders":[],"nativeName":"South Georgia","numericCode":"239","currencies":[{"code":"GBP","name":"British pound","symbol":"£"},{"code":"(none)","name":null,"symbol":"£"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Südgeorgien und die Südlichen Sandwichinseln","es":"Islas Georgias del Sur y Sandwich del Sur","fr":"Géorgie du Sud-et-les Îles Sandwich du Sud","ja":"サウスジョージア・サウスサンドウィッチ諸島","it":"Georgia del Sud e Isole Sandwich Meridionali","br":"Ilhas Geórgias do Sul e Sandwich do Sul","pt":"Ilhas Geórgia do Sul e Sanduíche do Sul","nl":"Zuid-Georgia en Zuidelijke Sandwicheilanden","hr":"Južna Georgija i otočje Južni Sandwich","fa":"جزایر جورجیای جنوبی و ساندویچ جنوبی"},"flag":"https://restcountries.eu/data/sgs.svg","regionalBlocs":[{"acronym":"USAN","name":"Union of South American Nations","otherAcronyms":["UNASUR","UNASUL","UZAN"],"otherNames":["Unión de Naciones Suramericanas","União de Nações Sul-Americanas","Unie van Zuid-Amerikaanse Naties","South American Union"]}],"cioc":""} +{"name":"Korea (Republic of)","topLevelDomain":[".kr"],"alpha2Code":"KR","alpha3Code":"KOR","callingCodes":["82"],"capital":"Seoul","altSpellings":["KR","Republic of Korea"],"region":"Asia","subregion":"Eastern Asia","population":50801405,"latlng":[37.0,127.5],"demonym":"South Korean","area":100210.0,"gini":31.3,"timezones":["UTC+09:00"],"borders":["PRK"],"nativeName":"대한민국","numericCode":"410","currencies":[{"code":"KRW","name":"South Korean won","symbol":"₩"}],"languages":[{"iso639_1":"ko","iso639_2":"kor","name":"Korean","nativeName":"한국어"}],"translations":{"de":"Südkorea","es":"Corea del Sur","fr":"Corée du Sud","ja":"大韓民国","it":"Corea del Sud","br":"Coreia do Sul","pt":"Coreia do Sul","nl":"Zuid-Korea","hr":"Južna Koreja","fa":"کره شمالی"},"flag":"https://restcountries.eu/data/kor.svg","regionalBlocs":[],"cioc":"KOR"} +{"name":"South Sudan","topLevelDomain":[".ss"],"alpha2Code":"SS","alpha3Code":"SSD","callingCodes":["211"],"capital":"Juba","altSpellings":["SS"],"region":"Africa","subregion":"Middle Africa","population":12131000,"latlng":[7.0,30.0],"demonym":"South Sudanese","area":619745.0,"gini":45.5,"timezones":["UTC+03:00"],"borders":["CAF","COD","ETH","KEN","SDN","UGA"],"nativeName":"South Sudan","numericCode":"728","currencies":[{"code":"SSP","name":"South Sudanese pound","symbol":"£"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Südsudan","es":"Sudán del Sur","fr":"Soudan du Sud","ja":"南スーダン","it":"Sudan del sud","br":"Sudão do Sul","pt":"Sudão do Sul","nl":"Zuid-Soedan","hr":"Južni Sudan","fa":"سودان جنوبی"},"flag":"https://restcountries.eu/data/ssd.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":""} +{"name":"Spain","topLevelDomain":[".es"],"alpha2Code":"ES","alpha3Code":"ESP","callingCodes":["34"],"capital":"Madrid","altSpellings":["ES","Kingdom of Spain","Reino de España"],"region":"Europe","subregion":"Southern Europe","population":46438422,"latlng":[40.0,-4.0],"demonym":"Spanish","area":505992.0,"gini":34.7,"timezones":["UTC","UTC+01:00"],"borders":["AND","FRA","GIB","PRT","MAR"],"nativeName":"España","numericCode":"724","currencies":[{"code":"EUR","name":"Euro","symbol":"€"}],"languages":[{"iso639_1":"es","iso639_2":"spa","name":"Spanish","nativeName":"Español"}],"translations":{"de":"Spanien","es":"España","fr":"Espagne","ja":"スペイン","it":"Spagna","br":"Espanha","pt":"Espanha","nl":"Spanje","hr":"Španjolska","fa":"اسپانیا"},"flag":"https://restcountries.eu/data/esp.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"ESP"} +{"name":"Sri Lanka","topLevelDomain":[".lk"],"alpha2Code":"LK","alpha3Code":"LKA","callingCodes":["94"],"capital":"Colombo","altSpellings":["LK","ilaṅkai","Democratic Socialist Republic of Sri Lanka"],"region":"Asia","subregion":"Southern Asia","population":20966000,"latlng":[7.0,81.0],"demonym":"Sri Lankan","area":65610.0,"gini":40.3,"timezones":["UTC+05:30"],"borders":["IND"],"nativeName":"śrī laṃkāva","numericCode":"144","currencies":[{"code":"LKR","name":"Sri Lankan rupee","symbol":"Rs"}],"languages":[{"iso639_1":"si","iso639_2":"sin","name":"Sinhalese","nativeName":"සිංහල"},{"iso639_1":"ta","iso639_2":"tam","name":"Tamil","nativeName":"தமிழ்"}],"translations":{"de":"Sri Lanka","es":"Sri Lanka","fr":"Sri Lanka","ja":"スリランカ","it":"Sri Lanka","br":"Sri Lanka","pt":"Sri Lanka","nl":"Sri Lanka","hr":"Šri Lanka","fa":"سری‌لانکا"},"flag":"https://restcountries.eu/data/lka.svg","regionalBlocs":[{"acronym":"SAARC","name":"South Asian Association for Regional Cooperation","otherAcronyms":[],"otherNames":[]}],"cioc":"SRI"} +{"name":"Sudan","topLevelDomain":[".sd"],"alpha2Code":"SD","alpha3Code":"SDN","callingCodes":["249"],"capital":"Khartoum","altSpellings":["SD","Republic of the Sudan","Jumhūrīyat as-Sūdān"],"region":"Africa","subregion":"Northern Africa","population":39598700,"latlng":[15.0,30.0],"demonym":"Sudanese","area":1886068.0,"gini":35.3,"timezones":["UTC+03:00"],"borders":["CAF","TCD","EGY","ERI","ETH","LBY","SSD"],"nativeName":"السودان","numericCode":"729","currencies":[{"code":"SDG","name":"Sudanese pound","symbol":"ج.س."}],"languages":[{"iso639_1":"ar","iso639_2":"ara","name":"Arabic","nativeName":"العربية"},{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Sudan","es":"Sudán","fr":"Soudan","ja":"スーダン","it":"Sudan","br":"Sudão","pt":"Sudão","nl":"Soedan","hr":"Sudan","fa":"سودان"},"flag":"https://restcountries.eu/data/sdn.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]},{"acronym":"AL","name":"Arab League","otherAcronyms":[],"otherNames":["جامعة الدول العربية","Jāmiʻat ad-Duwal al-ʻArabīyah","League of Arab States"]}],"cioc":"SUD"} +{"name":"Suriname","topLevelDomain":[".sr"],"alpha2Code":"SR","alpha3Code":"SUR","callingCodes":["597"],"capital":"Paramaribo","altSpellings":["SR","Sarnam","Sranangron","Republic of Suriname","Republiek Suriname"],"region":"Americas","subregion":"South America","population":541638,"latlng":[4.0,-56.0],"demonym":"Surinamer","area":163820.0,"gini":52.9,"timezones":["UTC-03:00"],"borders":["BRA","GUF","FRA","GUY"],"nativeName":"Suriname","numericCode":"740","currencies":[{"code":"SRD","name":"Surinamese dollar","symbol":"$"}],"languages":[{"iso639_1":"nl","iso639_2":"nld","name":"Dutch","nativeName":"Nederlands"}],"translations":{"de":"Suriname","es":"Surinam","fr":"Surinam","ja":"スリナム","it":"Suriname","br":"Suriname","pt":"Suriname","nl":"Suriname","hr":"Surinam","fa":"سورینام"},"flag":"https://restcountries.eu/data/sur.svg","regionalBlocs":[{"acronym":"CARICOM","name":"Caribbean Community","otherAcronyms":[],"otherNames":["Comunidad del Caribe","Communauté Caribéenne","Caribische Gemeenschap"]},{"acronym":"USAN","name":"Union of South American Nations","otherAcronyms":["UNASUR","UNASUL","UZAN"],"otherNames":["Unión de Naciones Suramericanas","União de Nações Sul-Americanas","Unie van Zuid-Amerikaanse Naties","South American Union"]}],"cioc":"SUR"} +{"name":"Svalbard and Jan Mayen","topLevelDomain":[".sj"],"alpha2Code":"SJ","alpha3Code":"SJM","callingCodes":["4779"],"capital":"Longyearbyen","altSpellings":["SJ","Svalbard and Jan Mayen Islands"],"region":"Europe","subregion":"Northern Europe","population":2562,"latlng":[78.0,20.0],"demonym":"Norwegian","area":null,"gini":null,"timezones":["UTC+01:00"],"borders":[],"nativeName":"Svalbard og Jan Mayen","numericCode":"744","currencies":[{"code":"NOK","name":"Norwegian krone","symbol":"kr"}],"languages":[{"iso639_1":"no","iso639_2":"nor","name":"Norwegian","nativeName":"Norsk"}],"translations":{"de":"Svalbard und Jan Mayen","es":"Islas Svalbard y Jan Mayen","fr":"Svalbard et Jan Mayen","ja":"スヴァールバル諸島およびヤンマイエン島","it":"Svalbard e Jan Mayen","br":"Svalbard","pt":"Svalbard","nl":"Svalbard en Jan Mayen","hr":"Svalbard i Jan Mayen","fa":"سوالبارد و یان ماین"},"flag":"https://restcountries.eu/data/sjm.svg","regionalBlocs":[],"cioc":""} +{"name":"Swaziland","topLevelDomain":[".sz"],"alpha2Code":"SZ","alpha3Code":"SWZ","callingCodes":["268"],"capital":"Lobamba","altSpellings":["SZ","weSwatini","Swatini","Ngwane","Kingdom of Swaziland","Umbuso waseSwatini"],"region":"Africa","subregion":"Southern Africa","population":1132657,"latlng":[-26.5,31.5],"demonym":"Swazi","area":17364.0,"gini":51.5,"timezones":["UTC+02:00"],"borders":["MOZ","ZAF"],"nativeName":"Swaziland","numericCode":"748","currencies":[{"code":"SZL","name":"Swazi lilangeni","symbol":"L"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"ss","iso639_2":"ssw","name":"Swati","nativeName":"SiSwati"}],"translations":{"de":"Swasiland","es":"Suazilandia","fr":"Swaziland","ja":"スワジランド","it":"Swaziland","br":"Suazilândia","pt":"Suazilândia","nl":"Swaziland","hr":"Svazi","fa":"سوازیلند"},"flag":"https://restcountries.eu/data/swz.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"SWZ"} +{"name":"Sweden","topLevelDomain":[".se"],"alpha2Code":"SE","alpha3Code":"SWE","callingCodes":["46"],"capital":"Stockholm","altSpellings":["SE","Kingdom of Sweden","Konungariket Sverige"],"region":"Europe","subregion":"Northern Europe","population":9894888,"latlng":[62.0,15.0],"demonym":"Swedish","area":450295.0,"gini":25.0,"timezones":["UTC+01:00"],"borders":["FIN","NOR"],"nativeName":"Sverige","numericCode":"752","currencies":[{"code":"SEK","name":"Swedish krona","symbol":"kr"}],"languages":[{"iso639_1":"sv","iso639_2":"swe","name":"Swedish","nativeName":"svenska"}],"translations":{"de":"Schweden","es":"Suecia","fr":"Suède","ja":"スウェーデン","it":"Svezia","br":"Suécia","pt":"Suécia","nl":"Zweden","hr":"Švedska","fa":"سوئد"},"flag":"https://restcountries.eu/data/swe.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"SWE"} +{"name":"Switzerland","topLevelDomain":[".ch"],"alpha2Code":"CH","alpha3Code":"CHE","callingCodes":["41"],"capital":"Bern","altSpellings":["CH","Swiss Confederation","Schweiz","Suisse","Svizzera","Svizra"],"region":"Europe","subregion":"Western Europe","population":8341600,"latlng":[47.0,8.0],"demonym":"Swiss","area":41284.0,"gini":33.7,"timezones":["UTC+01:00"],"borders":["AUT","FRA","ITA","LIE","DEU"],"nativeName":"Schweiz","numericCode":"756","currencies":[{"code":"CHF","name":"Swiss franc","symbol":"Fr"}],"languages":[{"iso639_1":"de","iso639_2":"deu","name":"German","nativeName":"Deutsch"},{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"},{"iso639_1":"it","iso639_2":"ita","name":"Italian","nativeName":"Italiano"}],"translations":{"de":"Schweiz","es":"Suiza","fr":"Suisse","ja":"スイス","it":"Svizzera","br":"Suíça","pt":"Suíça","nl":"Zwitserland","hr":"Švicarska","fa":"سوئیس"},"flag":"https://restcountries.eu/data/che.svg","regionalBlocs":[{"acronym":"EFTA","name":"European Free Trade Association","otherAcronyms":[],"otherNames":[]}],"cioc":"SUI"} +{"name":"Syrian Arab Republic","topLevelDomain":[".sy"],"alpha2Code":"SY","alpha3Code":"SYR","callingCodes":["963"],"capital":"Damascus","altSpellings":["SY","Syrian Arab Republic","Al-Jumhūrīyah Al-ʻArabīyah As-Sūrīyah"],"region":"Asia","subregion":"Western Asia","population":18564000,"latlng":[35.0,38.0],"demonym":"Syrian","area":185180.0,"gini":35.8,"timezones":["UTC+02:00"],"borders":["IRQ","ISR","JOR","LBN","TUR"],"nativeName":"سوريا","numericCode":"760","currencies":[{"code":"SYP","name":"Syrian pound","symbol":"£"}],"languages":[{"iso639_1":"ar","iso639_2":"ara","name":"Arabic","nativeName":"العربية"}],"translations":{"de":"Syrien","es":"Siria","fr":"Syrie","ja":"シリア・アラブ共和国","it":"Siria","br":"Síria","pt":"Síria","nl":"Syrië","hr":"Sirija","fa":"سوریه"},"flag":"https://restcountries.eu/data/syr.svg","regionalBlocs":[{"acronym":"AL","name":"Arab League","otherAcronyms":[],"otherNames":["جامعة الدول العربية","Jāmiʻat ad-Duwal al-ʻArabīyah","League of Arab States"]}],"cioc":"SYR"} +{"name":"Taiwan","topLevelDomain":[".tw"],"alpha2Code":"TW","alpha3Code":"TWN","callingCodes":["886"],"capital":"Taipei","altSpellings":["TW","Táiwān","Republic of China","中華民國","Zhōnghuá Mínguó"],"region":"Asia","subregion":"Eastern Asia","population":23503349,"latlng":[23.5,121.0],"demonym":"Taiwanese","area":36193.0,"gini":null,"timezones":["UTC+08:00"],"borders":[],"nativeName":"臺灣","numericCode":"158","currencies":[{"code":"TWD","name":"New Taiwan dollar","symbol":"$"}],"languages":[{"iso639_1":"zh","iso639_2":"zho","name":"Chinese","nativeName":"中文 (Zhōngwén)"}],"translations":{"de":"Taiwan","es":"Taiwán","fr":"Taïwan","ja":"台湾(中華民国)","it":"Taiwan","br":"Taiwan","pt":"Taiwan","nl":"Taiwan","hr":"Tajvan","fa":"تایوان"},"flag":"https://restcountries.eu/data/twn.svg","regionalBlocs":[],"cioc":"TPE"} +{"name":"Tajikistan","topLevelDomain":[".tj"],"alpha2Code":"TJ","alpha3Code":"TJK","callingCodes":["992"],"capital":"Dushanbe","altSpellings":["TJ","Toçikiston","Republic of Tajikistan","Ҷумҳурии Тоҷикистон","Çumhuriyi Toçikiston"],"region":"Asia","subregion":"Central Asia","population":8593600,"latlng":[39.0,71.0],"demonym":"Tadzhik","area":143100.0,"gini":30.8,"timezones":["UTC+05:00"],"borders":["AFG","CHN","KGZ","UZB"],"nativeName":"Тоҷикистон","numericCode":"762","currencies":[{"code":"TJS","name":"Tajikistani somoni","symbol":"ЅМ"}],"languages":[{"iso639_1":"tg","iso639_2":"tgk","name":"Tajik","nativeName":"тоҷикӣ"},{"iso639_1":"ru","iso639_2":"rus","name":"Russian","nativeName":"Русский"}],"translations":{"de":"Tadschikistan","es":"Tayikistán","fr":"Tadjikistan","ja":"タジキスタン","it":"Tagikistan","br":"Tajiquistão","pt":"Tajiquistão","nl":"Tadzjikistan","hr":"Tađikistan","fa":"تاجیکستان"},"flag":"https://restcountries.eu/data/tjk.svg","regionalBlocs":[],"cioc":"TJK"} +{"name":"Tanzania, United Republic of","topLevelDomain":[".tz"],"alpha2Code":"TZ","alpha3Code":"TZA","callingCodes":["255"],"capital":"Dodoma","altSpellings":["TZ","United Republic of Tanzania","Jamhuri ya Muungano wa Tanzania"],"region":"Africa","subregion":"Eastern Africa","population":55155000,"latlng":[-6.0,35.0],"demonym":"Tanzanian","area":945087.0,"gini":37.6,"timezones":["UTC+03:00"],"borders":["BDI","COD","KEN","MWI","MOZ","RWA","UGA","ZMB"],"nativeName":"Tanzania","numericCode":"834","currencies":[{"code":"TZS","name":"Tanzanian shilling","symbol":"Sh"}],"languages":[{"iso639_1":"sw","iso639_2":"swa","name":"Swahili","nativeName":"Kiswahili"},{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Tansania","es":"Tanzania","fr":"Tanzanie","ja":"タンザニア","it":"Tanzania","br":"Tanzânia","pt":"Tanzânia","nl":"Tanzania","hr":"Tanzanija","fa":"تانزانیا"},"flag":"https://restcountries.eu/data/tza.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"TAN"} +{"name":"Thailand","topLevelDomain":[".th"],"alpha2Code":"TH","alpha3Code":"THA","callingCodes":["66"],"capital":"Bangkok","altSpellings":["TH","Prathet","Thai","Kingdom of Thailand","ราชอาณาจักรไทย","Ratcha Anachak Thai"],"region":"Asia","subregion":"South-Eastern Asia","population":65327652,"latlng":[15.0,100.0],"demonym":"Thai","area":513120.0,"gini":40.0,"timezones":["UTC+07:00"],"borders":["MMR","KHM","LAO","MYS"],"nativeName":"ประเทศไทย","numericCode":"764","currencies":[{"code":"THB","name":"Thai baht","symbol":"฿"}],"languages":[{"iso639_1":"th","iso639_2":"tha","name":"Thai","nativeName":"ไทย"}],"translations":{"de":"Thailand","es":"Tailandia","fr":"Thaïlande","ja":"タイ","it":"Tailandia","br":"Tailândia","pt":"Tailândia","nl":"Thailand","hr":"Tajland","fa":"تایلند"},"flag":"https://restcountries.eu/data/tha.svg","regionalBlocs":[{"acronym":"ASEAN","name":"Association of Southeast Asian Nations","otherAcronyms":[],"otherNames":[]}],"cioc":"THA"} +{"name":"Timor-Leste","topLevelDomain":[".tl"],"alpha2Code":"TL","alpha3Code":"TLS","callingCodes":["670"],"capital":"Dili","altSpellings":["TL","East Timor","Democratic Republic of Timor-Leste","República Democrática de Timor-Leste","Repúblika Demokrátika Timór-Leste"],"region":"Asia","subregion":"South-Eastern Asia","population":1167242,"latlng":[-8.83333333,125.91666666],"demonym":"East Timorese","area":14874.0,"gini":31.9,"timezones":["UTC+09:00"],"borders":["IDN"],"nativeName":"Timor-Leste","numericCode":"626","currencies":[{"code":"USD","name":"United States dollar","symbol":"$"},{"code":null,"name":null,"symbol":null}],"languages":[{"iso639_1":"pt","iso639_2":"por","name":"Portuguese","nativeName":"Português"}],"translations":{"de":"Timor-Leste","es":"Timor Oriental","fr":"Timor oriental","ja":"東ティモール","it":"Timor Est","br":"Timor Leste","pt":"Timor Leste","nl":"Oost-Timor","hr":"Istočni Timor","fa":"تیمور شرقی"},"flag":"https://restcountries.eu/data/tls.svg","regionalBlocs":[],"cioc":"TLS"} +{"name":"Togo","topLevelDomain":[".tg"],"alpha2Code":"TG","alpha3Code":"TGO","callingCodes":["228"],"capital":"Lomé","altSpellings":["TG","Togolese","Togolese Republic","République Togolaise"],"region":"Africa","subregion":"Western Africa","population":7143000,"latlng":[8.0,1.16666666],"demonym":"Togolese","area":56785.0,"gini":34.4,"timezones":["UTC"],"borders":["BEN","BFA","GHA"],"nativeName":"Togo","numericCode":"768","currencies":[{"code":"XOF","name":"West African CFA franc","symbol":"Fr"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Togo","es":"Togo","fr":"Togo","ja":"トーゴ","it":"Togo","br":"Togo","pt":"Togo","nl":"Togo","hr":"Togo","fa":"توگو"},"flag":"https://restcountries.eu/data/tgo.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"TOG"} +{"name":"Tokelau","topLevelDomain":[".tk"],"alpha2Code":"TK","alpha3Code":"TKL","callingCodes":["690"],"capital":"Fakaofo","altSpellings":["TK"],"region":"Oceania","subregion":"Polynesia","population":1411,"latlng":[-9.0,-172.0],"demonym":"Tokelauan","area":12.0,"gini":null,"timezones":["UTC+13:00"],"borders":[],"nativeName":"Tokelau","numericCode":"772","currencies":[{"code":"NZD","name":"New Zealand dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Tokelau","es":"Islas Tokelau","fr":"Tokelau","ja":"トケラウ","it":"Isole Tokelau","br":"Tokelau","pt":"Toquelau","nl":"Tokelau","hr":"Tokelau","fa":"توکلائو"},"flag":"https://restcountries.eu/data/tkl.svg","regionalBlocs":[],"cioc":""} +{"name":"Tonga","topLevelDomain":[".to"],"alpha2Code":"TO","alpha3Code":"TON","callingCodes":["676"],"capital":"Nuku'alofa","altSpellings":["TO"],"region":"Oceania","subregion":"Polynesia","population":103252,"latlng":[-20.0,-175.0],"demonym":"Tongan","area":747.0,"gini":null,"timezones":["UTC+13:00"],"borders":[],"nativeName":"Tonga","numericCode":"776","currencies":[{"code":"TOP","name":"Tongan paʻanga","symbol":"T$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"to","iso639_2":"ton","name":"Tonga (Tonga Islands)","nativeName":"faka Tonga"}],"translations":{"de":"Tonga","es":"Tonga","fr":"Tonga","ja":"トンガ","it":"Tonga","br":"Tonga","pt":"Tonga","nl":"Tonga","hr":"Tonga","fa":"تونگا"},"flag":"https://restcountries.eu/data/ton.svg","regionalBlocs":[],"cioc":"TGA"} +{"name":"Trinidad and Tobago","topLevelDomain":[".tt"],"alpha2Code":"TT","alpha3Code":"TTO","callingCodes":["1868"],"capital":"Port of Spain","altSpellings":["TT","Republic of Trinidad and Tobago"],"region":"Americas","subregion":"Caribbean","population":1349667,"latlng":[11.0,-61.0],"demonym":"Trinidadian","area":5130.0,"gini":40.3,"timezones":["UTC-04:00"],"borders":[],"nativeName":"Trinidad and Tobago","numericCode":"780","currencies":[{"code":"TTD","name":"Trinidad and Tobago dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Trinidad und Tobago","es":"Trinidad y Tobago","fr":"Trinité et Tobago","ja":"トリニダード・トバゴ","it":"Trinidad e Tobago","br":"Trinidad e Tobago","pt":"Trindade e Tobago","nl":"Trinidad en Tobago","hr":"Trinidad i Tobago","fa":"ترینیداد و توباگو"},"flag":"https://restcountries.eu/data/tto.svg","regionalBlocs":[{"acronym":"CARICOM","name":"Caribbean Community","otherAcronyms":[],"otherNames":["Comunidad del Caribe","Communauté Caribéenne","Caribische Gemeenschap"]}],"cioc":"TTO"} +{"name":"Tunisia","topLevelDomain":[".tn"],"alpha2Code":"TN","alpha3Code":"TUN","callingCodes":["216"],"capital":"Tunis","altSpellings":["TN","Republic of Tunisia","al-Jumhūriyyah at-Tūnisiyyah"],"region":"Africa","subregion":"Northern Africa","population":11154400,"latlng":[34.0,9.0],"demonym":"Tunisian","area":163610.0,"gini":41.4,"timezones":["UTC+01:00"],"borders":["DZA","LBY"],"nativeName":"تونس","numericCode":"788","currencies":[{"code":"TND","name":"Tunisian dinar","symbol":"د.ت"}],"languages":[{"iso639_1":"ar","iso639_2":"ara","name":"Arabic","nativeName":"العربية"}],"translations":{"de":"Tunesien","es":"Túnez","fr":"Tunisie","ja":"チュニジア","it":"Tunisia","br":"Tunísia","pt":"Tunísia","nl":"Tunesië","hr":"Tunis","fa":"تونس"},"flag":"https://restcountries.eu/data/tun.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]},{"acronym":"AL","name":"Arab League","otherAcronyms":[],"otherNames":["جامعة الدول العربية","Jāmiʻat ad-Duwal al-ʻArabīyah","League of Arab States"]}],"cioc":"TUN"} +{"name":"Turkey","topLevelDomain":[".tr"],"alpha2Code":"TR","alpha3Code":"TUR","callingCodes":["90"],"capital":"Ankara","altSpellings":["TR","Turkiye","Republic of Turkey","Türkiye Cumhuriyeti"],"region":"Asia","subregion":"Western Asia","population":78741053,"latlng":[39.0,35.0],"demonym":"Turkish","area":783562.0,"gini":39.0,"timezones":["UTC+03:00"],"borders":["ARM","AZE","BGR","GEO","GRC","IRN","IRQ","SYR"],"nativeName":"Türkiye","numericCode":"792","currencies":[{"code":"TRY","name":"Turkish lira","symbol":null}],"languages":[{"iso639_1":"tr","iso639_2":"tur","name":"Turkish","nativeName":"Türkçe"}],"translations":{"de":"Türkei","es":"Turquía","fr":"Turquie","ja":"トルコ","it":"Turchia","br":"Turquia","pt":"Turquia","nl":"Turkije","hr":"Turska","fa":"ترکیه"},"flag":"https://restcountries.eu/data/tur.svg","regionalBlocs":[],"cioc":"TUR"} +{"name":"Turkmenistan","topLevelDomain":[".tm"],"alpha2Code":"TM","alpha3Code":"TKM","callingCodes":["993"],"capital":"Ashgabat","altSpellings":["TM"],"region":"Asia","subregion":"Central Asia","population":4751120,"latlng":[40.0,60.0],"demonym":"Turkmen","area":488100.0,"gini":40.8,"timezones":["UTC+05:00"],"borders":["AFG","IRN","KAZ","UZB"],"nativeName":"Türkmenistan","numericCode":"795","currencies":[{"code":"TMT","name":"Turkmenistan manat","symbol":"m"}],"languages":[{"iso639_1":"tk","iso639_2":"tuk","name":"Turkmen","nativeName":"Türkmen"},{"iso639_1":"ru","iso639_2":"rus","name":"Russian","nativeName":"Русский"}],"translations":{"de":"Turkmenistan","es":"Turkmenistán","fr":"Turkménistan","ja":"トルクメニスタン","it":"Turkmenistan","br":"Turcomenistão","pt":"Turquemenistão","nl":"Turkmenistan","hr":"Turkmenistan","fa":"ترکمنستان"},"flag":"https://restcountries.eu/data/tkm.svg","regionalBlocs":[],"cioc":"TKM"} +{"name":"Turks and Caicos Islands","topLevelDomain":[".tc"],"alpha2Code":"TC","alpha3Code":"TCA","callingCodes":["1649"],"capital":"Cockburn Town","altSpellings":["TC"],"region":"Americas","subregion":"Caribbean","population":31458,"latlng":[21.75,-71.58333333],"demonym":"Turks and Caicos Islander","area":948.0,"gini":null,"timezones":["UTC-04:00"],"borders":[],"nativeName":"Turks and Caicos Islands","numericCode":"796","currencies":[{"code":"USD","name":"United States dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Turks- und Caicosinseln","es":"Islas Turks y Caicos","fr":"Îles Turques-et-Caïques","ja":"タークス・カイコス諸島","it":"Isole Turks e Caicos","br":"Ilhas Turcas e Caicos","pt":"Ilhas Turcas e Caicos","nl":"Turks- en Caicoseilanden","hr":"Otoci Turks i Caicos","fa":"جزایر تورکس و کایکوس"},"flag":"https://restcountries.eu/data/tca.svg","regionalBlocs":[],"cioc":""} +{"name":"Tuvalu","topLevelDomain":[".tv"],"alpha2Code":"TV","alpha3Code":"TUV","callingCodes":["688"],"capital":"Funafuti","altSpellings":["TV"],"region":"Oceania","subregion":"Polynesia","population":10640,"latlng":[-8.0,178.0],"demonym":"Tuvaluan","area":26.0,"gini":null,"timezones":["UTC+12:00"],"borders":[],"nativeName":"Tuvalu","numericCode":"798","currencies":[{"code":"AUD","name":"Australian dollar","symbol":"$"},{"code":"TVD[G]","name":"Tuvaluan dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Tuvalu","es":"Tuvalu","fr":"Tuvalu","ja":"ツバル","it":"Tuvalu","br":"Tuvalu","pt":"Tuvalu","nl":"Tuvalu","hr":"Tuvalu","fa":"تووالو"},"flag":"https://restcountries.eu/data/tuv.svg","regionalBlocs":[],"cioc":"TUV"} +{"name":"Uganda","topLevelDomain":[".ug"],"alpha2Code":"UG","alpha3Code":"UGA","callingCodes":["256"],"capital":"Kampala","altSpellings":["UG","Republic of Uganda","Jamhuri ya Uganda"],"region":"Africa","subregion":"Eastern Africa","population":33860700,"latlng":[1.0,32.0],"demonym":"Ugandan","area":241550.0,"gini":44.3,"timezones":["UTC+03:00"],"borders":["COD","KEN","RWA","SSD","TZA"],"nativeName":"Uganda","numericCode":"800","currencies":[{"code":"UGX","name":"Ugandan shilling","symbol":"Sh"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"sw","iso639_2":"swa","name":"Swahili","nativeName":"Kiswahili"}],"translations":{"de":"Uganda","es":"Uganda","fr":"Uganda","ja":"ウガンダ","it":"Uganda","br":"Uganda","pt":"Uganda","nl":"Oeganda","hr":"Uganda","fa":"اوگاندا"},"flag":"https://restcountries.eu/data/uga.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"UGA"} +{"name":"Ukraine","topLevelDomain":[".ua"],"alpha2Code":"UA","alpha3Code":"UKR","callingCodes":["380"],"capital":"Kiev","altSpellings":["UA","Ukrayina"],"region":"Europe","subregion":"Eastern Europe","population":42692393,"latlng":[49.0,32.0],"demonym":"Ukrainian","area":603700.0,"gini":26.4,"timezones":["UTC+02:00"],"borders":["BLR","HUN","MDA","POL","ROU","RUS","SVK"],"nativeName":"Україна","numericCode":"804","currencies":[{"code":"UAH","name":"Ukrainian hryvnia","symbol":"₴"}],"languages":[{"iso639_1":"uk","iso639_2":"ukr","name":"Ukrainian","nativeName":"Українська"}],"translations":{"de":"Ukraine","es":"Ucrania","fr":"Ukraine","ja":"ウクライナ","it":"Ucraina","br":"Ucrânia","pt":"Ucrânia","nl":"Oekraïne","hr":"Ukrajina","fa":"وکراین"},"flag":"https://restcountries.eu/data/ukr.svg","regionalBlocs":[],"cioc":"UKR"} +{"name":"United Arab Emirates","topLevelDomain":[".ae"],"alpha2Code":"AE","alpha3Code":"ARE","callingCodes":["971"],"capital":"Abu Dhabi","altSpellings":["AE","UAE"],"region":"Asia","subregion":"Western Asia","population":9856000,"latlng":[24.0,54.0],"demonym":"Emirati","area":83600.0,"gini":null,"timezones":["UTC+04"],"borders":["OMN","SAU"],"nativeName":"دولة الإمارات العربية المتحدة","numericCode":"784","currencies":[{"code":"AED","name":"United Arab Emirates dirham","symbol":"د.إ"}],"languages":[{"iso639_1":"ar","iso639_2":"ara","name":"Arabic","nativeName":"العربية"}],"translations":{"de":"Vereinigte Arabische Emirate","es":"Emiratos Árabes Unidos","fr":"Émirats arabes unis","ja":"アラブ首長国連邦","it":"Emirati Arabi Uniti","br":"Emirados árabes Unidos","pt":"Emirados árabes Unidos","nl":"Verenigde Arabische Emiraten","hr":"Ujedinjeni Arapski Emirati","fa":"امارات متحده عربی"},"flag":"https://restcountries.eu/data/are.svg","regionalBlocs":[{"acronym":"AL","name":"Arab League","otherAcronyms":[],"otherNames":["جامعة الدول العربية","Jāmiʻat ad-Duwal al-ʻArabīyah","League of Arab States"]}],"cioc":"UAE"} +{"name":"United Kingdom of Great Britain and Northern Ireland","topLevelDomain":[".uk"],"alpha2Code":"GB","alpha3Code":"GBR","callingCodes":["44"],"capital":"London","altSpellings":["GB","UK","Great Britain"],"region":"Europe","subregion":"Northern Europe","population":65110000,"latlng":[54.0,-2.0],"demonym":"British","area":242900.0,"gini":34.0,"timezones":["UTC-08:00","UTC-05:00","UTC-04:00","UTC-03:00","UTC-02:00","UTC","UTC+01:00","UTC+02:00","UTC+06:00"],"borders":["IRL"],"nativeName":"United Kingdom","numericCode":"826","currencies":[{"code":"GBP","name":"British pound","symbol":"£"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Vereinigtes Königreich","es":"Reino Unido","fr":"Royaume-Uni","ja":"イギリス","it":"Regno Unito","br":"Reino Unido","pt":"Reino Unido","nl":"Verenigd Koninkrijk","hr":"Ujedinjeno Kraljevstvo","fa":"بریتانیای کبیر و ایرلند شمالی"},"flag":"https://restcountries.eu/data/gbr.svg","regionalBlocs":[{"acronym":"EU","name":"European Union","otherAcronyms":[],"otherNames":[]}],"cioc":"GBR"} +{"name":"United States of America","topLevelDomain":[".us"],"alpha2Code":"US","alpha3Code":"USA","callingCodes":["1"],"capital":"Washington, D.C.","altSpellings":["US","USA","United States of America"],"region":"Americas","subregion":"Northern America","population":323947000,"latlng":[38.0,-97.0],"demonym":"American","area":9629091.0,"gini":48.0,"timezones":["UTC-12:00","UTC-11:00","UTC-10:00","UTC-09:00","UTC-08:00","UTC-07:00","UTC-06:00","UTC-05:00","UTC-04:00","UTC+10:00","UTC+12:00"],"borders":["CAN","MEX"],"nativeName":"United States","numericCode":"840","currencies":[{"code":"USD","name":"United States dollar","symbol":"$"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Vereinigte Staaten von Amerika","es":"Estados Unidos","fr":"États-Unis","ja":"アメリカ合衆国","it":"Stati Uniti D'America","br":"Estados Unidos","pt":"Estados Unidos","nl":"Verenigde Staten","hr":"Sjedinjene Američke Države","fa":"ایالات متحده آمریکا"},"flag":"https://restcountries.eu/data/usa.svg","regionalBlocs":[{"acronym":"NAFTA","name":"North American Free Trade Agreement","otherAcronyms":[],"otherNames":["Tratado de Libre Comercio de América del Norte","Accord de Libre-échange Nord-Américain"]}],"cioc":"USA"} +{"name":"Uruguay","topLevelDomain":[".uy"],"alpha2Code":"UY","alpha3Code":"URY","callingCodes":["598"],"capital":"Montevideo","altSpellings":["UY","Oriental Republic of Uruguay","República Oriental del Uruguay"],"region":"Americas","subregion":"South America","population":3480222,"latlng":[-33.0,-56.0],"demonym":"Uruguayan","area":181034.0,"gini":39.7,"timezones":["UTC-03:00"],"borders":["ARG","BRA"],"nativeName":"Uruguay","numericCode":"858","currencies":[{"code":"UYU","name":"Uruguayan peso","symbol":"$"}],"languages":[{"iso639_1":"es","iso639_2":"spa","name":"Spanish","nativeName":"Español"}],"translations":{"de":"Uruguay","es":"Uruguay","fr":"Uruguay","ja":"ウルグアイ","it":"Uruguay","br":"Uruguai","pt":"Uruguai","nl":"Uruguay","hr":"Urugvaj","fa":"اروگوئه"},"flag":"https://restcountries.eu/data/ury.svg","regionalBlocs":[{"acronym":"USAN","name":"Union of South American Nations","otherAcronyms":["UNASUR","UNASUL","UZAN"],"otherNames":["Unión de Naciones Suramericanas","União de Nações Sul-Americanas","Unie van Zuid-Amerikaanse Naties","South American Union"]}],"cioc":"URU"} +{"name":"Uzbekistan","topLevelDomain":[".uz"],"alpha2Code":"UZ","alpha3Code":"UZB","callingCodes":["998"],"capital":"Tashkent","altSpellings":["UZ","Republic of Uzbekistan","O‘zbekiston Respublikasi","Ўзбекистон Республикаси"],"region":"Asia","subregion":"Central Asia","population":31576400,"latlng":[41.0,64.0],"demonym":"Uzbekistani","area":447400.0,"gini":36.7,"timezones":["UTC+05:00"],"borders":["AFG","KAZ","KGZ","TJK","TKM"],"nativeName":"O‘zbekiston","numericCode":"860","currencies":[{"code":"UZS","name":"Uzbekistani so'm","symbol":null}],"languages":[{"iso639_1":"uz","iso639_2":"uzb","name":"Uzbek","nativeName":"Oʻzbek"},{"iso639_1":"ru","iso639_2":"rus","name":"Russian","nativeName":"Русский"}],"translations":{"de":"Usbekistan","es":"Uzbekistán","fr":"Ouzbékistan","ja":"ウズベキスタン","it":"Uzbekistan","br":"Uzbequistão","pt":"Usbequistão","nl":"Oezbekistan","hr":"Uzbekistan","fa":"ازبکستان"},"flag":"https://restcountries.eu/data/uzb.svg","regionalBlocs":[],"cioc":"UZB"} +{"name":"Vanuatu","topLevelDomain":[".vu"],"alpha2Code":"VU","alpha3Code":"VUT","callingCodes":["678"],"capital":"Port Vila","altSpellings":["VU","Republic of Vanuatu","Ripablik blong Vanuatu","République de Vanuatu"],"region":"Oceania","subregion":"Melanesia","population":277500,"latlng":[-16.0,167.0],"demonym":"Ni-Vanuatu","area":12189.0,"gini":null,"timezones":["UTC+11:00"],"borders":[],"nativeName":"Vanuatu","numericCode":"548","currencies":[{"code":"VUV","name":"Vanuatu vatu","symbol":"Vt"}],"languages":[{"iso639_1":"bi","iso639_2":"bis","name":"Bislama","nativeName":"Bislama"},{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Vanuatu","es":"Vanuatu","fr":"Vanuatu","ja":"バヌアツ","it":"Vanuatu","br":"Vanuatu","pt":"Vanuatu","nl":"Vanuatu","hr":"Vanuatu","fa":"وانواتو"},"flag":"https://restcountries.eu/data/vut.svg","regionalBlocs":[],"cioc":"VAN"} +{"name":"Venezuela (Bolivarian Republic of)","topLevelDomain":[".ve"],"alpha2Code":"VE","alpha3Code":"VEN","callingCodes":["58"],"capital":"Caracas","altSpellings":["VE","Bolivarian Republic of Venezuela","República Bolivariana de Venezuela"],"region":"Americas","subregion":"South America","population":31028700,"latlng":[8.0,-66.0],"demonym":"Venezuelan","area":916445.0,"gini":44.8,"timezones":["UTC-04:00"],"borders":["BRA","COL","GUY"],"nativeName":"Venezuela","numericCode":"862","currencies":[{"code":"VEF","name":"Venezuelan bolívar","symbol":"Bs F"}],"languages":[{"iso639_1":"es","iso639_2":"spa","name":"Spanish","nativeName":"Español"}],"translations":{"de":"Venezuela","es":"Venezuela","fr":"Venezuela","ja":"ベネズエラ・ボリバル共和国","it":"Venezuela","br":"Venezuela","pt":"Venezuela","nl":"Venezuela","hr":"Venezuela","fa":"ونزوئلا"},"flag":"https://restcountries.eu/data/ven.svg","regionalBlocs":[{"acronym":"USAN","name":"Union of South American Nations","otherAcronyms":["UNASUR","UNASUL","UZAN"],"otherNames":["Unión de Naciones Suramericanas","União de Nações Sul-Americanas","Unie van Zuid-Amerikaanse Naties","South American Union"]}],"cioc":"VEN"} +{"name":"Viet Nam","topLevelDomain":[".vn"],"alpha2Code":"VN","alpha3Code":"VNM","callingCodes":["84"],"capital":"Hanoi","altSpellings":["VN","Socialist Republic of Vietnam","Cộng hòa Xã hội chủ nghĩa Việt Nam"],"region":"Asia","subregion":"South-Eastern Asia","population":92700000,"latlng":[16.16666666,107.83333333],"demonym":"Vietnamese","area":331212.0,"gini":35.6,"timezones":["UTC+07:00"],"borders":["KHM","CHN","LAO"],"nativeName":"Việt Nam","numericCode":"704","currencies":[{"code":"VND","name":"Vietnamese đồng","symbol":"₫"}],"languages":[{"iso639_1":"vi","iso639_2":"vie","name":"Vietnamese","nativeName":"Tiếng Việt"}],"translations":{"de":"Vietnam","es":"Vietnam","fr":"Viêt Nam","ja":"ベトナム","it":"Vietnam","br":"Vietnã","pt":"Vietname","nl":"Vietnam","hr":"Vijetnam","fa":"ویتنام"},"flag":"https://restcountries.eu/data/vnm.svg","regionalBlocs":[{"acronym":"ASEAN","name":"Association of Southeast Asian Nations","otherAcronyms":[],"otherNames":[]}],"cioc":"VIE"} +{"name":"Wallis and Futuna","topLevelDomain":[".wf"],"alpha2Code":"WF","alpha3Code":"WLF","callingCodes":["681"],"capital":"Mata-Utu","altSpellings":["WF","Territory of the Wallis and Futuna Islands","Territoire des îles Wallis et Futuna"],"region":"Oceania","subregion":"Polynesia","population":11750,"latlng":[-13.3,-176.2],"demonym":"Wallis and Futuna Islander","area":142.0,"gini":null,"timezones":["UTC+12:00"],"borders":[],"nativeName":"Wallis et Futuna","numericCode":"876","currencies":[{"code":"XPF","name":"CFP franc","symbol":"Fr"}],"languages":[{"iso639_1":"fr","iso639_2":"fra","name":"French","nativeName":"français"}],"translations":{"de":"Wallis und Futuna","es":"Wallis y Futuna","fr":"Wallis-et-Futuna","ja":"ウォリス・フツナ","it":"Wallis e Futuna","br":"Wallis e Futuna","pt":"Wallis e Futuna","nl":"Wallis en Futuna","hr":"Wallis i Fortuna","fa":"والیس و فوتونا"},"flag":"https://restcountries.eu/data/wlf.svg","regionalBlocs":[],"cioc":""} +{"name":"Western Sahara","topLevelDomain":[".eh"],"alpha2Code":"EH","alpha3Code":"ESH","callingCodes":["212"],"capital":"El Aaiún","altSpellings":["EH","Taneẓroft Tutrimt"],"region":"Africa","subregion":"Northern Africa","population":510713,"latlng":[24.5,-13.0],"demonym":"Sahrawi","area":266000.0,"gini":null,"timezones":["UTC+00:00"],"borders":["DZA","MRT","MAR"],"nativeName":"الصحراء الغربية","numericCode":"732","currencies":[{"code":"MAD","name":"Moroccan dirham","symbol":"د.م."},{"code":"DZD","name":"Algerian dinar","symbol":"د.ج"}],"languages":[{"iso639_1":"es","iso639_2":"spa","name":"Spanish","nativeName":"Español"}],"translations":{"de":"Westsahara","es":"Sahara Occidental","fr":"Sahara Occidental","ja":"西サハラ","it":"Sahara Occidentale","br":"Saara Ocidental","pt":"Saara Ocidental","nl":"Westelijke Sahara","hr":"Zapadna Sahara","fa":"جمهوری دموکراتیک عربی صحرا"},"flag":"https://restcountries.eu/data/esh.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":""} +{"name":"Yemen","topLevelDomain":[".ye"],"alpha2Code":"YE","alpha3Code":"YEM","callingCodes":["967"],"capital":"Sana'a","altSpellings":["YE","Yemeni Republic","al-Jumhūriyyah al-Yamaniyyah"],"region":"Asia","subregion":"Western Asia","population":27478000,"latlng":[15.0,48.0],"demonym":"Yemeni","area":527968.0,"gini":37.7,"timezones":["UTC+03:00"],"borders":["OMN","SAU"],"nativeName":"اليَمَن","numericCode":"887","currencies":[{"code":"YER","name":"Yemeni rial","symbol":"﷼"}],"languages":[{"iso639_1":"ar","iso639_2":"ara","name":"Arabic","nativeName":"العربية"}],"translations":{"de":"Jemen","es":"Yemen","fr":"Yémen","ja":"イエメン","it":"Yemen","br":"Iêmen","pt":"Iémen","nl":"Jemen","hr":"Jemen","fa":"یمن"},"flag":"https://restcountries.eu/data/yem.svg","regionalBlocs":[{"acronym":"AL","name":"Arab League","otherAcronyms":[],"otherNames":["جامعة الدول العربية","Jāmiʻat ad-Duwal al-ʻArabīyah","League of Arab States"]}],"cioc":"YEM"} +{"name":"Zambia","topLevelDomain":[".zm"],"alpha2Code":"ZM","alpha3Code":"ZMB","callingCodes":["260"],"capital":"Lusaka","altSpellings":["ZM","Republic of Zambia"],"region":"Africa","subregion":"Eastern Africa","population":15933883,"latlng":[-15.0,30.0],"demonym":"Zambian","area":752612.0,"gini":54.6,"timezones":["UTC+02:00"],"borders":["AGO","BWA","COD","MWI","MOZ","NAM","TZA","ZWE"],"nativeName":"Zambia","numericCode":"894","currencies":[{"code":"ZMW","name":"Zambian kwacha","symbol":"ZK"}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"}],"translations":{"de":"Sambia","es":"Zambia","fr":"Zambie","ja":"ザンビア","it":"Zambia","br":"Zâmbia","pt":"Zâmbia","nl":"Zambia","hr":"Zambija","fa":"زامبیا"},"flag":"https://restcountries.eu/data/zmb.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"ZAM"} +{"name":"Zimbabwe","topLevelDomain":[".zw"],"alpha2Code":"ZW","alpha3Code":"ZWE","callingCodes":["263"],"capital":"Harare","altSpellings":["ZW","Republic of Zimbabwe"],"region":"Africa","subregion":"Eastern Africa","population":14240168,"latlng":[-20.0,30.0],"demonym":"Zimbabwean","area":390757.0,"gini":null,"timezones":["UTC+02:00"],"borders":["BWA","MOZ","ZAF","ZMB"],"nativeName":"Zimbabwe","numericCode":"716","currencies":[{"code":"BWP","name":"Botswana pula","symbol":"P"},{"code":"GBP","name":"British pound","symbol":"£"},{"code":"CNY","name":"Chinese yuan","symbol":"¥"},{"code":"EUR","name":"Euro","symbol":"€"},{"code":"INR","name":"Indian rupee","symbol":"₹"},{"code":"JPY","name":"Japanese yen","symbol":"¥"},{"code":"ZAR","name":"South African rand","symbol":"Rs"},{"code":"USD","name":"United States dollar","symbol":"$"},{"code":"(none)","name":null,"symbol":null}],"languages":[{"iso639_1":"en","iso639_2":"eng","name":"English","nativeName":"English"},{"iso639_1":"sn","iso639_2":"sna","name":"Shona","nativeName":"chiShona"},{"iso639_1":"nd","iso639_2":"nde","name":"Northern Ndebele","nativeName":"isiNdebele"}],"translations":{"de":"Simbabwe","es":"Zimbabue","fr":"Zimbabwe","ja":"ジンバブエ","it":"Zimbabwe","br":"Zimbabwe","pt":"Zimbabué","nl":"Zimbabwe","hr":"Zimbabve","fa":"زیمباوه"},"flag":"https://restcountries.eu/data/zwe.svg","regionalBlocs":[{"acronym":"AU","name":"African Union","otherAcronyms":[],"otherNames":["الاتحاد الأفريقي","Union africaine","União Africana","Unión Africana","Umoja wa Afrika"]}],"cioc":"ZIM"} \ No newline at end of file diff --git a/persistence-modules/jnosql/jnosql-diana/pom.xml b/persistence-modules/jnosql/jnosql-diana/pom.xml index 22e066d36d..79c455646c 100644 --- a/persistence-modules/jnosql/jnosql-diana/pom.xml +++ b/persistence-modules/jnosql/jnosql-diana/pom.xml @@ -55,7 +55,7 @@ org.codehaus.mojo exec-maven-plugin - 1.6.0 + ${exec-maven-plugin.version} document diff --git a/persistence-modules/jnosql/pom.xml b/persistence-modules/jnosql/pom.xml index b96722de18..fb7ac72b05 100644 --- a/persistence-modules/jnosql/pom.xml +++ b/persistence-modules/jnosql/pom.xml @@ -11,9 +11,8 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ @@ -22,8 +21,6 @@ - 1.8 - 1.8 0.0.5 diff --git a/persistence-modules/jpa-hibernate-cascade-type/pom.xml b/persistence-modules/jpa-hibernate-cascade-type/pom.xml index a545723746..1fc119592c 100644 --- a/persistence-modules/jpa-hibernate-cascade-type/pom.xml +++ b/persistence-modules/jpa-hibernate-cascade-type/pom.xml @@ -4,13 +4,10 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 jpa-hibernate-cascade-type - 1.0.0-SNAPSHOT - com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ @@ -48,24 +45,12 @@ - - jpa-hibernate-cascade-type - - - src/test/resources - true - - - - 5.4.3.Final 3.12.2 6.0.17.Final 3.0.0 3.0.1-b11 - 1.8 - 1.8 \ No newline at end of file diff --git a/persistence-modules/liquibase/pom.xml b/persistence-modules/liquibase/pom.xml index 39e86b5186..af1af2259e 100644 --- a/persistence-modules/liquibase/pom.xml +++ b/persistence-modules/liquibase/pom.xml @@ -7,9 +7,8 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ diff --git a/persistence-modules/orientdb/pom.xml b/persistence-modules/orientdb/pom.xml index 7b0bef7fc5..5b28fb01b0 100644 --- a/persistence-modules/orientdb/pom.xml +++ b/persistence-modules/orientdb/pom.xml @@ -10,9 +10,8 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ diff --git a/persistence-modules/persistence-libraries/pom.xml b/persistence-modules/persistence-libraries/pom.xml index 74ff262637..a72654f2aa 100644 --- a/persistence-modules/persistence-libraries/pom.xml +++ b/persistence-modules/persistence-libraries/pom.xml @@ -10,7 +10,6 @@ com.baeldung persistence-modules 1.0.0-SNAPSHOT - .. @@ -25,30 +24,10 @@ ${hsqldb.version} test - - junit - junit - ${junit.version} - test - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 8 - 8 - - - - - 2.4.0 - 4.12 1.6.0 diff --git a/persistence-modules/pom.xml b/persistence-modules/pom.xml index c0f7c07b70..15b62d5d77 100644 --- a/persistence-modules/pom.xml +++ b/persistence-modules/pom.xml @@ -10,7 +10,6 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - .. @@ -42,7 +41,7 @@ redis solr - spring-boot-jdbi + spring-boot-persistence-2 spring-boot-mysql spring-boot-persistence spring-boot-persistence-h2 diff --git a/persistence-modules/querydsl/pom.xml b/persistence-modules/querydsl/pom.xml index 690e65d737..9f6802ff77 100644 --- a/persistence-modules/querydsl/pom.xml +++ b/persistence-modules/querydsl/pom.xml @@ -6,13 +6,11 @@ 0.1-SNAPSHOT querydsl jar - http://maven.apache.org com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ diff --git a/persistence-modules/redis/pom.xml b/persistence-modules/redis/pom.xml index c4a928bb4a..fffcfbb96b 100644 --- a/persistence-modules/redis/pom.xml +++ b/persistence-modules/redis/pom.xml @@ -9,9 +9,8 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ @@ -38,7 +37,7 @@ - 2.9.0 + 3.2.0 0.6 3.3.0 5.0.1.RELEASE diff --git a/persistence-modules/redis/src/main/java/com/baeldung/redis_scan/client/RedisClient.java b/persistence-modules/redis/src/main/java/com/baeldung/redis_scan/client/RedisClient.java new file mode 100644 index 0000000000..2fe7a787e0 --- /dev/null +++ b/persistence-modules/redis/src/main/java/com/baeldung/redis_scan/client/RedisClient.java @@ -0,0 +1,149 @@ +package com.baeldung.redis_scan.client; + +import com.baeldung.redis_scan.iterator.RedisIterator; +import com.baeldung.redis_scan.strategy.ScanStrategy; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import redis.clients.jedis.Jedis; +import redis.clients.jedis.JedisPool; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.*; + +public class RedisClient { + private static Logger log = LoggerFactory.getLogger(RedisClient.class); + + private static volatile RedisClient instance = null; + + private static JedisPool jedisPool; + + public static RedisClient getInstance(String ip, final int port) { + if (instance == null) { + synchronized (RedisClient.class) { + if (instance == null) { + instance = new RedisClient(ip, port); + } + } + } + return instance; + } + + private RedisClient(String ip, int port) { + try { + if (jedisPool == null) { + jedisPool = new JedisPool(new URI("http://" + ip + ":" + port)); + } + } catch (URISyntaxException e) { + log.error("Malformed server address", e); + } + } + + public Long lpush(final String key, final String[] strings) { + try (Jedis jedis = jedisPool.getResource()) { + return jedis.lpush(key, strings); + } catch (Exception ex) { + log.error("Exception caught in lpush", ex); + } + return null; + } + + public List lrange(final String key, final long start, final long stop) { + try (Jedis jedis = jedisPool.getResource()) { + return jedis.lrange(key, start, stop); + } catch (Exception ex) { + log.error("Exception caught in lrange", ex); + } + return new LinkedList(); + } + + public String hmset(final String key, final Map hash) { + try (Jedis jedis = jedisPool.getResource()) { + return jedis.hmset(key, hash); + } catch (Exception ex) { + log.error("Exception caught in hmset", ex); + } + return null; + } + + public Map hgetAll(final String key) { + try (Jedis jedis = jedisPool.getResource()) { + return jedis.hgetAll(key); + } catch (Exception ex) { + log.error("Exception caught in hgetAll", ex); + } + return new HashMap(); + } + + public Long sadd(final String key, final String... members) { + try (Jedis jedis = jedisPool.getResource()) { + return jedis.sadd(key, members); + } catch (Exception ex) { + log.error("Exception caught in sadd", ex); + } + return null; + } + + public Set smembers(final String key) { + try (Jedis jedis = jedisPool.getResource()) { + return jedis.smembers(key); + } catch (Exception ex) { + log.error("Exception caught in smembers", ex); + } + return new HashSet(); + } + + public Long zadd(final String key, final Map scoreMembers) { + try (Jedis jedis = jedisPool.getResource()) { + return jedis.zadd(key, scoreMembers); + } catch (Exception ex) { + log.error("Exception caught in zadd", ex); + } + return 0L; + } + + public Set zrange(final String key, final long start, final long stop) { + try (Jedis jedis = jedisPool.getResource()) { + return jedis.zrange(key, start, stop); + } catch (Exception ex) { + log.error("Exception caught in zrange", ex); + } + return new HashSet(); + } + + public String mset(final HashMap keysValues) { + try (Jedis jedis = jedisPool.getResource()) { + ArrayList keysValuesArrayList = new ArrayList(); + keysValues.forEach((key, value) -> { + keysValuesArrayList.add(key); + keysValuesArrayList.add(value); + }); + return jedis.mset((keysValuesArrayList.toArray(new String[keysValues.size()]))); + } catch (Exception ex) { + log.error("Exception caught in mset", ex); + } + return null; + } + + public Set keys(final String pattern) { + try (Jedis jedis = jedisPool.getResource()) { + return jedis.keys(pattern); + } catch (Exception ex) { + log.error("Exception caught in keys", ex); + } + return new HashSet(); + } + + public RedisIterator iterator(int initialScanCount, String pattern, ScanStrategy strategy) { + return new RedisIterator(jedisPool, initialScanCount, pattern, strategy); + } + + public void flushAll() { + try (Jedis jedis = jedisPool.getResource()) { + jedis.flushAll(); + } catch (Exception ex) { + log.error("Exception caught in flushAll", ex); + } + } + +} diff --git a/persistence-modules/redis/src/main/java/com/baeldung/redis_scan/iterator/RedisIterator.java b/persistence-modules/redis/src/main/java/com/baeldung/redis_scan/iterator/RedisIterator.java new file mode 100644 index 0000000000..5fbd798ac2 --- /dev/null +++ b/persistence-modules/redis/src/main/java/com/baeldung/redis_scan/iterator/RedisIterator.java @@ -0,0 +1,60 @@ +package com.baeldung.redis_scan.iterator; + +import com.baeldung.redis_scan.strategy.ScanStrategy; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import redis.clients.jedis.Jedis; +import redis.clients.jedis.JedisPool; +import redis.clients.jedis.ScanParams; +import redis.clients.jedis.ScanResult; + +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +public class RedisIterator implements Iterator> { + + private static Logger log = LoggerFactory.getLogger(RedisIterator.class); + private static final int DEFAULT_SCAN_COUNT = 10; + + private final JedisPool jedisPool; + private ScanParams scanParams; + private String cursor; + private ScanStrategy strategy; + + public RedisIterator(JedisPool jedisPool, int initialScanCount, String pattern, ScanStrategy strategy) { + super(); + this.jedisPool = jedisPool; + this.scanParams = new ScanParams().match(pattern).count(initialScanCount); + this.strategy = strategy; + } + + public RedisIterator(JedisPool jedisPool, String pattern, ScanStrategy strategy) { + super(); + this.jedisPool = jedisPool; + this.scanParams = new ScanParams().match(pattern).count(DEFAULT_SCAN_COUNT); + this.strategy = strategy; + } + + @Override + public boolean hasNext() { + return !"0".equals(cursor); + } + + @Override + public List next() { + if (cursor == null) { + cursor = "0"; + } + try (Jedis jedis = jedisPool.getResource()) { + ScanResult scanResult = strategy.scan(jedis, cursor, scanParams); + cursor = scanResult.getCursor(); + return scanResult.getResult(); + + } catch (Exception ex) { + log.error("Exception caught in next()", ex); + } + return new LinkedList(); + } + +} diff --git a/persistence-modules/redis/src/main/java/com/baeldung/redis_scan/strategy/ScanStrategy.java b/persistence-modules/redis/src/main/java/com/baeldung/redis_scan/strategy/ScanStrategy.java new file mode 100644 index 0000000000..39d9e44a63 --- /dev/null +++ b/persistence-modules/redis/src/main/java/com/baeldung/redis_scan/strategy/ScanStrategy.java @@ -0,0 +1,9 @@ +package com.baeldung.redis_scan.strategy; + +import redis.clients.jedis.Jedis; +import redis.clients.jedis.ScanParams; +import redis.clients.jedis.ScanResult; + +public interface ScanStrategy { + ScanResult scan(Jedis jedis, String cursor, ScanParams scanParams); +} diff --git a/persistence-modules/redis/src/main/java/com/baeldung/redis_scan/strategy/impl/Hscan.java b/persistence-modules/redis/src/main/java/com/baeldung/redis_scan/strategy/impl/Hscan.java new file mode 100644 index 0000000000..fd5ecd14ec --- /dev/null +++ b/persistence-modules/redis/src/main/java/com/baeldung/redis_scan/strategy/impl/Hscan.java @@ -0,0 +1,25 @@ +package com.baeldung.redis_scan.strategy.impl; + +import com.baeldung.redis_scan.strategy.ScanStrategy; +import redis.clients.jedis.Jedis; +import redis.clients.jedis.ScanParams; +import redis.clients.jedis.ScanResult; + +import java.util.Map; +import java.util.Map.Entry; + +public class Hscan implements ScanStrategy> { + + private String key; + + public Hscan(String key) { + super(); + this.key = key; + } + + @Override + public ScanResult> scan(Jedis jedis, String cursor, ScanParams scanParams) { + return jedis.hscan(key, cursor, scanParams); + } + +} diff --git a/persistence-modules/redis/src/main/java/com/baeldung/redis_scan/strategy/impl/Scan.java b/persistence-modules/redis/src/main/java/com/baeldung/redis_scan/strategy/impl/Scan.java new file mode 100644 index 0000000000..f28b56e34c --- /dev/null +++ b/persistence-modules/redis/src/main/java/com/baeldung/redis_scan/strategy/impl/Scan.java @@ -0,0 +1,14 @@ +package com.baeldung.redis_scan.strategy.impl; + +import com.baeldung.redis_scan.strategy.ScanStrategy; +import redis.clients.jedis.Jedis; +import redis.clients.jedis.ScanParams; +import redis.clients.jedis.ScanResult; + +public class Scan implements ScanStrategy { + + + public ScanResult scan(Jedis jedis, String cursor, ScanParams scanParams) { + return jedis.scan(cursor, scanParams); + } +} diff --git a/persistence-modules/redis/src/main/java/com/baeldung/redis_scan/strategy/impl/Sscan.java b/persistence-modules/redis/src/main/java/com/baeldung/redis_scan/strategy/impl/Sscan.java new file mode 100644 index 0000000000..ed47f7087e --- /dev/null +++ b/persistence-modules/redis/src/main/java/com/baeldung/redis_scan/strategy/impl/Sscan.java @@ -0,0 +1,29 @@ +package com.baeldung.redis_scan.strategy.impl; + +import com.baeldung.redis_scan.strategy.ScanStrategy; +import redis.clients.jedis.Jedis; +import redis.clients.jedis.ScanParams; +import redis.clients.jedis.ScanResult; + +public class Sscan implements ScanStrategy { + + private String key; + + + public Sscan(String key) { + super(); + this.key = key; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public ScanResult scan(Jedis jedis, String cursor, ScanParams scanParams) { + return jedis.sscan(key, cursor, scanParams); + } +} diff --git a/persistence-modules/redis/src/main/java/com/baeldung/redis_scan/strategy/impl/Zscan.java b/persistence-modules/redis/src/main/java/com/baeldung/redis_scan/strategy/impl/Zscan.java new file mode 100644 index 0000000000..bdffc15883 --- /dev/null +++ b/persistence-modules/redis/src/main/java/com/baeldung/redis_scan/strategy/impl/Zscan.java @@ -0,0 +1,25 @@ +package com.baeldung.redis_scan.strategy.impl; + +import com.baeldung.redis_scan.strategy.ScanStrategy; +import redis.clients.jedis.Jedis; +import redis.clients.jedis.ScanParams; +import redis.clients.jedis.ScanResult; +import redis.clients.jedis.Tuple; + +public class Zscan implements ScanStrategy { + + private String key; + + + public Zscan(String key) { + super(); + this.key = key; + } + + + @Override + public ScanResult scan(Jedis jedis, String cursor, ScanParams scanParams) { + return jedis.zscan(key, cursor, scanParams); + } + +} diff --git a/persistence-modules/redis/src/test/java/com/baeldung/redis_scan/NaiveApproachIntegrationTest.java b/persistence-modules/redis/src/test/java/com/baeldung/redis_scan/NaiveApproachIntegrationTest.java new file mode 100644 index 0000000000..c24b88e20c --- /dev/null +++ b/persistence-modules/redis/src/test/java/com/baeldung/redis_scan/NaiveApproachIntegrationTest.java @@ -0,0 +1,96 @@ +package com.baeldung.redis_scan; + +import com.baeldung.redis_scan.client.RedisClient; +import org.junit.*; +import redis.embedded.RedisServer; + +import java.io.IOException; +import java.net.ServerSocket; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +public class NaiveApproachIntegrationTest { + private static RedisServer redisServer; + private static int port; + private static RedisClient redisClient; + + @BeforeClass + public static void setUp() throws IOException { + + // Take an available port + ServerSocket s = new ServerSocket(0); + port = s.getLocalPort(); + s.close(); + + redisServer = new RedisServer(port); + redisServer.start(); + } + + @AfterClass + public static void destroy() { + if (redisServer.isActive()) + redisServer.stop(); + } + + @Before + public void init() { + if (!redisServer.isActive()) { + redisServer.start(); + } + redisClient = RedisClient.getInstance("127.0.0.1", port); + } + + @After + public void flushAll() { + redisClient.flushAll(); + } + + @Test + public void testKeys() { + HashMap keyValues = new HashMap(); + keyValues.put("balls:cricket", "160"); + keyValues.put("balls:football", "450"); + keyValues.put("balls:volleyball", "270"); + redisClient.mset(keyValues); + Set readKeys = redisClient.keys("ball*"); + Assert.assertEquals(keyValues.size(), readKeys.size()); + + } + + @Test + public void testSmembers() { + HashSet setMembers = new HashSet(); + setMembers.add("cricket_160"); + setMembers.add("football_450"); + setMembers.add("volleyball_270"); + redisClient.sadd("balls", setMembers.toArray(new String[setMembers.size()])); + Set readSetMembers = redisClient.smembers("balls"); + Assert.assertEquals(setMembers.size(), readSetMembers.size()); + } + + @Test + public void testHgetAll() { + HashMap keyValues = new HashMap(); + keyValues.put("balls:cricket", "160"); + keyValues.put("balls:football", "450"); + keyValues.put("balls:volleyball", "270"); + redisClient.hmset("balls", keyValues); + Map readHash = redisClient.hgetAll("balls"); + Assert.assertEquals(keyValues.size(), readHash.size()); + } + + @Test + public void testZRange() { + HashMap scoreMembers = new HashMap(); + scoreMembers.put("cricket", (double) 160); + scoreMembers.put("football", (double) 450); + scoreMembers.put("volleyball", (double) 270); + redisClient.zadd("balls", scoreMembers); + Set readSetMembers = redisClient.zrange("balls", 0, -1); + + Assert.assertEquals(readSetMembers.size(), scoreMembers.size()); + } + +} diff --git a/persistence-modules/redis/src/test/java/com/baeldung/redis_scan/ScanStrategyIntegrationTest.java b/persistence-modules/redis/src/test/java/com/baeldung/redis_scan/ScanStrategyIntegrationTest.java new file mode 100644 index 0000000000..828b7a3183 --- /dev/null +++ b/persistence-modules/redis/src/test/java/com/baeldung/redis_scan/ScanStrategyIntegrationTest.java @@ -0,0 +1,129 @@ +package com.baeldung.redis_scan; + +import com.baeldung.redis_scan.client.RedisClient; +import com.baeldung.redis_scan.iterator.RedisIterator; +import com.baeldung.redis_scan.strategy.ScanStrategy; +import com.baeldung.redis_scan.strategy.impl.Hscan; +import com.baeldung.redis_scan.strategy.impl.Scan; +import com.baeldung.redis_scan.strategy.impl.Sscan; +import com.baeldung.redis_scan.strategy.impl.Zscan; +import org.junit.*; +import redis.clients.jedis.Tuple; +import redis.embedded.RedisServer; + +import java.io.IOException; +import java.net.ServerSocket; +import java.util.*; + + +public class ScanStrategyIntegrationTest { + + private static RedisServer redisServer; + private static int port; + private static RedisClient redisClient; + + @BeforeClass + public static void setUp() throws IOException { + + // Take an available port + ServerSocket s = new ServerSocket(0); + String ip = "127.0.0.1"; + port = s.getLocalPort(); + s.close(); + + redisServer = new RedisServer(port); + redisServer.start(); + } + + @AfterClass + public static void destroy() { + if (redisServer.isActive()) + redisServer.stop(); + } + + @Before + public void init() { + if (!redisServer.isActive()) { + redisServer.start(); + } + redisClient = RedisClient.getInstance("127.0.0.1", port); + } + + @After + public void flushAll() { + redisClient.flushAll(); + } + + @Test + public void testScanStrategy() { + HashMap keyValues = new HashMap(); + keyValues.put("balls:cricket", "160"); + keyValues.put("balls:football", "450"); + keyValues.put("balls:volleyball", "270"); + redisClient.mset(keyValues); + + ScanStrategy scanStrategy = new Scan(); + int iterationCount = 2; + RedisIterator iterator = redisClient.iterator(iterationCount, "ball*", scanStrategy); + List results = new LinkedList(); + while (iterator.hasNext()) { + results.addAll(iterator.next()); + } + Assert.assertEquals(keyValues.size(), results.size()); + } + + @Test + public void testSscanStrategy() { + HashSet setMembers = new HashSet(); + setMembers.add("cricket_160"); + setMembers.add("football_450"); + setMembers.add("volleyball_270"); + redisClient.sadd("balls", setMembers.toArray(new String[setMembers.size()])); + + Sscan scanStrategy = new Sscan("balls"); + int iterationCount = 2; + RedisIterator iterator = redisClient.iterator(iterationCount, "*", scanStrategy); + List results = new LinkedList(); + while (iterator.hasNext()) { + results.addAll(iterator.next()); + } + Assert.assertEquals(setMembers.size(), results.size()); + } + + @Test + public void testHscanStrategy() { + HashMap hash = new HashMap(); + hash.put("cricket", "160"); + hash.put("football", "450"); + hash.put("volleyball", "270"); + redisClient.hmset("balls", hash); + + Hscan scanStrategy = new Hscan("balls"); + int iterationCount = 2; + RedisIterator iterator = redisClient.iterator(iterationCount, "*", scanStrategy); + List> results = new LinkedList>(); + while (iterator.hasNext()) { + results.addAll(iterator.next()); + } + Assert.assertEquals(hash.size(), results.size()); + } + + @Test + public void testZscanStrategy() { + HashMap memberScores = new HashMap(); + memberScores.put("cricket", (double) 160); + memberScores.put("football", (double) 450); + memberScores.put("volleyball", (double) 270); + redisClient.zadd("balls", memberScores); + + Zscan scanStrategy = new Zscan("balls"); + int iterationCount = 2; + RedisIterator iterator = redisClient.iterator(iterationCount, "*", scanStrategy); + List results = new LinkedList(); + while (iterator.hasNext()) { + results.addAll(iterator.next()); + } + Assert.assertEquals(memberScores.size(), results.size()); + } + +} diff --git a/persistence-modules/sirix/README.md b/persistence-modules/sirix/README.md index ab7fb65e44..923b111e7a 100644 --- a/persistence-modules/sirix/README.md +++ b/persistence-modules/sirix/README.md @@ -1,4 +1,3 @@ ## Relevant articles: -- [Introduction to Sirix](https://www.baeldung.com/introduction-to-sirix) - [A Guide to SirixDB](https://www.baeldung.com/sirix) diff --git a/persistence-modules/sirix/pom.xml b/persistence-modules/sirix/pom.xml index ccaec79775..d8e065ec2f 100644 --- a/persistence-modules/sirix/pom.xml +++ b/persistence-modules/sirix/pom.xml @@ -30,7 +30,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.0 + ${compiler.plugin.version} ${maven.release.version} ${project.build.sourceEncoding} @@ -39,7 +39,7 @@ org.ow2.asm asm - 6.1 + ${asm.version} @@ -50,6 +50,8 @@ UTF-8 11 0.9.3 + 3.8.0 + 6.1 diff --git a/persistence-modules/solr/pom.xml b/persistence-modules/solr/pom.xml index 5902d42a82..fd993e0c67 100644 --- a/persistence-modules/solr/pom.xml +++ b/persistence-modules/solr/pom.xml @@ -9,9 +9,8 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ diff --git a/persistence-modules/spring-boot-mysql/pom.xml b/persistence-modules/spring-boot-mysql/pom.xml index e4456b2eaf..9f6ec73522 100644 --- a/persistence-modules/spring-boot-mysql/pom.xml +++ b/persistence-modules/spring-boot-mysql/pom.xml @@ -37,18 +37,7 @@ - - spring-boot-mysql - - - src/main/resources - true - - - - - UTF-8 8.0.12 diff --git a/persistence-modules/spring-boot-jdbi/HELP.md b/persistence-modules/spring-boot-persistence-2/HELP.md similarity index 100% rename from persistence-modules/spring-boot-jdbi/HELP.md rename to persistence-modules/spring-boot-persistence-2/HELP.md diff --git a/persistence-modules/spring-boot-jdbi/README.md b/persistence-modules/spring-boot-persistence-2/README.md similarity index 100% rename from persistence-modules/spring-boot-jdbi/README.md rename to persistence-modules/spring-boot-persistence-2/README.md diff --git a/persistence-modules/spring-boot-jdbi/pom.xml b/persistence-modules/spring-boot-persistence-2/pom.xml similarity index 91% rename from persistence-modules/spring-boot-jdbi/pom.xml rename to persistence-modules/spring-boot-persistence-2/pom.xml index db36185acd..048dd45c7f 100644 --- a/persistence-modules/spring-boot-jdbi/pom.xml +++ b/persistence-modules/spring-boot-persistence-2/pom.xml @@ -3,17 +3,16 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung.boot.jdbi - spring-boot-jdbi + com.baeldung.boot.persistence + spring-boot-persistence-2 0.0.1-SNAPSHOT spring-boot-jdbi Sample SpringBoot JDBI Project com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../pom.xml @@ -21,7 +20,7 @@ org.springframework.boot spring-boot-dependencies - 2.1.8.RELEASE + ${spring.boot.dependencies} pom import @@ -95,8 +94,8 @@ - 1.8 3.9.1 + 2.1.8.RELEASE diff --git a/persistence-modules/spring-boot-jdbi/src/main/java/com/baeldung/boot/jdbi/JdbiConfiguration.java b/persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/boot/jdbi/JdbiConfiguration.java similarity index 100% rename from persistence-modules/spring-boot-jdbi/src/main/java/com/baeldung/boot/jdbi/JdbiConfiguration.java rename to persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/boot/jdbi/JdbiConfiguration.java diff --git a/persistence-modules/spring-boot-jdbi/src/main/java/com/baeldung/boot/jdbi/SpringBootJdbiApplication.java b/persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/boot/jdbi/SpringBootJdbiApplication.java similarity index 100% rename from persistence-modules/spring-boot-jdbi/src/main/java/com/baeldung/boot/jdbi/SpringBootJdbiApplication.java rename to persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/boot/jdbi/SpringBootJdbiApplication.java diff --git a/persistence-modules/spring-boot-jdbi/src/main/java/com/baeldung/boot/jdbi/dao/CarMakerDao.java b/persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/boot/jdbi/dao/CarMakerDao.java similarity index 100% rename from persistence-modules/spring-boot-jdbi/src/main/java/com/baeldung/boot/jdbi/dao/CarMakerDao.java rename to persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/boot/jdbi/dao/CarMakerDao.java diff --git a/persistence-modules/spring-boot-jdbi/src/main/java/com/baeldung/boot/jdbi/dao/CarModelDao.java b/persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/boot/jdbi/dao/CarModelDao.java similarity index 100% rename from persistence-modules/spring-boot-jdbi/src/main/java/com/baeldung/boot/jdbi/dao/CarModelDao.java rename to persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/boot/jdbi/dao/CarModelDao.java diff --git a/persistence-modules/spring-boot-jdbi/src/main/java/com/baeldung/boot/jdbi/domain/CarMaker.java b/persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/boot/jdbi/domain/CarMaker.java similarity index 100% rename from persistence-modules/spring-boot-jdbi/src/main/java/com/baeldung/boot/jdbi/domain/CarMaker.java rename to persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/boot/jdbi/domain/CarMaker.java diff --git a/persistence-modules/spring-boot-jdbi/src/main/java/com/baeldung/boot/jdbi/domain/CarModel.java b/persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/boot/jdbi/domain/CarModel.java similarity index 100% rename from persistence-modules/spring-boot-jdbi/src/main/java/com/baeldung/boot/jdbi/domain/CarModel.java rename to persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/boot/jdbi/domain/CarModel.java diff --git a/persistence-modules/spring-boot-jdbi/src/main/java/com/baeldung/boot/jdbi/mapper/CarMakerMapper.java b/persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/boot/jdbi/mapper/CarMakerMapper.java similarity index 100% rename from persistence-modules/spring-boot-jdbi/src/main/java/com/baeldung/boot/jdbi/mapper/CarMakerMapper.java rename to persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/boot/jdbi/mapper/CarMakerMapper.java diff --git a/persistence-modules/spring-boot-jdbi/src/main/java/com/baeldung/boot/jdbi/mapper/CarModelMapper.java b/persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/boot/jdbi/mapper/CarModelMapper.java similarity index 100% rename from persistence-modules/spring-boot-jdbi/src/main/java/com/baeldung/boot/jdbi/mapper/CarModelMapper.java rename to persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/boot/jdbi/mapper/CarModelMapper.java diff --git a/persistence-modules/spring-boot-jdbi/src/main/java/com/baeldung/boot/jdbi/service/CarMakerService.java b/persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/boot/jdbi/service/CarMakerService.java similarity index 100% rename from persistence-modules/spring-boot-jdbi/src/main/java/com/baeldung/boot/jdbi/service/CarMakerService.java rename to persistence-modules/spring-boot-persistence-2/src/main/java/com/baeldung/boot/jdbi/service/CarMakerService.java diff --git a/persistence-modules/spring-boot-jdbi/src/main/resources/application.yml b/persistence-modules/spring-boot-persistence-2/src/main/resources/application.yml similarity index 100% rename from persistence-modules/spring-boot-jdbi/src/main/resources/application.yml rename to persistence-modules/spring-boot-persistence-2/src/main/resources/application.yml diff --git a/persistence-modules/spring-boot-jdbi/src/main/resources/com/baeldung/boot/jdbi/dao/CarMakerDao/findById.sql b/persistence-modules/spring-boot-persistence-2/src/main/resources/com/baeldung/boot/jdbi/dao/CarMakerDao/findById.sql similarity index 100% rename from persistence-modules/spring-boot-jdbi/src/main/resources/com/baeldung/boot/jdbi/dao/CarMakerDao/findById.sql rename to persistence-modules/spring-boot-persistence-2/src/main/resources/com/baeldung/boot/jdbi/dao/CarMakerDao/findById.sql diff --git a/persistence-modules/spring-boot-jdbi/src/main/resources/com/baeldung/boot/jdbi/dao/CarMakerDao/insert.sql b/persistence-modules/spring-boot-persistence-2/src/main/resources/com/baeldung/boot/jdbi/dao/CarMakerDao/insert.sql similarity index 100% rename from persistence-modules/spring-boot-jdbi/src/main/resources/com/baeldung/boot/jdbi/dao/CarMakerDao/insert.sql rename to persistence-modules/spring-boot-persistence-2/src/main/resources/com/baeldung/boot/jdbi/dao/CarMakerDao/insert.sql diff --git a/persistence-modules/spring-boot-jdbi/src/main/resources/com/baeldung/boot/jdbi/dao/CarModelDao/findByMakerIdAndSku.sql b/persistence-modules/spring-boot-persistence-2/src/main/resources/com/baeldung/boot/jdbi/dao/CarModelDao/findByMakerIdAndSku.sql similarity index 100% rename from persistence-modules/spring-boot-jdbi/src/main/resources/com/baeldung/boot/jdbi/dao/CarModelDao/findByMakerIdAndSku.sql rename to persistence-modules/spring-boot-persistence-2/src/main/resources/com/baeldung/boot/jdbi/dao/CarModelDao/findByMakerIdAndSku.sql diff --git a/persistence-modules/spring-boot-jdbi/src/main/resources/com/baeldung/boot/jdbi/dao/CarModelDao/insert.sql b/persistence-modules/spring-boot-persistence-2/src/main/resources/com/baeldung/boot/jdbi/dao/CarModelDao/insert.sql similarity index 100% rename from persistence-modules/spring-boot-jdbi/src/main/resources/com/baeldung/boot/jdbi/dao/CarModelDao/insert.sql rename to persistence-modules/spring-boot-persistence-2/src/main/resources/com/baeldung/boot/jdbi/dao/CarModelDao/insert.sql diff --git a/persistence-modules/spring-boot-jdbi/src/test/java/com/baeldung/boot/jdbi/SpringBootJdbiApplicationUnitTest.java b/persistence-modules/spring-boot-persistence-2/src/test/java/com/baeldung/boot/jdbi/SpringBootJdbiApplicationUnitTest.java similarity index 100% rename from persistence-modules/spring-boot-jdbi/src/test/java/com/baeldung/boot/jdbi/SpringBootJdbiApplicationUnitTest.java rename to persistence-modules/spring-boot-persistence-2/src/test/java/com/baeldung/boot/jdbi/SpringBootJdbiApplicationUnitTest.java diff --git a/persistence-modules/spring-boot-jdbi/src/test/resources/data.sql b/persistence-modules/spring-boot-persistence-2/src/test/resources/data.sql similarity index 100% rename from persistence-modules/spring-boot-jdbi/src/test/resources/data.sql rename to persistence-modules/spring-boot-persistence-2/src/test/resources/data.sql diff --git a/persistence-modules/spring-boot-jdbi/src/test/resources/schema.sql b/persistence-modules/spring-boot-persistence-2/src/test/resources/schema.sql similarity index 100% rename from persistence-modules/spring-boot-jdbi/src/test/resources/schema.sql rename to persistence-modules/spring-boot-persistence-2/src/test/resources/schema.sql diff --git a/persistence-modules/spring-boot-persistence-h2/pom.xml b/persistence-modules/spring-boot-persistence-h2/pom.xml index 9a0a72ba23..5b5e255211 100644 --- a/persistence-modules/spring-boot-persistence-h2/pom.xml +++ b/persistence-modules/spring-boot-persistence-h2/pom.xml @@ -5,7 +5,6 @@ 4.0.0 com.baeldung.h2db spring-boot-persistence-h2 - 0.0.1-SNAPSHOT spring-boot-persistence-h2 jar Demo Spring Boot applications that starts H2 in memory database @@ -32,19 +31,7 @@ - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - UTF-8 - UTF-8 - 1.8 com.baeldung.h2db.demo.server.SpringBootApp 2.0.4.RELEASE diff --git a/persistence-modules/spring-boot-persistence-mongodb/pom.xml b/persistence-modules/spring-boot-persistence-mongodb/pom.xml index da48f066f9..de52a4b2d6 100644 --- a/persistence-modules/spring-boot-persistence-mongodb/pom.xml +++ b/persistence-modules/spring-boot-persistence-mongodb/pom.xml @@ -34,80 +34,6 @@ de.flapdoodle.embed.mongo test - - - org.junit.jupiter - junit-jupiter-api - test - - - org.junit.jupiter - junit-jupiter-engine - test - - - - - org.junit.platform - junit-platform-launcher - ${junit-platform.version} - test - - - org.springframework.boot - spring-boot-starter-test - test - - - spring-boot-persistence-mongodb - - - src/main/resources - true - - - - - org.apache.maven.plugins - maven-war-plugin - - - - - - - autoconfiguration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - **/*IntegrationTest.java - **/*IntTest.java - - - - - - - json - - - - - - - - - + \ No newline at end of file diff --git a/persistence-modules/spring-boot-persistence/pom.xml b/persistence-modules/spring-boot-persistence/pom.xml index 049e7225ac..c58e8dbf86 100644 --- a/persistence-modules/spring-boot-persistence/pom.xml +++ b/persistence-modules/spring-boot-persistence/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-boot-persistence 0.1.0 @@ -17,17 +18,14 @@ 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 @@ -38,7 +36,6 @@ org.springframework.boot spring-boot-starter-test - ${spring-boot.version} org.mockito @@ -61,7 +58,6 @@ javax.validation validation-api - ${validation-api.version} org.xerial @@ -70,39 +66,17 @@ org.apache.derby derby - ${derby.version} org.hsqldb hsqldb - ${hsqldb.version} - - spring-boot-persistence - - - src/main/resources - true - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - UTF-8 - 8.0.12 - 9.0.10 2.23.0 2.0.1.Final - 10.13.1.1 - 2.3.4 2.1.7.RELEASE diff --git a/persistence-modules/spring-data-cassandra-reactive/pom.xml b/persistence-modules/spring-data-cassandra-reactive/pom.xml index a57ebbe703..70a5f556e2 100644 --- a/persistence-modules/spring-data-cassandra-reactive/pom.xml +++ b/persistence-modules/spring-data-cassandra-reactive/pom.xml @@ -1,10 +1,8 @@ - + 4.0.0 spring-data-cassandra-reactive - 0.0.1-SNAPSHOT spring-data-cassandra-reactive jar Spring Data Cassandra reactive @@ -20,7 +18,6 @@ org.springframework.data spring-data-cassandra - ${spring-data-cassandra.version} io.projectreactor @@ -54,10 +51,6 @@ - UTF-8 - UTF-8 - - 2.1.2.RELEASE 3.11.2.0 diff --git a/persistence-modules/spring-data-cassandra/pom.xml b/persistence-modules/spring-data-cassandra/pom.xml index 9ea39f3f55..0f0aae4ebf 100644 --- a/persistence-modules/spring-data-cassandra/pom.xml +++ b/persistence-modules/spring-data-cassandra/pom.xml @@ -3,7 +3,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-data-cassandra - 0.0.1-SNAPSHOT spring-data-cassandra jar @@ -80,7 +79,6 @@ 2.1.9.2 2.1.9.2 2.0-0 - 19.0 diff --git a/persistence-modules/spring-data-couchbase-2/pom.xml b/persistence-modules/spring-data-couchbase-2/pom.xml index 56456fc04b..484561ddaa 100644 --- a/persistence-modules/spring-data-couchbase-2/pom.xml +++ b/persistence-modules/spring-data-couchbase-2/pom.xml @@ -11,9 +11,8 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ diff --git a/persistence-modules/spring-data-dynamodb/pom.xml b/persistence-modules/spring-data-dynamodb/pom.xml index 871f99125a..fceceb40ba 100644 --- a/persistence-modules/spring-data-dynamodb/pom.xml +++ b/persistence-modules/spring-data-dynamodb/pom.xml @@ -138,19 +138,7 @@ - spring-data-dynamodb - - - src/main/resources - true - - - - - org.apache.maven.plugins - maven-war-plugin - org.apache.maven.plugins maven-dependency-plugin diff --git a/persistence-modules/spring-data-eclipselink/pom.xml b/persistence-modules/spring-data-eclipselink/pom.xml index bb596d4a8a..4ae43de07a 100644 --- a/persistence-modules/spring-data-eclipselink/pom.xml +++ b/persistence-modules/spring-data-eclipselink/pom.xml @@ -7,9 +7,8 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ diff --git a/persistence-modules/spring-data-elasticsearch/pom.xml b/persistence-modules/spring-data-elasticsearch/pom.xml index ccd2f94e59..3446528323 100644 --- a/persistence-modules/spring-data-elasticsearch/pom.xml +++ b/persistence-modules/spring-data-elasticsearch/pom.xml @@ -2,7 +2,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-data-elasticsearch - 0.0.1-SNAPSHOT spring-data-elasticsearch jar @@ -89,8 +88,6 @@ - 1.8 - 1.8 3.0.8.RELEASE 4.5.2 5.6.0 diff --git a/persistence-modules/spring-data-gemfire/pom.xml b/persistence-modules/spring-data-gemfire/pom.xml index 6bd689192c..a0cc4d5360 100644 --- a/persistence-modules/spring-data-gemfire/pom.xml +++ b/persistence-modules/spring-data-gemfire/pom.xml @@ -8,9 +8,8 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ diff --git a/persistence-modules/spring-data-geode/pom.xml b/persistence-modules/spring-data-geode/pom.xml index 2a9cbe35e9..557d09376a 100644 --- a/persistence-modules/spring-data-geode/pom.xml +++ b/persistence-modules/spring-data-geode/pom.xml @@ -9,16 +9,15 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ org.springframework.boot spring-boot-starter - 2.1.9.RELEASE + ${spring.boot.starter.version} org.springframework.boot @@ -89,6 +88,7 @@ UTF-8 com.baeldung.springdatageode.app.ClientCacheApp 1.1.1.RELEASE + 2.1.9.RELEASE \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-3/pom.xml b/persistence-modules/spring-data-jpa-3/pom.xml index 8a949b3008..d02d089ba3 100644 --- a/persistence-modules/spring-data-jpa-3/pom.xml +++ b/persistence-modules/spring-data-jpa-3/pom.xml @@ -52,34 +52,6 @@ runtime - - - org.springframework.boot - spring-boot-starter-test - test - - - junit - junit - - - - - org.junit.jupiter - junit-jupiter-api - test - - - org.junit.jupiter - junit-jupiter-engine - test - - - org.junit.platform - junit-platform-launcher - test - - org.testcontainers @@ -94,9 +66,6 @@ 1.4.1 21.0 1.12.2 - 42.2.8 - 1.12.2 - 1.4.200 diff --git a/persistence-modules/spring-data-jpa-3/src/test/java/com/baeldung/boot/daos/UserRepositoryCommon.java b/persistence-modules/spring-data-jpa-3/src/test/java/com/baeldung/boot/daos/UserRepositoryCommon.java index 17ee6a94ba..b2581b8034 100644 --- a/persistence-modules/spring-data-jpa-3/src/test/java/com/baeldung/boot/daos/UserRepositoryCommon.java +++ b/persistence-modules/spring-data-jpa-3/src/test/java/com/baeldung/boot/daos/UserRepositoryCommon.java @@ -266,7 +266,7 @@ public class UserRepositoryCommon { userRepository.save(new User(USER_NAME_PETER, LocalDate.now(), USER_EMAIL2, ACTIVE_STATUS)); userRepository.save(new User("SAMPLE", LocalDate.now(), USER_EMAIL3, INACTIVE_STATUS)); - List usersSortByName = userRepository.findAll(new Sort(Sort.Direction.ASC, "name")); + List usersSortByName = userRepository.findAll(Sort.by(Sort.Direction.ASC, "name")); assertThat(usersSortByName.get(0) .getName()).isEqualTo(USER_NAME_ADAM); @@ -278,7 +278,7 @@ public class UserRepositoryCommon { userRepository.save(new User(USER_NAME_PETER, LocalDate.now(), USER_EMAIL2, ACTIVE_STATUS)); userRepository.save(new User("SAMPLE", LocalDate.now(), USER_EMAIL3, INACTIVE_STATUS)); - userRepository.findAll(new Sort(Sort.Direction.ASC, "name")); + userRepository.findAll(Sort.by(Sort.Direction.ASC, "name")); List usersSortByNameLength = userRepository.findAll(Sort.by("LENGTH(name)")); diff --git a/persistence-modules/spring-data-jpa-4/pom.xml b/persistence-modules/spring-data-jpa-4/pom.xml index 44b7c3c268..e0b441231e 100644 --- a/persistence-modules/spring-data-jpa-4/pom.xml +++ b/persistence-modules/spring-data-jpa-4/pom.xml @@ -27,12 +27,6 @@ com.h2database h2 - - - org.springframework.boot - spring-boot-starter-test - test - \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-4/src/main/java/com/baeldung/elementcollection/ElementCollectionApplication.java b/persistence-modules/spring-data-jpa-4/src/main/java/com/baeldung/elementcollection/ElementCollectionApplication.java new file mode 100644 index 0000000000..3f152a6ffc --- /dev/null +++ b/persistence-modules/spring-data-jpa-4/src/main/java/com/baeldung/elementcollection/ElementCollectionApplication.java @@ -0,0 +1,11 @@ +package com.baeldung.elementcollection; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class ElementCollectionApplication { + public static void main(String[] args) { + SpringApplication.run(ElementCollectionApplication.class, args); + } +} diff --git a/persistence-modules/spring-data-jpa-4/src/main/java/com/baeldung/elementcollection/model/Employee.java b/persistence-modules/spring-data-jpa-4/src/main/java/com/baeldung/elementcollection/model/Employee.java new file mode 100644 index 0000000000..8b98164d63 --- /dev/null +++ b/persistence-modules/spring-data-jpa-4/src/main/java/com/baeldung/elementcollection/model/Employee.java @@ -0,0 +1,68 @@ +package com.baeldung.elementcollection.model; + +import javax.persistence.*; +import java.util.List; +import java.util.Objects; + +@Entity +public class Employee { + @Id + private int id; + private String name; + @ElementCollection + @CollectionTable(name = "employee_phone", joinColumns = @JoinColumn(name = "employee_id")) + private List phones; + + public Employee() { + } + + public Employee(int id) { + this.id = id; + } + + public Employee(int id, String name) { + this.id = id; + this.name = name; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public List getPhones() { + return phones; + } + + public void setPhones(List phones) { + this.phones = phones; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof Employee)) { + return false; + } + Employee user = (Employee) o; + return getId() == user.getId(); + } + + @Override + public int hashCode() { + return Objects.hash(getId()); + } +} diff --git a/persistence-modules/spring-data-jpa-4/src/main/java/com/baeldung/elementcollection/model/Phone.java b/persistence-modules/spring-data-jpa-4/src/main/java/com/baeldung/elementcollection/model/Phone.java new file mode 100644 index 0000000000..d73d30c47a --- /dev/null +++ b/persistence-modules/spring-data-jpa-4/src/main/java/com/baeldung/elementcollection/model/Phone.java @@ -0,0 +1,62 @@ +package com.baeldung.elementcollection.model; + +import javax.persistence.Embeddable; +import java.util.Objects; + +@Embeddable +public class Phone { + private String type; + private String areaCode; + private String number; + + public Phone() { + } + + public Phone(String type, String areaCode, String number) { + this.type = type; + this.areaCode = areaCode; + this.number = number; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getAreaCode() { + return areaCode; + } + + public void setAreaCode(String areaCode) { + this.areaCode = areaCode; + } + + public String getNumber() { + return number; + } + + public void setNumber(String number) { + this.number = number; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof Phone)) { + return false; + } + Phone phone = (Phone) o; + return getType().equals(phone.getType()) && getAreaCode().equals(phone.getAreaCode()) + && getNumber().equals(phone.getNumber()); + } + + @Override + public int hashCode() { + return Objects.hash(getType(), getAreaCode(), getNumber()); + } +} diff --git a/persistence-modules/spring-data-jpa-4/src/main/java/com/baeldung/elementcollection/repository/EmployeeRepository.java b/persistence-modules/spring-data-jpa-4/src/main/java/com/baeldung/elementcollection/repository/EmployeeRepository.java new file mode 100644 index 0000000000..49180c35eb --- /dev/null +++ b/persistence-modules/spring-data-jpa-4/src/main/java/com/baeldung/elementcollection/repository/EmployeeRepository.java @@ -0,0 +1,46 @@ +package com.baeldung.elementcollection.repository; + +import com.baeldung.elementcollection.model.Employee; +import org.springframework.stereotype.Repository; +import org.springframework.transaction.annotation.Transactional; + +import javax.persistence.EntityGraph; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; +import java.util.HashMap; +import java.util.Map; + +@Repository +public class EmployeeRepository { + + @PersistenceContext + private EntityManager em; + + @Transactional + public void save(Employee employee) { + em.persist(employee); + } + + @Transactional + public void remove(int id) { + Employee employee = findById(id); + em.remove(employee); + } + + public Employee findById(int id) { + return em.find(Employee.class, id); + } + + public Employee findByJPQL(int id) { + return em.createQuery("SELECT u FROM Employee AS u JOIN FETCH u.phones WHERE u.id=:id", Employee.class) + .setParameter("id", id).getSingleResult(); + } + + public Employee findByEntityGraph(int id) { + EntityGraph entityGraph = em.createEntityGraph(Employee.class); + entityGraph.addAttributeNodes("name", "phones"); + Map properties = new HashMap<>(); + properties.put("javax.persistence.fetchgraph", entityGraph); + return em.find(Employee.class, id, properties); + } +} diff --git a/persistence-modules/spring-data-jpa-4/src/main/java/com/baeldung/lifecycleevents/SpringBootLifecycleEventApplication.java b/persistence-modules/spring-data-jpa-4/src/main/java/com/baeldung/lifecycleevents/SpringBootLifecycleEventApplication.java new file mode 100644 index 0000000000..fbc861c5fe --- /dev/null +++ b/persistence-modules/spring-data-jpa-4/src/main/java/com/baeldung/lifecycleevents/SpringBootLifecycleEventApplication.java @@ -0,0 +1,11 @@ +package com.baeldung.lifecycleevents; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class SpringBootLifecycleEventApplication { + public static void main(String[] args) { + SpringApplication.run(SpringBootLifecycleEventApplication.class, args); + } +} diff --git a/persistence-modules/spring-data-jpa-4/src/main/java/com/baeldung/lifecycleevents/model/AuditTrailListener.java b/persistence-modules/spring-data-jpa-4/src/main/java/com/baeldung/lifecycleevents/model/AuditTrailListener.java new file mode 100644 index 0000000000..26ebff42e4 --- /dev/null +++ b/persistence-modules/spring-data-jpa-4/src/main/java/com/baeldung/lifecycleevents/model/AuditTrailListener.java @@ -0,0 +1,39 @@ +package com.baeldung.lifecycleevents.model; + +import javax.persistence.PostLoad; +import javax.persistence.PostPersist; +import javax.persistence.PostRemove; +import javax.persistence.PostUpdate; +import javax.persistence.PrePersist; +import javax.persistence.PreRemove; +import javax.persistence.PreUpdate; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +public class AuditTrailListener { + private static Log log = LogFactory.getLog(AuditTrailListener.class); + + @PrePersist + @PreUpdate + @PreRemove + private void beforeAnyUpdate(User user) { + if (user.getId() == 0) { + log.info("[USER AUDIT] About to add a user"); + } else { + log.info("[USER AUDIT] About to update/delete user: " + user.getId()); + } + } + + @PostPersist + @PostUpdate + @PostRemove + private void afterAnyUpdate(User user) { + log.info("[USER AUDIT] add/update/delete complete for user: " + user.getId()); + } + + @PostLoad + private void afterLoad(User user) { + log.info("[USER AUDIT] user loaded from database: " + user.getId()); + } +} diff --git a/persistence-modules/spring-data-jpa-4/src/main/java/com/baeldung/lifecycleevents/model/User.java b/persistence-modules/spring-data-jpa-4/src/main/java/com/baeldung/lifecycleevents/model/User.java new file mode 100644 index 0000000000..a080cb3bf2 --- /dev/null +++ b/persistence-modules/spring-data-jpa-4/src/main/java/com/baeldung/lifecycleevents/model/User.java @@ -0,0 +1,104 @@ +package com.baeldung.lifecycleevents.model; + +import javax.persistence.Entity; +import javax.persistence.EntityListeners; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.PostLoad; +import javax.persistence.PostPersist; +import javax.persistence.PostRemove; +import javax.persistence.PostUpdate; +import javax.persistence.PrePersist; +import javax.persistence.PreRemove; +import javax.persistence.PreUpdate; +import javax.persistence.Transient; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +@Entity +@EntityListeners(AuditTrailListener.class) +public class User { + private static Log log = LogFactory.getLog(User.class); + + @Id + @GeneratedValue + private int id; + + private String userName; + private String firstName; + private String lastName; + @Transient + private String fullName; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getFullName() { + return fullName; + } + + @PrePersist + public void logNewUserAttempt() { + log.info("Attempting to add new user with username: " + userName); + } + + @PostPersist + public void logNewUserAdded() { + log.info("Added user '" + userName + "' with ID: " + id); + } + + @PreRemove + public void logUserRemovalAttempt() { + log.info("Attempting to delete user: " + userName); + } + + @PostRemove + public void logUserRemoval() { + log.info("Deleted user: " + userName); + } + + @PreUpdate + public void logUserUpdateAttempt() { + log.info("Attempting to update user: " + userName); + } + + @PostUpdate + public void logUserUpdate() { + log.info("Updated user: " + userName); + } + + @PostLoad + public void logUserLoad() { + fullName = firstName + " " + lastName; + } +} diff --git a/persistence-modules/spring-data-jpa-4/src/main/java/com/baeldung/lifecycleevents/repository/UserRepository.java b/persistence-modules/spring-data-jpa-4/src/main/java/com/baeldung/lifecycleevents/repository/UserRepository.java new file mode 100644 index 0000000000..af14117ebb --- /dev/null +++ b/persistence-modules/spring-data-jpa-4/src/main/java/com/baeldung/lifecycleevents/repository/UserRepository.java @@ -0,0 +1,9 @@ +package com.baeldung.lifecycleevents.repository; + +import org.springframework.data.jpa.repository.JpaRepository; + +import com.baeldung.lifecycleevents.model.User; + +public interface UserRepository extends JpaRepository { + public User findByUserName(String userName); +} diff --git a/persistence-modules/spring-data-jpa-4/src/test/java/com/baeldung/elementcollection/ElementCollectionIntegrationTest.java b/persistence-modules/spring-data-jpa-4/src/test/java/com/baeldung/elementcollection/ElementCollectionIntegrationTest.java new file mode 100644 index 0000000000..306798aa68 --- /dev/null +++ b/persistence-modules/spring-data-jpa-4/src/test/java/com/baeldung/elementcollection/ElementCollectionIntegrationTest.java @@ -0,0 +1,64 @@ +package com.baeldung.elementcollection; + +import com.baeldung.elementcollection.model.Employee; +import com.baeldung.elementcollection.model.Phone; +import com.baeldung.elementcollection.repository.EmployeeRepository; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; + +import static org.hamcrest.core.Is.is; +import static org.junit.Assert.assertThat; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = ElementCollectionApplication.class) +public class ElementCollectionIntegrationTest { + + @Autowired + private EmployeeRepository employeeRepository; + + @Before + public void init() { + Employee employee = new Employee(1, "Fred"); + employee.setPhones( + Arrays.asList(new Phone("work", "+55", "99999-9999"), new Phone("home", "+55", "98888-8888"))); + employeeRepository.save(employee); + } + + @After + public void clean() { + employeeRepository.remove(1); + } + + @Test(expected = org.hibernate.LazyInitializationException.class) + public void whenAccessLazyCollection_thenThrowLazyInitializationException() { + Employee employee = employeeRepository.findById(1); + assertThat(employee.getPhones().size(), is(2)); + } + + @Test + public void whenUseJPAQL_thenFetchResult() { + Employee employee = employeeRepository.findByJPQL(1); + assertThat(employee.getPhones().size(), is(2)); + } + + @Test + public void whenUseEntityGraph_thenFetchResult() { + Employee employee = employeeRepository.findByEntityGraph(1); + assertThat(employee.getPhones().size(), is(2)); + } + + @Test + @Transactional + public void whenUseTransaction_thenFetchResult() { + Employee employee = employeeRepository.findById(1); + assertThat(employee.getPhones().size(), is(2)); + } +} diff --git a/persistence-modules/spring-data-jpa-4/src/test/java/lifecycleevents/UserRepositoryIntegrationTest.java b/persistence-modules/spring-data-jpa-4/src/test/java/lifecycleevents/UserRepositoryIntegrationTest.java new file mode 100644 index 0000000000..078f437474 --- /dev/null +++ b/persistence-modules/spring-data-jpa-4/src/test/java/lifecycleevents/UserRepositoryIntegrationTest.java @@ -0,0 +1,80 @@ +package lifecycleevents; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import com.baeldung.lifecycleevents.SpringBootLifecycleEventApplication; +import com.baeldung.lifecycleevents.model.User; +import com.baeldung.lifecycleevents.repository.UserRepository; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = SpringBootLifecycleEventApplication.class) +public class UserRepositoryIntegrationTest { + + @Autowired + private UserRepository userRepository; + + @Before + public void setup() { + User user = new User(); + user.setFirstName("Jane"); + user.setLastName("Smith"); + user.setUserName("jsmith123"); + userRepository.save(user); + } + + @After + public void cleanup() { + userRepository.deleteAll(); + } + + @Test + public void whenNewUserProvided_userIsAdded() { + User user = new User(); + user.setFirstName("John"); + user.setLastName("Doe"); + user.setUserName("jdoe123"); + user = userRepository.save(user); + assertTrue(user.getId() > 0); + } + + @Test + public void whenUserNameProvided_userIsLoaded() { + User user = userRepository.findByUserName("jsmith123"); + assertNotNull(user); + assertEquals("jsmith123", user.getUserName()); + } + + @Test + public void whenExistingUserProvided_userIsUpdated() { + User user = userRepository.findByUserName("jsmith123"); + user.setFirstName("Joe"); + user = userRepository.save(user); + assertEquals("Joe", user.getFirstName()); + } + + @Test + public void whenExistingUserDeleted_userIsDeleted() { + User user = userRepository.findByUserName("jsmith123"); + userRepository.delete(user); + user = userRepository.findByUserName("jsmith123"); + assertNull(user); + } + + @Test + public void whenExistingUserLoaded_fullNameIsAvailable() { + String expectedFullName = "Jane Smith"; + User user = userRepository.findByUserName("jsmith123"); + assertEquals(expectedFullName, user.getFullName()); + } +} diff --git a/persistence-modules/spring-data-jpa/pom.xml b/persistence-modules/spring-data-jpa/pom.xml index 27b8ce5eaf..ddd7e17dcd 100644 --- a/persistence-modules/spring-data-jpa/pom.xml +++ b/persistence-modules/spring-data-jpa/pom.xml @@ -1,7 +1,6 @@ - + 4.0.0 spring-data-jpa spring-data-jpa @@ -43,7 +42,6 @@ org.postgresql postgresql - ${postgresql.version} @@ -67,26 +65,6 @@ guava ${guava.version} - - - - org.junit.jupiter - junit-jupiter-api - test - - - org.junit.jupiter - junit-jupiter-engine - test - - - - - org.junit.platform - junit-platform-launcher - ${junit-platform.version} - test - diff --git a/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/boot/daos/UserRepositoryCommon.java b/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/boot/daos/UserRepositoryCommon.java index 17ee6a94ba..b2581b8034 100644 --- a/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/boot/daos/UserRepositoryCommon.java +++ b/persistence-modules/spring-data-jpa/src/test/java/com/baeldung/boot/daos/UserRepositoryCommon.java @@ -266,7 +266,7 @@ public class UserRepositoryCommon { userRepository.save(new User(USER_NAME_PETER, LocalDate.now(), USER_EMAIL2, ACTIVE_STATUS)); userRepository.save(new User("SAMPLE", LocalDate.now(), USER_EMAIL3, INACTIVE_STATUS)); - List usersSortByName = userRepository.findAll(new Sort(Sort.Direction.ASC, "name")); + List usersSortByName = userRepository.findAll(Sort.by(Sort.Direction.ASC, "name")); assertThat(usersSortByName.get(0) .getName()).isEqualTo(USER_NAME_ADAM); @@ -278,7 +278,7 @@ public class UserRepositoryCommon { userRepository.save(new User(USER_NAME_PETER, LocalDate.now(), USER_EMAIL2, ACTIVE_STATUS)); userRepository.save(new User("SAMPLE", LocalDate.now(), USER_EMAIL3, INACTIVE_STATUS)); - userRepository.findAll(new Sort(Sort.Direction.ASC, "name")); + userRepository.findAll(Sort.by(Sort.Direction.ASC, "name")); List usersSortByNameLength = userRepository.findAll(Sort.by("LENGTH(name)")); diff --git a/persistence-modules/spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/services/impl/EmployeeServicesWithKeyValueTemplate.java b/persistence-modules/spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/services/impl/EmployeeServicesWithKeyValueTemplate.java index 3eb1d0f66a..fe3c332f33 100644 --- a/persistence-modules/spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/services/impl/EmployeeServicesWithKeyValueTemplate.java +++ b/persistence-modules/spring-data-keyvalue/src/main/java/com/baeldung/spring/data/keyvalue/services/impl/EmployeeServicesWithKeyValueTemplate.java @@ -49,7 +49,7 @@ public class EmployeeServicesWithKeyValueTemplate implements EmployeeService { @Override public Iterable getSortedListOfEmployeesBySalary() { KeyValueQuery query = new KeyValueQuery(); - query.setSort(new Sort(Sort.Direction.DESC, "salary")); + query.setSort(Sort.by(Sort.Direction.DESC, "salary")); return keyValueTemplate.find(query, Employee.class); } diff --git a/persistence-modules/spring-data-neo4j/pom.xml b/persistence-modules/spring-data-neo4j/pom.xml index 625e2c5fc1..d827c32a3c 100644 --- a/persistence-modules/spring-data-neo4j/pom.xml +++ b/persistence-modules/spring-data-neo4j/pom.xml @@ -8,9 +8,8 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ diff --git a/persistence-modules/spring-data-redis/pom.xml b/persistence-modules/spring-data-redis/pom.xml index a304108fee..d2bf074d03 100644 --- a/persistence-modules/spring-data-redis/pom.xml +++ b/persistence-modules/spring-data-redis/pom.xml @@ -4,7 +4,7 @@ 4.0.0 spring-data-redis 1.0 - spring-data-redis + spring-data-redis jar @@ -62,7 +62,6 @@ redis.clients jedis - ${jedis.version} jar @@ -97,10 +96,9 @@ 3.2.4 - 2.9.0 0.10.0 - 2.0.3.RELEASE 0.6 + 2.1.9.RELEASE diff --git a/persistence-modules/spring-data-solr/pom.xml b/persistence-modules/spring-data-solr/pom.xml index 1a17a2e321..9d96c75082 100644 --- a/persistence-modules/spring-data-solr/pom.xml +++ b/persistence-modules/spring-data-solr/pom.xml @@ -3,7 +3,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-data-solr - 0.0.1-SNAPSHOT spring-data-solr jar diff --git a/persistence-modules/spring-hibernate-3/pom.xml b/persistence-modules/spring-hibernate-3/pom.xml index e677776a95..b28895f86d 100644 --- a/persistence-modules/spring-hibernate-3/pom.xml +++ b/persistence-modules/spring-hibernate-3/pom.xml @@ -8,9 +8,8 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ @@ -73,16 +72,6 @@ - - spring-hibernate-3 - - - src/main/resources - true - - - - 4.3.4.RELEASE diff --git a/persistence-modules/spring-hibernate-5/pom.xml b/persistence-modules/spring-hibernate-5/pom.xml index 546dcb1ce0..8a8b6c15e3 100644 --- a/persistence-modules/spring-hibernate-5/pom.xml +++ b/persistence-modules/spring-hibernate-5/pom.xml @@ -8,9 +8,8 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ @@ -125,16 +124,6 @@ - - spring-hibernate-5 - - - src/main/resources - true - - - - 5.0.2.RELEASE diff --git a/persistence-modules/spring-hibernate4/pom.xml b/persistence-modules/spring-hibernate4/pom.xml index 41c7fdb098..5e931d5cff 100644 --- a/persistence-modules/spring-hibernate4/pom.xml +++ b/persistence-modules/spring-hibernate4/pom.xml @@ -136,16 +136,6 @@ - - spring-hibernate4 - - - src/main/resources - true - - - - 4.3.4.RELEASE @@ -166,15 +156,6 @@ 19.0 - - 4.4.1 - 4.5 - - 2.9.0 - - - 2.7 - diff --git a/persistence-modules/spring-jpa/pom.xml b/persistence-modules/spring-jpa/pom.xml index 4972a20cf6..ef05269c92 100644 --- a/persistence-modules/spring-jpa/pom.xml +++ b/persistence-modules/spring-jpa/pom.xml @@ -9,9 +9,8 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ @@ -129,27 +128,6 @@ - - spring-jpa - - - src/main/resources - true - - - - - org.apache.maven.plugins - maven-war-plugin - ${maven-war-plugin.version} - - src/main/webapp - false - - - - - 5.1.5.RELEASE diff --git a/persistence-modules/spring-persistence-simple/pom.xml b/persistence-modules/spring-persistence-simple/pom.xml index 3ecb9c3d7d..8a03310048 100644 --- a/persistence-modules/spring-persistence-simple/pom.xml +++ b/persistence-modules/spring-persistence-simple/pom.xml @@ -8,9 +8,8 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT - ../../ @@ -106,13 +105,6 @@ - spring-persistence-simple - - - src/main/resources - true - - com.mysema.maven diff --git a/podman/README.md b/podman/README.md new file mode 100644 index 0000000000..3102036f04 --- /dev/null +++ b/podman/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [An Introduction to Podman](https://www.baeldung.com/podman-intro) diff --git a/pom.xml b/pom.xml index 177792f3b8..19f435f1b8 100644 --- a/pom.xml +++ b/pom.xml @@ -412,6 +412,7 @@ disruptor dozer drools + dropwizard dubbo ethereum @@ -447,6 +448,7 @@ immutables jackson-modules + jackson-simple java-blockchain java-collections-conversions @@ -486,6 +488,7 @@ jooby jsf json + json-2 json-path jsoup jta @@ -536,6 +539,7 @@ netflix-modules ninja + open-liberty oauth2-framework-impl optaplanner @@ -550,7 +554,7 @@ protobuffer quarkus - + quarkus-extension rabbitmq @@ -635,50 +639,10 @@ spring-batch spring-bom - - spring-boot - spring-boot-admin - spring-boot-angular - spring-boot-artifacts - spring-boot-autoconfiguration - spring-boot-bootstrap - spring-boot-camel - - spring-boot-client - spring-boot-config-jpa-error - spring-boot-crud - spring-boot-ctx-fluent - spring-boot-custom-starter - spring-boot-data - spring-boot-deployment - spring-boot-di - spring-boot-environment - spring-boot-flowable - - spring-boot-jasypt - spring-boot-keycloak - spring-boot-kotlin - spring-boot-libraries - spring-boot-logging-log4j2 - spring-boot-mvc - spring-boot-mvc-2 - spring-boot-mvc-birt - spring-boot-nashorn spring-boot-parent - spring-boot-performance - spring-boot-properties - spring-boot-property-exp - spring-boot-rest - spring-boot-runtime - spring-boot-runtime/disabling-console-jul - spring-boot-runtime/disabling-console-log4j2 - spring-boot-runtime/disabling-console-logback spring-boot-security - spring-boot-springdoc - spring-boot-testing - spring-boot-vue - + spring-caching spring-cloud @@ -839,9 +803,6 @@ parent-java parent-kotlin - core-kotlin - core-kotlin-2 - jenkins/plugins jhipster jws @@ -962,6 +923,7 @@ disruptor dozer drools + dropwizard dubbo ethereum @@ -997,6 +959,7 @@ immutables jackson-modules + jackson-simple java-blockchain java-collections-conversions @@ -1086,6 +1049,7 @@ netflix-modules ninja + open-liberty oauth2-framework-impl optaplanner @@ -1100,7 +1064,7 @@ protobuffer quarkus - + quarkus-extension rabbitmq @@ -1177,49 +1141,9 @@ spring-batch spring-bom - - spring-boot - spring-boot-admin - spring-boot-angular - spring-boot-artifacts - spring-boot-autoconfiguration - spring-boot-bootstrap - spring-boot-camel - - spring-boot-client - spring-boot-config-jpa-error - spring-boot-crud - spring-boot-ctx-fluent - spring-boot-custom-starter - spring-boot-data - spring-boot-deployment - spring-boot-di - spring-boot-environment - spring-boot-flowable - - spring-boot-jasypt - spring-boot-keycloak - spring-boot-kotlin - spring-boot-libraries - spring-boot-logging-log4j2 - spring-boot-mvc - spring-boot-mvc-2 - spring-boot-mvc-birt - spring-boot-nashorn spring-boot-parent - spring-boot-performance - spring-boot-properties - spring-boot-property-exp - spring-boot-rest - spring-boot-runtime - spring-boot-runtime/disabling-console-jul - spring-boot-runtime/disabling-console-log4j2 - spring-boot-runtime/disabling-console-logback spring-boot-security - spring-boot-springdoc - spring-boot-testing - spring-boot-vue spring-caching @@ -1373,9 +1297,6 @@ parent-java parent-kotlin - core-kotlin - core-kotlin-2 - jenkins/plugins jhipster jws diff --git a/quarkus-extension/README.md b/quarkus-extension/README.md new file mode 100644 index 0000000000..782ec75957 --- /dev/null +++ b/quarkus-extension/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [How to Implement a Quarkus Extension](https://www.baeldung.com/quarkus-extension-java) diff --git a/quarkus-extension/pom.xml b/quarkus-extension/pom.xml index 38d7c3d548..394376e59e 100644 --- a/quarkus-extension/pom.xml +++ b/quarkus-extension/pom.xml @@ -9,6 +9,12 @@ quarkus-extension pom + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + quarkus-liquibase quarkus-app diff --git a/quarkus-extension/quarkus-app/pom.xml b/quarkus-extension/quarkus-app/pom.xml index 6e4cce3ae7..6d3f4c7c28 100644 --- a/quarkus-extension/quarkus-app/pom.xml +++ b/quarkus-extension/quarkus-app/pom.xml @@ -5,7 +5,12 @@ 4.0.0 com.baeldung.quarkus.app quarkus-app - 1.0-SNAPSHOT + + + com.baeldung.quarkus.extension + quarkus-extension + 1.0-SNAPSHOT + @@ -22,13 +27,12 @@ com.baeldung.quarkus.liquibase - quarkus-liquibase - 1.0-SNAPSHOT + quarkus-liquibase-runtime + ${project.version} io.quarkus quarkus-jdbc-h2 - ${quarkus.version} @@ -46,31 +50,11 @@
- - maven-compiler-plugin - ${compiler-plugin.version} - - - maven-surefire-plugin - ${surefire-plugin.version} - - - org.jboss.logmanager.LogManager - - - - UTF-8 - 2.22.0 - true 1.0.0.Final - 3.8.1 - 1.8 - UTF-8 - 1.8 diff --git a/quarkus-extension/quarkus-liquibase/deployment/pom.xml b/quarkus-extension/quarkus-liquibase/deployment/pom.xml index f005ac4e8c..c85d986390 100644 --- a/quarkus-extension/quarkus-liquibase/deployment/pom.xml +++ b/quarkus-extension/quarkus-liquibase/deployment/pom.xml @@ -30,7 +30,7 @@ com.baeldung.quarkus.liquibase - quarkus-liquibase + quarkus-liquibase-runtime ${project.version} @@ -40,7 +40,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + ${compiler.plugin.version} @@ -54,4 +54,8 @@ + + 3.8.1 + + \ No newline at end of file diff --git a/quarkus-extension/quarkus-liquibase/pom.xml b/quarkus-extension/quarkus-liquibase/pom.xml index e1f3e243ab..9536561701 100644 --- a/quarkus-extension/quarkus-liquibase/pom.xml +++ b/quarkus-extension/quarkus-liquibase/pom.xml @@ -5,19 +5,21 @@ 4.0.0 com.baeldung.quarkus.liquibase quarkus-liquibase-parent - 1.0-SNAPSHOT quarkus-liquibase-parent pom + + com.baeldung.quarkus.extension + quarkus-extension + 1.0-SNAPSHOT + + runtime deployment - 1.8 - 1.8 - UTF-8 1.0.0.Final diff --git a/quarkus-extension/quarkus-liquibase/runtime/pom.xml b/quarkus-extension/quarkus-liquibase/runtime/pom.xml index a1d705c691..83f7c8d4cc 100644 --- a/quarkus-extension/quarkus-liquibase/runtime/pom.xml +++ b/quarkus-extension/quarkus-liquibase/runtime/pom.xml @@ -1,7 +1,6 @@ - + 4.0.0 quarkus-liquibase-runtime quarkus-liquibase-runtime @@ -26,7 +25,7 @@ org.liquibase liquibase-core - 3.8.1 + ${liquibase-core.version} @@ -42,7 +41,7 @@ extension-descriptor - ${project.groupId}:${project.artifactId}-deployment:${project.version} + ${project.groupId}:quarkus-liquibase-deployment:${project.version} @@ -51,7 +50,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + ${compiler.plugin.version} @@ -65,4 +64,10 @@ + + 3.8.1 + 3.8.1 + 3.8.1 + + \ No newline at end of file diff --git a/quarkus/pom.xml b/quarkus/pom.xml index de4c2ca9a3..09eb90d110 100644 --- a/quarkus/pom.xml +++ b/quarkus/pom.xml @@ -118,9 +118,6 @@ 2.22.0 0.15.0 - 1.8 - UTF-8 - 1.8 diff --git a/rabbitmq/pom.xml b/rabbitmq/pom.xml index b544da4c44..33ccf5402f 100644 --- a/rabbitmq/pom.xml +++ b/rabbitmq/pom.xml @@ -5,7 +5,6 @@ rabbitmq 0.1-SNAPSHOT rabbitmq - http://maven.apache.org com.baeldung diff --git a/ratpack/pom.xml b/ratpack/pom.xml index a00be905ee..9ad654fa7d 100644 --- a/ratpack/pom.xml +++ b/ratpack/pom.xml @@ -6,7 +6,6 @@ 1.0-SNAPSHOT ratpack jar - http://maven.apache.org com.baeldung @@ -85,18 +84,7 @@ - - ${project.artifactId} - - - src/main/resources - - - - - 1.8 - 1.8 1.5.4 4.5.3 4.4.6 diff --git a/restx/pom.xml b/restx/pom.xml index 17c25fcdc0..ee25c88047 100644 --- a/restx/pom.xml +++ b/restx/pom.xml @@ -148,8 +148,6 @@ - 1.8 - 1.8 0.35-rc4 1.2.3 diff --git a/rsocket/pom.xml b/rsocket/pom.xml index 70f21064b6..5b407c2bd0 100644 --- a/rsocket/pom.xml +++ b/rsocket/pom.xml @@ -24,43 +24,10 @@ rsocket-transport-netty ${rsocket.version} - - junit - junit - ${junit.version} - test - - - org.hamcrest - hamcrest-core - ${hamcrest.version} - test - - - ch.qos.logback - logback-classic - ${logback.version} - - - ch.qos.logback - logback-core - ${logback.version} - - - org.slf4j - slf4j-api - ${slf4j-api.version} - - 1.8 - 1.8 - 3.0.1 0.11.13 - 1.3 - 1.2.3 - 1.7.25 diff --git a/rule-engines/easy-rules/pom.xml b/rule-engines/easy-rules/pom.xml index c1ba829045..b9661cd1c3 100644 --- a/rule-engines/easy-rules/pom.xml +++ b/rule-engines/easy-rules/pom.xml @@ -9,9 +9,8 @@ com.baeldung - parent-modules + rule-engines 1.0.0-SNAPSHOT - ../.. diff --git a/rule-engines/openl-tablets/pom.xml b/rule-engines/openl-tablets/pom.xml index d1c7baabcc..25c4b8365a 100644 --- a/rule-engines/openl-tablets/pom.xml +++ b/rule-engines/openl-tablets/pom.xml @@ -9,9 +9,8 @@ com.baeldung - parent-modules + rule-engines 1.0.0-SNAPSHOT - ../.. diff --git a/rule-engines/pom.xml b/rule-engines/pom.xml index cc015c600b..d3d3127ce0 100644 --- a/rule-engines/pom.xml +++ b/rule-engines/pom.xml @@ -10,7 +10,6 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - .. diff --git a/rule-engines/rulebook/pom.xml b/rule-engines/rulebook/pom.xml index b021adea10..95ededa5f9 100644 --- a/rule-engines/rulebook/pom.xml +++ b/rule-engines/rulebook/pom.xml @@ -9,9 +9,8 @@ com.baeldung - parent-modules + rule-engines 1.0.0-SNAPSHOT - ../.. diff --git a/rxjava-core/README.md b/rxjava-core/README.md index 2773bd9423..95a374668d 100644 --- a/rxjava-core/README.md +++ b/rxjava-core/README.md @@ -13,4 +13,5 @@ This module contains articles about RxJava. - [RxJava Maybe](https://www.baeldung.com/rxjava-maybe) - [Combining RxJava Completables](https://www.baeldung.com/rxjava-completable) - [RxJava Hooks](https://www.baeldung.com/rxjava-hooks) +- [Introduction to rxjava-jdbc](https://www.baeldung.com/rxjava-jdbc) - More articles: [[next -->]](/rxjava-2) diff --git a/spf4j/spf4j-aspects-app/pom.xml b/spf4j/spf4j-aspects-app/pom.xml index 2458e2d8ad..db6a18f26a 100644 --- a/spf4j/spf4j-aspects-app/pom.xml +++ b/spf4j/spf4j-aspects-app/pom.xml @@ -39,16 +39,16 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.0 + ${compiler.plugin.version} - 1.8 - 1.8 + ${java.version} + ${java.version} org.apache.maven.plugins maven-dependency-plugin - 3.1.1 + ${dependency.plugin.version} copy-dependencies @@ -84,6 +84,8 @@ UTF-8 8.6.10 1.7.21 + 3.8.0 + 3.1.1 diff --git a/spf4j/spf4j-core-app/pom.xml b/spf4j/spf4j-core-app/pom.xml index 45300fd4a4..48cbf4a1c9 100644 --- a/spf4j/spf4j-core-app/pom.xml +++ b/spf4j/spf4j-core-app/pom.xml @@ -39,16 +39,16 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.0 + ${compiler.plugin.version} - 1.8 - 1.8 + ${java.version} + ${java.version} org.apache.maven.plugins maven-dependency-plugin - 3.1.1 + ${dependency.plugin.version} copy-dependencies @@ -84,6 +84,8 @@ UTF-8 8.6.10 1.7.21 + 3.8.0 + 3.1.1 diff --git a/spring-5-reactive-security/README.md b/spring-5-reactive-security/README.md index 4ea6fb644f..a0f47a503d 100644 --- a/spring-5-reactive-security/README.md +++ b/spring-5-reactive-security/README.md @@ -11,3 +11,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Spring Security 5 for Reactive Applications](https://www.baeldung.com/spring-security-5-reactive) - [Guide to Spring 5 WebFlux](https://www.baeldung.com/spring-webflux) - [Introduction to the Functional Web Framework in Spring 5](https://www.baeldung.com/spring-5-functional-web) +- [Guide to the AuthenticationManagerResolver in Spring Security](https://www.baeldung.com/spring-security-authenticationmanagerresolver) diff --git a/spring-5-security/README.md b/spring-5-security/README.md index 4cace0db8d..07f2d48b7f 100644 --- a/spring-5-security/README.md +++ b/spring-5-security/README.md @@ -8,4 +8,4 @@ This module contains articles about Spring Security 5 - [A Custom Spring SecurityConfigurer](https://www.baeldung.com/spring-security-custom-configurer) - [New Password Storage In Spring Security 5](https://www.baeldung.com/spring-security-5-password-storage) - [Default Password Encoder in Spring Security 5](https://www.baeldung.com/spring-security-5-default-password-encoder) - +- [Guide to the AuthenticationManagerResolver in Spring Security](https://www.baeldung.com/spring-security-authenticationmanagerresolver) diff --git a/spring-5/pom.xml b/spring-5/pom.xml index eadfb5e512..a242c29933 100644 --- a/spring-5/pom.xml +++ b/spring-5/pom.xml @@ -149,6 +149,7 @@ + 2.1.9.RELEASE 1.0 1.5.6 4.1 diff --git a/spring-amqp/README.md b/spring-amqp/README.md index 0ae4eda12e..6b09aec10a 100644 --- a/spring-amqp/README.md +++ b/spring-amqp/README.md @@ -5,4 +5,5 @@ This module contains articles about Spring with the AMQP messaging system ## Relevant articles: - [Messaging With Spring AMQP](https://www.baeldung.com/spring-amqp) -- [RabbitMQ Message Dispatching with Spring AMQP](https://www.baeldung.com/rabbitmq-spring-amqp) \ No newline at end of file +- [RabbitMQ Message Dispatching with Spring AMQP](https://www.baeldung.com/rabbitmq-spring-amqp) +- [Error Handling with Spring AMQP](https://www.baeldung.com/spring-amqp-error-handling) diff --git a/spring-boot-bootstrap/src/main/resources/application-mysql.properties b/spring-boot-bootstrap/src/main/resources/application-mysql.properties deleted file mode 100644 index a1823b5d7f..0000000000 --- a/spring-boot-bootstrap/src/main/resources/application-mysql.properties +++ /dev/null @@ -1 +0,0 @@ -spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect \ No newline at end of file diff --git a/spring-boot-gradle/gradle/wrapper/gradle-wrapper.jar b/spring-boot-gradle/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 1ce6e58f1c..0000000000 Binary files a/spring-boot-gradle/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/spring-boot-libraries/.mvn/wrapper/maven-wrapper.jar b/spring-boot-libraries/.mvn/wrapper/maven-wrapper.jar deleted file mode 100644 index 5fd4d5023f..0000000000 Binary files a/spring-boot-libraries/.mvn/wrapper/maven-wrapper.jar and /dev/null differ diff --git a/spring-boot-modules/README.md b/spring-boot-modules/README.md new file mode 100644 index 0000000000..cd916f48a7 --- /dev/null +++ b/spring-boot-modules/README.md @@ -0,0 +1,3 @@ +## Spring Boot Modules + +This module contains various modules of Spring Boot diff --git a/spring-boot-modules/pom.xml b/spring-boot-modules/pom.xml new file mode 100644 index 0000000000..234c52f638 --- /dev/null +++ b/spring-boot-modules/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + com.baeldung.spring-boot-modules + spring-boot-modules + spring-boot-modules + pom + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + spring-boot + spring-boot-admin + spring-boot-angular + spring-boot-artifacts + spring-boot-autoconfiguration + spring-boot-bootstrap + spring-boot-client + spring-boot-config-jpa-error + spring-boot-ctx-fluent + spring-boot-deployment + spring-boot-di + spring-boot-camel + + spring-boot-custom-starter + spring-boot-crud + spring-boot-data + spring-boot-environment + spring-boot-flowable + + spring-boot-jasypt + spring-boot-keycloak + spring-boot-libraries + spring-boot-logging-log4j2 + spring-boot-kotlin + spring-boot-mvc + spring-boot-mvc-2 + spring-boot-mvc-birt + spring-boot-nashorn + spring-boot-performance + spring-boot-properties + spring-boot-property-exp + spring-boot-runtime + spring-boot-springdoc + spring-boot-testing + spring-boot-vue + + + diff --git a/spring-boot-admin/README.md b/spring-boot-modules/spring-boot-admin/README.md similarity index 100% rename from spring-boot-admin/README.md rename to spring-boot-modules/spring-boot-admin/README.md diff --git a/spring-boot-admin/pom.xml b/spring-boot-modules/spring-boot-admin/pom.xml similarity index 92% rename from spring-boot-admin/pom.xml rename to spring-boot-modules/spring-boot-admin/pom.xml index 8dbce0fd6c..f7dc98770a 100644 --- a/spring-boot-admin/pom.xml +++ b/spring-boot-modules/spring-boot-admin/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/spring-boot-admin/spring-boot-admin-client/.gitignore b/spring-boot-modules/spring-boot-admin/spring-boot-admin-client/.gitignore similarity index 100% rename from spring-boot-admin/spring-boot-admin-client/.gitignore rename to spring-boot-modules/spring-boot-admin/spring-boot-admin-client/.gitignore diff --git a/spring-boot-admin/spring-boot-admin-client/pom.xml b/spring-boot-modules/spring-boot-admin/spring-boot-admin-client/pom.xml similarity index 95% rename from spring-boot-admin/spring-boot-admin-client/pom.xml rename to spring-boot-modules/spring-boot-admin/spring-boot-admin-client/pom.xml index 47abfdddc2..8bb8c7bac3 100644 --- a/spring-boot-admin/spring-boot-admin-client/pom.xml +++ b/spring-boot-modules/spring-boot-admin/spring-boot-admin-client/pom.xml @@ -12,7 +12,6 @@ com.baeldung spring-boot-admin 0.0.1-SNAPSHOT - ../../spring-boot-admin @@ -59,7 +58,7 @@ - 2.1.6 + 2.2.2 2.0.4.RELEASE diff --git a/spring-boot-admin/spring-boot-admin-client/src/main/java/com/baeldung/springbootadminclient/SpringBootAdminClientApplication.java b/spring-boot-modules/spring-boot-admin/spring-boot-admin-client/src/main/java/com/baeldung/springbootadminclient/SpringBootAdminClientApplication.java similarity index 100% rename from spring-boot-admin/spring-boot-admin-client/src/main/java/com/baeldung/springbootadminclient/SpringBootAdminClientApplication.java rename to spring-boot-modules/spring-boot-admin/spring-boot-admin-client/src/main/java/com/baeldung/springbootadminclient/SpringBootAdminClientApplication.java diff --git a/spring-boot-admin/spring-boot-admin-client/src/main/resources/application.properties b/spring-boot-modules/spring-boot-admin/spring-boot-admin-client/src/main/resources/application.properties similarity index 100% rename from spring-boot-admin/spring-boot-admin-client/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-admin/spring-boot-admin-client/src/main/resources/application.properties diff --git a/spring-boot-admin/spring-boot-admin-client/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-admin/spring-boot-admin-client/src/main/resources/logback.xml similarity index 100% rename from spring-boot-admin/spring-boot-admin-client/src/main/resources/logback.xml rename to spring-boot-modules/spring-boot-admin/spring-boot-admin-client/src/main/resources/logback.xml diff --git a/spring-boot-admin/spring-boot-admin-client/src/test/java/com/baeldung/springbootadminclient/SpringBootAdminClientApplicationIntegrationTest.java b/spring-boot-modules/spring-boot-admin/spring-boot-admin-client/src/test/java/com/baeldung/springbootadminclient/SpringBootAdminClientApplicationIntegrationTest.java similarity index 100% rename from spring-boot-admin/spring-boot-admin-client/src/test/java/com/baeldung/springbootadminclient/SpringBootAdminClientApplicationIntegrationTest.java rename to spring-boot-modules/spring-boot-admin/spring-boot-admin-client/src/test/java/com/baeldung/springbootadminclient/SpringBootAdminClientApplicationIntegrationTest.java diff --git a/spring-boot-admin/spring-boot-admin-client/src/test/java/org/baeldung/SpringContextTest.java b/spring-boot-modules/spring-boot-admin/spring-boot-admin-client/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-boot-admin/spring-boot-admin-client/src/test/java/org/baeldung/SpringContextTest.java rename to spring-boot-modules/spring-boot-admin/spring-boot-admin-client/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-boot-admin/spring-boot-admin-server/.gitignore b/spring-boot-modules/spring-boot-admin/spring-boot-admin-server/.gitignore similarity index 100% rename from spring-boot-admin/spring-boot-admin-server/.gitignore rename to spring-boot-modules/spring-boot-admin/spring-boot-admin-server/.gitignore diff --git a/spring-boot-admin/spring-boot-admin-server/pom.xml b/spring-boot-modules/spring-boot-admin/spring-boot-admin-server/pom.xml similarity index 94% rename from spring-boot-admin/spring-boot-admin-server/pom.xml rename to spring-boot-modules/spring-boot-admin/spring-boot-admin-server/pom.xml index d0d2d7a1ef..118b270812 100644 --- a/spring-boot-admin/spring-boot-admin-server/pom.xml +++ b/spring-boot-modules/spring-boot-admin/spring-boot-admin-server/pom.xml @@ -12,7 +12,6 @@ com.baeldung spring-boot-admin 0.0.1-SNAPSHOT - ../../spring-boot-admin @@ -80,8 +79,8 @@ - 2.1.6 - 2.1.6 + 2.2.2 + 2.2.2 1.5.7 2.0.4.RELEASE diff --git a/spring-boot-admin/spring-boot-admin-server/src/main/java/com/baeldung/springbootadminserver/SpringBootAdminServerApplication.java b/spring-boot-modules/spring-boot-admin/spring-boot-admin-server/src/main/java/com/baeldung/springbootadminserver/SpringBootAdminServerApplication.java similarity index 100% rename from spring-boot-admin/spring-boot-admin-server/src/main/java/com/baeldung/springbootadminserver/SpringBootAdminServerApplication.java rename to spring-boot-modules/spring-boot-admin/spring-boot-admin-server/src/main/java/com/baeldung/springbootadminserver/SpringBootAdminServerApplication.java diff --git a/spring-boot-admin/spring-boot-admin-server/src/main/java/com/baeldung/springbootadminserver/configs/HazelcastConfig.java b/spring-boot-modules/spring-boot-admin/spring-boot-admin-server/src/main/java/com/baeldung/springbootadminserver/configs/HazelcastConfig.java similarity index 100% rename from spring-boot-admin/spring-boot-admin-server/src/main/java/com/baeldung/springbootadminserver/configs/HazelcastConfig.java rename to spring-boot-modules/spring-boot-admin/spring-boot-admin-server/src/main/java/com/baeldung/springbootadminserver/configs/HazelcastConfig.java diff --git a/spring-boot-admin/spring-boot-admin-server/src/main/java/com/baeldung/springbootadminserver/configs/NotifierConfiguration.java b/spring-boot-modules/spring-boot-admin/spring-boot-admin-server/src/main/java/com/baeldung/springbootadminserver/configs/NotifierConfiguration.java similarity index 100% rename from spring-boot-admin/spring-boot-admin-server/src/main/java/com/baeldung/springbootadminserver/configs/NotifierConfiguration.java rename to spring-boot-modules/spring-boot-admin/spring-boot-admin-server/src/main/java/com/baeldung/springbootadminserver/configs/NotifierConfiguration.java diff --git a/spring-boot-admin/spring-boot-admin-server/src/main/java/com/baeldung/springbootadminserver/configs/WebSecurityConfig.java b/spring-boot-modules/spring-boot-admin/spring-boot-admin-server/src/main/java/com/baeldung/springbootadminserver/configs/WebSecurityConfig.java similarity index 100% rename from spring-boot-admin/spring-boot-admin-server/src/main/java/com/baeldung/springbootadminserver/configs/WebSecurityConfig.java rename to spring-boot-modules/spring-boot-admin/spring-boot-admin-server/src/main/java/com/baeldung/springbootadminserver/configs/WebSecurityConfig.java diff --git a/spring-boot-admin/spring-boot-admin-server/src/main/resources/application.properties b/spring-boot-modules/spring-boot-admin/spring-boot-admin-server/src/main/resources/application.properties similarity index 100% rename from spring-boot-admin/spring-boot-admin-server/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-admin/spring-boot-admin-server/src/main/resources/application.properties diff --git a/spring-boot-admin/spring-boot-admin-server/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-admin/spring-boot-admin-server/src/main/resources/logback.xml similarity index 100% rename from spring-boot-admin/spring-boot-admin-server/src/main/resources/logback.xml rename to spring-boot-modules/spring-boot-admin/spring-boot-admin-server/src/main/resources/logback.xml diff --git a/spring-boot-admin/spring-boot-admin-server/src/test/java/com/baeldung/springbootadminserver/HazelcastConfigIntegrationTest.java b/spring-boot-modules/spring-boot-admin/spring-boot-admin-server/src/test/java/com/baeldung/springbootadminserver/HazelcastConfigIntegrationTest.java similarity index 100% rename from spring-boot-admin/spring-boot-admin-server/src/test/java/com/baeldung/springbootadminserver/HazelcastConfigIntegrationTest.java rename to spring-boot-modules/spring-boot-admin/spring-boot-admin-server/src/test/java/com/baeldung/springbootadminserver/HazelcastConfigIntegrationTest.java diff --git a/spring-boot-admin/spring-boot-admin-server/src/test/java/com/baeldung/springbootadminserver/NotifierConfigurationIntegrationTest.java b/spring-boot-modules/spring-boot-admin/spring-boot-admin-server/src/test/java/com/baeldung/springbootadminserver/NotifierConfigurationIntegrationTest.java similarity index 100% rename from spring-boot-admin/spring-boot-admin-server/src/test/java/com/baeldung/springbootadminserver/NotifierConfigurationIntegrationTest.java rename to spring-boot-modules/spring-boot-admin/spring-boot-admin-server/src/test/java/com/baeldung/springbootadminserver/NotifierConfigurationIntegrationTest.java diff --git a/spring-boot-admin/spring-boot-admin-server/src/test/java/com/baeldung/springbootadminserver/WebSecurityConfigIntegrationTest.java b/spring-boot-modules/spring-boot-admin/spring-boot-admin-server/src/test/java/com/baeldung/springbootadminserver/WebSecurityConfigIntegrationTest.java similarity index 100% rename from spring-boot-admin/spring-boot-admin-server/src/test/java/com/baeldung/springbootadminserver/WebSecurityConfigIntegrationTest.java rename to spring-boot-modules/spring-boot-admin/spring-boot-admin-server/src/test/java/com/baeldung/springbootadminserver/WebSecurityConfigIntegrationTest.java diff --git a/spring-boot-admin/spring-boot-admin-server/src/test/java/org/baeldung/SpringContextTest.java b/spring-boot-modules/spring-boot-admin/spring-boot-admin-server/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-boot-admin/spring-boot-admin-server/src/test/java/org/baeldung/SpringContextTest.java rename to spring-boot-modules/spring-boot-admin/spring-boot-admin-server/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-boot-angular/README.md b/spring-boot-modules/spring-boot-angular/README.md similarity index 100% rename from spring-boot-angular/README.md rename to spring-boot-modules/spring-boot-angular/README.md diff --git a/spring-boot-angular/pom.xml b/spring-boot-modules/spring-boot-angular/pom.xml similarity index 96% rename from spring-boot-angular/pom.xml rename to spring-boot-modules/spring-boot-angular/pom.xml index d78761e921..5cfc530100 100644 --- a/spring-boot-angular/pom.xml +++ b/spring-boot-modules/spring-boot-angular/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-boot-angular/src/main/java/com/baeldung/application/Application.java b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/application/Application.java similarity index 97% rename from spring-boot-angular/src/main/java/com/baeldung/application/Application.java rename to spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/application/Application.java index f1155c3106..0101ea3a3b 100644 --- a/spring-boot-angular/src/main/java/com/baeldung/application/Application.java +++ b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/application/Application.java @@ -1,28 +1,28 @@ -package com.baeldung.application; - -import com.baeldung.application.entities.User; -import com.baeldung.application.repositories.UserRepository; -import java.util.stream.Stream; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; - -@SpringBootApplication -public class Application { - - public static void main(String[] args) { - SpringApplication.run(Application.class, args); - } - - @Bean - CommandLineRunner init(UserRepository userRepository) { - return args -> { - Stream.of("John", "Julie", "Jennifer", "Helen", "Rachel").forEach(name -> { - User user = new User(name, name.toLowerCase() + "@domain.com"); - userRepository.save(user); - }); - userRepository.findAll().forEach(System.out::println); - }; - } -} +package com.baeldung.application; + +import com.baeldung.application.entities.User; +import com.baeldung.application.repositories.UserRepository; +import java.util.stream.Stream; +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +@SpringBootApplication +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } + + @Bean + CommandLineRunner init(UserRepository userRepository) { + return args -> { + Stream.of("John", "Julie", "Jennifer", "Helen", "Rachel").forEach(name -> { + User user = new User(name, name.toLowerCase() + "@domain.com"); + userRepository.save(user); + }); + userRepository.findAll().forEach(System.out::println); + }; + } +} diff --git a/spring-boot-angular/src/main/java/com/baeldung/application/controllers/UserController.java b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/application/controllers/UserController.java similarity index 96% rename from spring-boot-angular/src/main/java/com/baeldung/application/controllers/UserController.java rename to spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/application/controllers/UserController.java index 14c90d5b10..a87ac4e8d1 100644 --- a/spring-boot-angular/src/main/java/com/baeldung/application/controllers/UserController.java +++ b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/application/controllers/UserController.java @@ -1,31 +1,31 @@ -package com.baeldung.application.controllers; - -import com.baeldung.application.entities.User; -import com.baeldung.application.repositories.UserRepository; -import java.util.List; -import org.springframework.web.bind.annotation.CrossOrigin; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@CrossOrigin(origins = "http://localhost:4200") -public class UserController { - - private final UserRepository userRepository; - - public UserController(UserRepository userRepository) { - this.userRepository = userRepository; - } - - @GetMapping("/users") - public List getUsers() { - return (List) userRepository.findAll(); - } - - @PostMapping("/users") - void addUser(@RequestBody User user) { - userRepository.save(user); - } -} +package com.baeldung.application.controllers; + +import com.baeldung.application.entities.User; +import com.baeldung.application.repositories.UserRepository; +import java.util.List; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@CrossOrigin(origins = "http://localhost:4200") +public class UserController { + + private final UserRepository userRepository; + + public UserController(UserRepository userRepository) { + this.userRepository = userRepository; + } + + @GetMapping("/users") + public List getUsers() { + return (List) userRepository.findAll(); + } + + @PostMapping("/users") + void addUser(@RequestBody User user) { + userRepository.save(user); + } +} diff --git a/spring-boot-angular/src/main/java/com/baeldung/application/entities/User.java b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/application/entities/User.java similarity index 95% rename from spring-boot-angular/src/main/java/com/baeldung/application/entities/User.java rename to spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/application/entities/User.java index 4c346fa5b9..ea23edc7e2 100644 --- a/spring-boot-angular/src/main/java/com/baeldung/application/entities/User.java +++ b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/application/entities/User.java @@ -1,43 +1,43 @@ -package com.baeldung.application.entities; - -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; - -@Entity -public class User { - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private long id; - private final String name; - private final String email; - - public User() { - this.name = ""; - this.email = ""; - } - - public User(String name, String email) { - this.name = name; - this.email = email; - } - - public long getId() { - return id; - } - - public String getName() { - return name; - } - - public String getEmail() { - return email; - } - - @Override - public String toString() { - return "User{" + "id=" + id + ", name=" + name + ", email=" + email + '}'; - } -} +package com.baeldung.application.entities; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; + +@Entity +public class User { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + private final String name; + private final String email; + + public User() { + this.name = ""; + this.email = ""; + } + + public User(String name, String email) { + this.name = name; + this.email = email; + } + + public long getId() { + return id; + } + + public String getName() { + return name; + } + + public String getEmail() { + return email; + } + + @Override + public String toString() { + return "User{" + "id=" + id + ", name=" + name + ", email=" + email + '}'; + } +} diff --git a/spring-boot-angular/src/main/java/com/baeldung/application/repositories/UserRepository.java b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/application/repositories/UserRepository.java similarity index 97% rename from spring-boot-angular/src/main/java/com/baeldung/application/repositories/UserRepository.java rename to spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/application/repositories/UserRepository.java index 5a81cadcbe..7bd71c2f86 100644 --- a/spring-boot-angular/src/main/java/com/baeldung/application/repositories/UserRepository.java +++ b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/application/repositories/UserRepository.java @@ -1,9 +1,9 @@ -package com.baeldung.application.repositories; - -import com.baeldung.application.entities.User; -import org.springframework.data.repository.CrudRepository; -import org.springframework.stereotype.Repository; -import org.springframework.web.bind.annotation.CrossOrigin; - -@Repository -public interface UserRepository extends CrudRepository{} +package com.baeldung.application.repositories; + +import com.baeldung.application.entities.User; +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; +import org.springframework.web.bind.annotation.CrossOrigin; + +@Repository +public interface UserRepository extends CrudRepository{} diff --git a/spring-boot-angular/src/main/java/com/baeldung/ecommerce/EcommerceApplication.java b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/EcommerceApplication.java similarity index 100% rename from spring-boot-angular/src/main/java/com/baeldung/ecommerce/EcommerceApplication.java rename to spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/EcommerceApplication.java diff --git a/spring-boot-angular/src/main/java/com/baeldung/ecommerce/controller/OrderController.java b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/controller/OrderController.java similarity index 100% rename from spring-boot-angular/src/main/java/com/baeldung/ecommerce/controller/OrderController.java rename to spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/controller/OrderController.java diff --git a/spring-boot-angular/src/main/java/com/baeldung/ecommerce/controller/ProductController.java b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/controller/ProductController.java similarity index 100% rename from spring-boot-angular/src/main/java/com/baeldung/ecommerce/controller/ProductController.java rename to spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/controller/ProductController.java diff --git a/spring-boot-angular/src/main/java/com/baeldung/ecommerce/dto/OrderProductDto.java b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/dto/OrderProductDto.java similarity index 100% rename from spring-boot-angular/src/main/java/com/baeldung/ecommerce/dto/OrderProductDto.java rename to spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/dto/OrderProductDto.java diff --git a/spring-boot-angular/src/main/java/com/baeldung/ecommerce/exception/ApiExceptionHandler.java b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/exception/ApiExceptionHandler.java similarity index 100% rename from spring-boot-angular/src/main/java/com/baeldung/ecommerce/exception/ApiExceptionHandler.java rename to spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/exception/ApiExceptionHandler.java diff --git a/spring-boot-angular/src/main/java/com/baeldung/ecommerce/exception/ResourceNotFoundException.java b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/exception/ResourceNotFoundException.java similarity index 100% rename from spring-boot-angular/src/main/java/com/baeldung/ecommerce/exception/ResourceNotFoundException.java rename to spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/exception/ResourceNotFoundException.java diff --git a/spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/Order.java b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/Order.java similarity index 100% rename from spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/Order.java rename to spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/Order.java diff --git a/spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/OrderProduct.java b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/OrderProduct.java similarity index 100% rename from spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/OrderProduct.java rename to spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/OrderProduct.java diff --git a/spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/OrderProductPK.java b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/OrderProductPK.java similarity index 100% rename from spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/OrderProductPK.java rename to spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/OrderProductPK.java diff --git a/spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/OrderStatus.java b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/OrderStatus.java similarity index 100% rename from spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/OrderStatus.java rename to spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/OrderStatus.java diff --git a/spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/Product.java b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/Product.java similarity index 100% rename from spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/Product.java rename to spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/model/Product.java diff --git a/spring-boot-angular/src/main/java/com/baeldung/ecommerce/repository/OrderProductRepository.java b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/repository/OrderProductRepository.java similarity index 100% rename from spring-boot-angular/src/main/java/com/baeldung/ecommerce/repository/OrderProductRepository.java rename to spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/repository/OrderProductRepository.java diff --git a/spring-boot-angular/src/main/java/com/baeldung/ecommerce/repository/OrderRepository.java b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/repository/OrderRepository.java similarity index 100% rename from spring-boot-angular/src/main/java/com/baeldung/ecommerce/repository/OrderRepository.java rename to spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/repository/OrderRepository.java diff --git a/spring-boot-angular/src/main/java/com/baeldung/ecommerce/repository/ProductRepository.java b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/repository/ProductRepository.java similarity index 100% rename from spring-boot-angular/src/main/java/com/baeldung/ecommerce/repository/ProductRepository.java rename to spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/repository/ProductRepository.java diff --git a/spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/OrderProductService.java b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/OrderProductService.java similarity index 100% rename from spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/OrderProductService.java rename to spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/OrderProductService.java diff --git a/spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/OrderProductServiceImpl.java b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/OrderProductServiceImpl.java similarity index 100% rename from spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/OrderProductServiceImpl.java rename to spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/OrderProductServiceImpl.java diff --git a/spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/OrderService.java b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/OrderService.java similarity index 100% rename from spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/OrderService.java rename to spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/OrderService.java diff --git a/spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/OrderServiceImpl.java b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/OrderServiceImpl.java similarity index 100% rename from spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/OrderServiceImpl.java rename to spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/OrderServiceImpl.java diff --git a/spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/ProductService.java b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/ProductService.java similarity index 100% rename from spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/ProductService.java rename to spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/ProductService.java diff --git a/spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/ProductServiceImpl.java b/spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/ProductServiceImpl.java similarity index 100% rename from spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/ProductServiceImpl.java rename to spring-boot-modules/spring-boot-angular/src/main/java/com/baeldung/ecommerce/service/ProductServiceImpl.java diff --git a/spring-boot-angular/src/main/js/application/.angular-cli.json b/spring-boot-modules/spring-boot-angular/src/main/js/application/.angular-cli.json similarity index 100% rename from spring-boot-angular/src/main/js/application/.angular-cli.json rename to spring-boot-modules/spring-boot-angular/src/main/js/application/.angular-cli.json diff --git a/spring-boot-angular/src/main/js/application/.editorconfig b/spring-boot-modules/spring-boot-angular/src/main/js/application/.editorconfig similarity index 100% rename from spring-boot-angular/src/main/js/application/.editorconfig rename to spring-boot-modules/spring-boot-angular/src/main/js/application/.editorconfig diff --git a/spring-boot-angular/src/main/js/application/.gitignore b/spring-boot-modules/spring-boot-angular/src/main/js/application/.gitignore similarity index 100% rename from spring-boot-angular/src/main/js/application/.gitignore rename to spring-boot-modules/spring-boot-angular/src/main/js/application/.gitignore diff --git a/spring-boot-angular/src/main/js/application/README.md b/spring-boot-modules/spring-boot-angular/src/main/js/application/README.md similarity index 100% rename from spring-boot-angular/src/main/js/application/README.md rename to spring-boot-modules/spring-boot-angular/src/main/js/application/README.md diff --git a/spring-boot-angular/src/main/js/application/e2e/app.e2e-spec.ts b/spring-boot-modules/spring-boot-angular/src/main/js/application/e2e/app.e2e-spec.ts similarity index 100% rename from spring-boot-angular/src/main/js/application/e2e/app.e2e-spec.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/application/e2e/app.e2e-spec.ts diff --git a/spring-boot-angular/src/main/js/application/e2e/app.po.ts b/spring-boot-modules/spring-boot-angular/src/main/js/application/e2e/app.po.ts similarity index 100% rename from spring-boot-angular/src/main/js/application/e2e/app.po.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/application/e2e/app.po.ts diff --git a/spring-boot-angular/src/main/js/application/e2e/tsconfig.e2e.json b/spring-boot-modules/spring-boot-angular/src/main/js/application/e2e/tsconfig.e2e.json similarity index 100% rename from spring-boot-angular/src/main/js/application/e2e/tsconfig.e2e.json rename to spring-boot-modules/spring-boot-angular/src/main/js/application/e2e/tsconfig.e2e.json diff --git a/spring-boot-angular/src/main/js/application/karma.conf.js b/spring-boot-modules/spring-boot-angular/src/main/js/application/karma.conf.js similarity index 100% rename from spring-boot-angular/src/main/js/application/karma.conf.js rename to spring-boot-modules/spring-boot-angular/src/main/js/application/karma.conf.js diff --git a/spring-boot-angular/src/main/js/application/package-lock.json b/spring-boot-modules/spring-boot-angular/src/main/js/application/package-lock.json similarity index 100% rename from spring-boot-angular/src/main/js/application/package-lock.json rename to spring-boot-modules/spring-boot-angular/src/main/js/application/package-lock.json diff --git a/spring-boot-angular/src/main/js/application/package.json b/spring-boot-modules/spring-boot-angular/src/main/js/application/package.json similarity index 100% rename from spring-boot-angular/src/main/js/application/package.json rename to spring-boot-modules/spring-boot-angular/src/main/js/application/package.json diff --git a/spring-boot-angular/src/main/js/application/protractor.conf.js b/spring-boot-modules/spring-boot-angular/src/main/js/application/protractor.conf.js similarity index 100% rename from spring-boot-angular/src/main/js/application/protractor.conf.js rename to spring-boot-modules/spring-boot-angular/src/main/js/application/protractor.conf.js diff --git a/spring-boot-angular/src/main/js/application/src/app/app-routing.module.ts b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/app-routing.module.ts similarity index 100% rename from spring-boot-angular/src/main/js/application/src/app/app-routing.module.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/app-routing.module.ts diff --git a/spring-boot-angular/src/main/js/application/src/app/app.component.css b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/app.component.css similarity index 100% rename from spring-boot-angular/src/main/js/application/src/app/app.component.css rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/app.component.css diff --git a/spring-boot-angular/src/main/js/application/src/app/app.component.html b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/app.component.html similarity index 100% rename from spring-boot-angular/src/main/js/application/src/app/app.component.html rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/app.component.html diff --git a/spring-boot-angular/src/main/js/application/src/app/app.component.spec.ts b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/app.component.spec.ts similarity index 100% rename from spring-boot-angular/src/main/js/application/src/app/app.component.spec.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/app.component.spec.ts diff --git a/spring-boot-angular/src/main/js/application/src/app/app.component.ts b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/app.component.ts similarity index 100% rename from spring-boot-angular/src/main/js/application/src/app/app.component.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/app.component.ts diff --git a/spring-boot-angular/src/main/js/application/src/app/app.module.ts b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/app.module.ts similarity index 100% rename from spring-boot-angular/src/main/js/application/src/app/app.module.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/app.module.ts diff --git a/spring-boot-angular/src/main/js/application/src/app/model/user.ts b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/model/user.ts similarity index 100% rename from spring-boot-angular/src/main/js/application/src/app/model/user.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/model/user.ts diff --git a/spring-boot-angular/src/main/js/application/src/app/service/user.service.spec.ts b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/service/user.service.spec.ts similarity index 100% rename from spring-boot-angular/src/main/js/application/src/app/service/user.service.spec.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/service/user.service.spec.ts diff --git a/spring-boot-angular/src/main/js/application/src/app/service/user.service.ts b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/service/user.service.ts similarity index 100% rename from spring-boot-angular/src/main/js/application/src/app/service/user.service.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/service/user.service.ts diff --git a/spring-boot-angular/src/main/js/application/src/app/user-form/user-form.component.css b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/user-form/user-form.component.css similarity index 100% rename from spring-boot-angular/src/main/js/application/src/app/user-form/user-form.component.css rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/user-form/user-form.component.css diff --git a/spring-boot-angular/src/main/js/application/src/app/user-form/user-form.component.html b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/user-form/user-form.component.html similarity index 100% rename from spring-boot-angular/src/main/js/application/src/app/user-form/user-form.component.html rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/user-form/user-form.component.html diff --git a/spring-boot-angular/src/main/js/application/src/app/user-form/user-form.component.spec.ts b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/user-form/user-form.component.spec.ts similarity index 100% rename from spring-boot-angular/src/main/js/application/src/app/user-form/user-form.component.spec.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/user-form/user-form.component.spec.ts diff --git a/spring-boot-angular/src/main/js/application/src/app/user-form/user-form.component.ts b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/user-form/user-form.component.ts similarity index 100% rename from spring-boot-angular/src/main/js/application/src/app/user-form/user-form.component.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/user-form/user-form.component.ts diff --git a/spring-boot-angular/src/main/js/application/src/app/user-list/user-list.component.css b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/user-list/user-list.component.css similarity index 100% rename from spring-boot-angular/src/main/js/application/src/app/user-list/user-list.component.css rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/user-list/user-list.component.css diff --git a/spring-boot-angular/src/main/js/application/src/app/user-list/user-list.component.html b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/user-list/user-list.component.html similarity index 100% rename from spring-boot-angular/src/main/js/application/src/app/user-list/user-list.component.html rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/user-list/user-list.component.html diff --git a/spring-boot-angular/src/main/js/application/src/app/user-list/user-list.component.spec.ts b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/user-list/user-list.component.spec.ts similarity index 100% rename from spring-boot-angular/src/main/js/application/src/app/user-list/user-list.component.spec.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/user-list/user-list.component.spec.ts diff --git a/spring-boot-angular/src/main/js/application/src/app/user-list/user-list.component.ts b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/user-list/user-list.component.ts similarity index 100% rename from spring-boot-angular/src/main/js/application/src/app/user-list/user-list.component.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/app/user-list/user-list.component.ts diff --git a/spring-boot-angular/src/main/js/application/src/assets/.gitkeep b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/assets/.gitkeep similarity index 100% rename from spring-boot-angular/src/main/js/application/src/assets/.gitkeep rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/assets/.gitkeep diff --git a/spring-boot-angular/src/main/js/application/src/environments/environment.prod.ts b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/environments/environment.prod.ts similarity index 100% rename from spring-boot-angular/src/main/js/application/src/environments/environment.prod.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/environments/environment.prod.ts diff --git a/spring-boot-angular/src/main/js/application/src/environments/environment.ts b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/environments/environment.ts similarity index 100% rename from spring-boot-angular/src/main/js/application/src/environments/environment.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/environments/environment.ts diff --git a/spring-boot-angular/src/main/js/application/src/favicon.ico b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/favicon.ico similarity index 100% rename from spring-boot-angular/src/main/js/application/src/favicon.ico rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/favicon.ico diff --git a/spring-boot-angular/src/main/js/application/src/index.html b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/index.html similarity index 98% rename from spring-boot-angular/src/main/js/application/src/index.html rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/index.html index 1ce7ff1ca6..398190f439 100644 --- a/spring-boot-angular/src/main/js/application/src/index.html +++ b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/index.html @@ -14,4 +14,4 @@ - \ No newline at end of file + diff --git a/spring-boot-angular/src/main/js/application/src/main.ts b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/main.ts similarity index 100% rename from spring-boot-angular/src/main/js/application/src/main.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/main.ts diff --git a/spring-boot-angular/src/main/js/application/src/polyfills.ts b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/polyfills.ts similarity index 100% rename from spring-boot-angular/src/main/js/application/src/polyfills.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/polyfills.ts diff --git a/spring-boot-angular/src/main/js/application/src/styles.css b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/styles.css similarity index 100% rename from spring-boot-angular/src/main/js/application/src/styles.css rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/styles.css diff --git a/spring-boot-angular/src/main/js/application/src/tsconfig.app.json b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/tsconfig.app.json similarity index 100% rename from spring-boot-angular/src/main/js/application/src/tsconfig.app.json rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/tsconfig.app.json diff --git a/spring-boot-angular/src/main/js/application/src/tsconfig.spec.json b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/tsconfig.spec.json similarity index 100% rename from spring-boot-angular/src/main/js/application/src/tsconfig.spec.json rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/tsconfig.spec.json diff --git a/spring-boot-angular/src/main/js/application/src/typings.d.ts b/spring-boot-modules/spring-boot-angular/src/main/js/application/src/typings.d.ts similarity index 100% rename from spring-boot-angular/src/main/js/application/src/typings.d.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/application/src/typings.d.ts diff --git a/spring-boot-angular/src/main/js/application/tsconfig.json b/spring-boot-modules/spring-boot-angular/src/main/js/application/tsconfig.json similarity index 100% rename from spring-boot-angular/src/main/js/application/tsconfig.json rename to spring-boot-modules/spring-boot-angular/src/main/js/application/tsconfig.json diff --git a/spring-boot-angular/src/main/js/application/tslint.json b/spring-boot-modules/spring-boot-angular/src/main/js/application/tslint.json similarity index 100% rename from spring-boot-angular/src/main/js/application/tslint.json rename to spring-boot-modules/spring-boot-angular/src/main/js/application/tslint.json diff --git a/spring-boot-angular/src/main/js/ecommerce/.editorconfig b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/.editorconfig similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/.editorconfig rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/.editorconfig diff --git a/spring-boot-angular/src/main/js/ecommerce/README.md b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/README.md similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/README.md rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/README.md diff --git a/spring-boot-angular/src/main/js/ecommerce/angular.json b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/angular.json similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/angular.json rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/angular.json diff --git a/spring-boot-angular/src/main/js/ecommerce/e2e/protractor.conf.js b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/e2e/protractor.conf.js similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/e2e/protractor.conf.js rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/e2e/protractor.conf.js diff --git a/spring-boot-angular/src/main/js/ecommerce/e2e/src/app.e2e-spec.ts b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/e2e/src/app.e2e-spec.ts similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/e2e/src/app.e2e-spec.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/e2e/src/app.e2e-spec.ts diff --git a/spring-boot-angular/src/main/js/ecommerce/e2e/src/app.po.ts b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/e2e/src/app.po.ts similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/e2e/src/app.po.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/e2e/src/app.po.ts diff --git a/spring-boot-angular/src/main/js/ecommerce/e2e/tsconfig.e2e.json b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/e2e/tsconfig.e2e.json similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/e2e/tsconfig.e2e.json rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/e2e/tsconfig.e2e.json diff --git a/spring-boot-angular/src/main/js/ecommerce/package-lock.json b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/package-lock.json similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/package-lock.json rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/package-lock.json diff --git a/spring-boot-angular/src/main/js/ecommerce/package.json b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/package.json similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/package.json rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/package.json diff --git a/spring-boot-angular/src/main/js/ecommerce/proxy-conf.json b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/proxy-conf.json similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/proxy-conf.json rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/proxy-conf.json diff --git a/spring-boot-angular/src/main/js/ecommerce/src/app/app.component.css b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/app.component.css similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/app/app.component.css rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/app.component.css diff --git a/spring-boot-angular/src/main/js/ecommerce/src/app/app.component.html b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/app.component.html similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/app/app.component.html rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/app.component.html diff --git a/spring-boot-angular/src/main/js/ecommerce/src/app/app.component.spec.ts b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/app.component.spec.ts similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/app/app.component.spec.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/app.component.spec.ts diff --git a/spring-boot-angular/src/main/js/ecommerce/src/app/app.component.ts b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/app.component.ts similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/app/app.component.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/app.component.ts diff --git a/spring-boot-angular/src/main/js/ecommerce/src/app/app.module.ts b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/app.module.ts similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/app/app.module.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/app.module.ts diff --git a/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/ecommerce.component.css b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/ecommerce.component.css similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/ecommerce.component.css rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/ecommerce.component.css diff --git a/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/ecommerce.component.html b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/ecommerce.component.html similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/ecommerce.component.html rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/ecommerce.component.html diff --git a/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/ecommerce.component.spec.ts b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/ecommerce.component.spec.ts similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/ecommerce.component.spec.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/ecommerce.component.spec.ts diff --git a/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/ecommerce.component.ts b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/ecommerce.component.ts similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/ecommerce.component.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/ecommerce.component.ts diff --git a/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/models/product-order.model.ts b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/models/product-order.model.ts similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/models/product-order.model.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/models/product-order.model.ts diff --git a/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/models/product-orders.model.ts b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/models/product-orders.model.ts similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/models/product-orders.model.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/models/product-orders.model.ts diff --git a/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/models/product.model.ts b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/models/product.model.ts similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/models/product.model.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/models/product.model.ts diff --git a/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/orders/orders.component.css b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/orders/orders.component.css similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/orders/orders.component.css rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/orders/orders.component.css diff --git a/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/orders/orders.component.html b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/orders/orders.component.html similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/orders/orders.component.html rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/orders/orders.component.html diff --git a/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/orders/orders.component.spec.ts b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/orders/orders.component.spec.ts similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/orders/orders.component.spec.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/orders/orders.component.spec.ts diff --git a/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/orders/orders.component.ts b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/orders/orders.component.ts similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/orders/orders.component.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/orders/orders.component.ts diff --git a/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/products/products.component.css b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/products/products.component.css similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/products/products.component.css rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/products/products.component.css diff --git a/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/products/products.component.html b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/products/products.component.html similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/products/products.component.html rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/products/products.component.html diff --git a/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/products/products.component.spec.ts b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/products/products.component.spec.ts similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/products/products.component.spec.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/products/products.component.spec.ts diff --git a/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/products/products.component.ts b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/products/products.component.ts similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/products/products.component.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/products/products.component.ts diff --git a/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/services/EcommerceService.ts b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/services/EcommerceService.ts similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/services/EcommerceService.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/services/EcommerceService.ts diff --git a/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/shopping-cart/shopping-cart.component.css b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/shopping-cart/shopping-cart.component.css similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/shopping-cart/shopping-cart.component.css rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/shopping-cart/shopping-cart.component.css diff --git a/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/shopping-cart/shopping-cart.component.html b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/shopping-cart/shopping-cart.component.html similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/shopping-cart/shopping-cart.component.html rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/shopping-cart/shopping-cart.component.html diff --git a/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/shopping-cart/shopping-cart.component.spec.ts b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/shopping-cart/shopping-cart.component.spec.ts similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/shopping-cart/shopping-cart.component.spec.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/shopping-cart/shopping-cart.component.spec.ts diff --git a/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/shopping-cart/shopping-cart.component.ts b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/shopping-cart/shopping-cart.component.ts similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/shopping-cart/shopping-cart.component.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/app/ecommerce/shopping-cart/shopping-cart.component.ts diff --git a/spring-boot-angular/src/main/js/ecommerce/src/assets/.gitkeep b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/assets/.gitkeep similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/assets/.gitkeep rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/assets/.gitkeep diff --git a/spring-boot-angular/src/main/js/ecommerce/src/browserslist b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/browserslist similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/browserslist rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/browserslist diff --git a/spring-boot-angular/src/main/js/ecommerce/src/environments/environment.prod.ts b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/environments/environment.prod.ts similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/environments/environment.prod.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/environments/environment.prod.ts diff --git a/spring-boot-angular/src/main/js/ecommerce/src/environments/environment.ts b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/environments/environment.ts similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/environments/environment.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/environments/environment.ts diff --git a/spring-boot-angular/src/main/js/ecommerce/src/favicon.ico b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/favicon.ico similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/favicon.ico rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/favicon.ico diff --git a/spring-boot-angular/src/main/js/ecommerce/src/index.html b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/index.html similarity index 69% rename from spring-boot-angular/src/main/js/ecommerce/src/index.html rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/index.html index 3faefb6e8c..2578673a0f 100644 --- a/spring-boot-angular/src/main/js/ecommerce/src/index.html +++ b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/index.html @@ -6,7 +6,7 @@ - + diff --git a/spring-boot-angular/src/main/js/ecommerce/src/karma.conf.js b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/karma.conf.js similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/karma.conf.js rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/karma.conf.js diff --git a/spring-boot-angular/src/main/js/ecommerce/src/main.ts b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/main.ts similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/main.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/main.ts diff --git a/spring-boot-angular/src/main/js/ecommerce/src/polyfills.ts b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/polyfills.ts similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/polyfills.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/polyfills.ts diff --git a/spring-boot-angular/src/main/js/ecommerce/src/styles.css b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/styles.css similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/styles.css rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/styles.css diff --git a/spring-boot-angular/src/main/js/ecommerce/src/test.ts b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/test.ts similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/test.ts rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/test.ts diff --git a/spring-boot-angular/src/main/js/ecommerce/src/tsconfig.app.json b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/tsconfig.app.json similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/tsconfig.app.json rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/tsconfig.app.json diff --git a/spring-boot-angular/src/main/js/ecommerce/src/tsconfig.spec.json b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/tsconfig.spec.json similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/tsconfig.spec.json rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/tsconfig.spec.json diff --git a/spring-boot-angular/src/main/js/ecommerce/src/tslint.json b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/tslint.json similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/src/tslint.json rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/src/tslint.json diff --git a/spring-boot-angular/src/main/js/ecommerce/tsconfig.json b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/tsconfig.json similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/tsconfig.json rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/tsconfig.json diff --git a/spring-boot-angular/src/main/js/ecommerce/tslint.json b/spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/tslint.json similarity index 100% rename from spring-boot-angular/src/main/js/ecommerce/tslint.json rename to spring-boot-modules/spring-boot-angular/src/main/js/ecommerce/tslint.json diff --git a/spring-boot-angular/src/main/resources/application.properties b/spring-boot-modules/spring-boot-angular/src/main/resources/application.properties similarity index 100% rename from spring-boot-angular/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-angular/src/main/resources/application.properties diff --git a/core-kotlin-2/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-angular/src/main/resources/logback.xml similarity index 100% rename from core-kotlin-2/src/main/resources/logback.xml rename to spring-boot-modules/spring-boot-angular/src/main/resources/logback.xml diff --git a/spring-boot-angular/src/test/java/com/baeldung/ecommerce/EcommerceApplicationIntegrationTest.java b/spring-boot-modules/spring-boot-angular/src/test/java/com/baeldung/ecommerce/EcommerceApplicationIntegrationTest.java similarity index 100% rename from spring-boot-angular/src/test/java/com/baeldung/ecommerce/EcommerceApplicationIntegrationTest.java rename to spring-boot-modules/spring-boot-angular/src/test/java/com/baeldung/ecommerce/EcommerceApplicationIntegrationTest.java diff --git a/spring-boot-angular/src/test/java/org/baeldung/SpringContextTest.java b/spring-boot-modules/spring-boot-angular/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-boot-angular/src/test/java/org/baeldung/SpringContextTest.java rename to spring-boot-modules/spring-boot-angular/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-boot-artifacts/README.md b/spring-boot-modules/spring-boot-artifacts/README.md similarity index 100% rename from spring-boot-artifacts/README.md rename to spring-boot-modules/spring-boot-artifacts/README.md diff --git a/spring-boot-artifacts/pom.xml b/spring-boot-modules/spring-boot-artifacts/pom.xml similarity index 99% rename from spring-boot-artifacts/pom.xml rename to spring-boot-modules/spring-boot-artifacts/pom.xml index 97d3c53b49..d6d3886c3e 100644 --- a/spring-boot-artifacts/pom.xml +++ b/spring-boot-modules/spring-boot-artifacts/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/spring-boot-artifacts/src/main/java/com/baeldung/webjar/TestController.java b/spring-boot-modules/spring-boot-artifacts/src/main/java/com/baeldung/webjar/TestController.java similarity index 100% rename from spring-boot-artifacts/src/main/java/com/baeldung/webjar/TestController.java rename to spring-boot-modules/spring-boot-artifacts/src/main/java/com/baeldung/webjar/TestController.java diff --git a/spring-boot-artifacts/src/main/java/com/baeldung/webjar/WebjarsdemoApplication.java b/spring-boot-modules/spring-boot-artifacts/src/main/java/com/baeldung/webjar/WebjarsdemoApplication.java similarity index 100% rename from spring-boot-artifacts/src/main/java/com/baeldung/webjar/WebjarsdemoApplication.java rename to spring-boot-modules/spring-boot-artifacts/src/main/java/com/baeldung/webjar/WebjarsdemoApplication.java diff --git a/spring-boot-artifacts/src/main/resources/application.properties b/spring-boot-modules/spring-boot-artifacts/src/main/resources/application.properties similarity index 100% rename from spring-boot-artifacts/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-artifacts/src/main/resources/application.properties diff --git a/core-kotlin/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-artifacts/src/main/resources/logback.xml similarity index 100% rename from core-kotlin/src/main/resources/logback.xml rename to spring-boot-modules/spring-boot-artifacts/src/main/resources/logback.xml diff --git a/spring-boot-artifacts/src/main/resources/templates/index.html b/spring-boot-modules/spring-boot-artifacts/src/main/resources/templates/index.html similarity index 100% rename from spring-boot-artifacts/src/main/resources/templates/index.html rename to spring-boot-modules/spring-boot-artifacts/src/main/resources/templates/index.html diff --git a/spring-boot-artifacts/src/test/java/com/baeldung/webjar/WebjarsdemoApplicationIntegrationTest.java b/spring-boot-modules/spring-boot-artifacts/src/test/java/com/baeldung/webjar/WebjarsdemoApplicationIntegrationTest.java similarity index 100% rename from spring-boot-artifacts/src/test/java/com/baeldung/webjar/WebjarsdemoApplicationIntegrationTest.java rename to spring-boot-modules/spring-boot-artifacts/src/test/java/com/baeldung/webjar/WebjarsdemoApplicationIntegrationTest.java diff --git a/spring-boot-autoconfiguration/.gitignore b/spring-boot-modules/spring-boot-autoconfiguration/.gitignore similarity index 100% rename from spring-boot-autoconfiguration/.gitignore rename to spring-boot-modules/spring-boot-autoconfiguration/.gitignore diff --git a/spring-boot-autoconfiguration/README.md b/spring-boot-modules/spring-boot-autoconfiguration/README.md similarity index 100% rename from spring-boot-autoconfiguration/README.md rename to spring-boot-modules/spring-boot-autoconfiguration/README.md diff --git a/spring-boot-autoconfiguration/pom.xml b/spring-boot-modules/spring-boot-autoconfiguration/pom.xml similarity index 98% rename from spring-boot-autoconfiguration/pom.xml rename to spring-boot-modules/spring-boot-autoconfiguration/pom.xml index a39bf0f071..34db784176 100644 --- a/spring-boot-autoconfiguration/pom.xml +++ b/spring-boot-modules/spring-boot-autoconfiguration/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-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/MySQLAutoconfiguration.java b/spring-boot-modules/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/MySQLAutoconfiguration.java similarity index 100% rename from spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/MySQLAutoconfiguration.java rename to spring-boot-modules/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/MySQLAutoconfiguration.java diff --git a/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/annotationprocessor/AnnotationProcessorApplication.java b/spring-boot-modules/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/annotationprocessor/AnnotationProcessorApplication.java similarity index 100% rename from spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/annotationprocessor/AnnotationProcessorApplication.java rename to spring-boot-modules/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/annotationprocessor/AnnotationProcessorApplication.java diff --git a/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/annotationprocessor/DatabaseProperties.java b/spring-boot-modules/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/annotationprocessor/DatabaseProperties.java similarity index 100% rename from spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/annotationprocessor/DatabaseProperties.java rename to spring-boot-modules/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/annotationprocessor/DatabaseProperties.java diff --git a/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/example/AutoconfigurationApplication.java b/spring-boot-modules/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/example/AutoconfigurationApplication.java similarity index 100% rename from spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/example/AutoconfigurationApplication.java rename to spring-boot-modules/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/example/AutoconfigurationApplication.java diff --git a/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/example/MyUser.java b/spring-boot-modules/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/example/MyUser.java similarity index 100% rename from spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/example/MyUser.java rename to spring-boot-modules/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/example/MyUser.java diff --git a/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/example/MyUserRepository.java b/spring-boot-modules/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/example/MyUserRepository.java similarity index 100% rename from spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/example/MyUserRepository.java rename to spring-boot-modules/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/example/MyUserRepository.java diff --git a/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/service/CustomService.java b/spring-boot-modules/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/service/CustomService.java similarity index 100% rename from spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/service/CustomService.java rename to spring-boot-modules/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/service/CustomService.java diff --git a/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/service/DefaultService.java b/spring-boot-modules/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/service/DefaultService.java similarity index 100% rename from spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/service/DefaultService.java rename to spring-boot-modules/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/service/DefaultService.java diff --git a/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/service/SimpleService.java b/spring-boot-modules/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/service/SimpleService.java similarity index 100% rename from spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/service/SimpleService.java rename to spring-boot-modules/spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/service/SimpleService.java diff --git a/spring-boot-autoconfiguration/src/main/resources/META-INF/spring.factories b/spring-boot-modules/spring-boot-autoconfiguration/src/main/resources/META-INF/spring.factories similarity index 100% rename from spring-boot-autoconfiguration/src/main/resources/META-INF/spring.factories rename to spring-boot-modules/spring-boot-autoconfiguration/src/main/resources/META-INF/spring.factories diff --git a/spring-boot-autoconfiguration/src/main/resources/application.properties b/spring-boot-modules/spring-boot-autoconfiguration/src/main/resources/application.properties similarity index 100% rename from spring-boot-autoconfiguration/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-autoconfiguration/src/main/resources/application.properties diff --git a/spring-boot-angular/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-autoconfiguration/src/main/resources/logback.xml similarity index 100% rename from spring-boot-angular/src/main/resources/logback.xml rename to spring-boot-modules/spring-boot-autoconfiguration/src/main/resources/logback.xml diff --git a/spring-boot-autoconfiguration/src/main/resources/mysql.properties b/spring-boot-modules/spring-boot-autoconfiguration/src/main/resources/mysql.properties similarity index 100% rename from spring-boot-autoconfiguration/src/main/resources/mysql.properties rename to spring-boot-modules/spring-boot-autoconfiguration/src/main/resources/mysql.properties diff --git a/spring-boot-autoconfiguration/src/test/java/com/baeldung/SpringContextLiveTest.java b/spring-boot-modules/spring-boot-autoconfiguration/src/test/java/com/baeldung/SpringContextLiveTest.java similarity index 100% rename from spring-boot-autoconfiguration/src/test/java/com/baeldung/SpringContextLiveTest.java rename to spring-boot-modules/spring-boot-autoconfiguration/src/test/java/com/baeldung/SpringContextLiveTest.java diff --git a/spring-boot-autoconfiguration/src/test/java/com/baeldung/autoconfiguration/AutoconfigurationLiveTest.java b/spring-boot-modules/spring-boot-autoconfiguration/src/test/java/com/baeldung/autoconfiguration/AutoconfigurationLiveTest.java similarity index 100% rename from spring-boot-autoconfiguration/src/test/java/com/baeldung/autoconfiguration/AutoconfigurationLiveTest.java rename to spring-boot-modules/spring-boot-autoconfiguration/src/test/java/com/baeldung/autoconfiguration/AutoconfigurationLiveTest.java diff --git a/spring-boot-autoconfiguration/src/test/java/com/baeldung/autoconfiguration/ConditionalOnBeanIntegrationTest.java b/spring-boot-modules/spring-boot-autoconfiguration/src/test/java/com/baeldung/autoconfiguration/ConditionalOnBeanIntegrationTest.java similarity index 100% rename from spring-boot-autoconfiguration/src/test/java/com/baeldung/autoconfiguration/ConditionalOnBeanIntegrationTest.java rename to spring-boot-modules/spring-boot-autoconfiguration/src/test/java/com/baeldung/autoconfiguration/ConditionalOnBeanIntegrationTest.java diff --git a/spring-boot-autoconfiguration/src/test/java/com/baeldung/autoconfiguration/ConditionalOnClassIntegrationTest.java b/spring-boot-modules/spring-boot-autoconfiguration/src/test/java/com/baeldung/autoconfiguration/ConditionalOnClassIntegrationTest.java similarity index 100% rename from spring-boot-autoconfiguration/src/test/java/com/baeldung/autoconfiguration/ConditionalOnClassIntegrationTest.java rename to spring-boot-modules/spring-boot-autoconfiguration/src/test/java/com/baeldung/autoconfiguration/ConditionalOnClassIntegrationTest.java diff --git a/spring-boot-autoconfiguration/src/test/java/com/baeldung/autoconfiguration/ConditionalOnPropertyIntegrationTest.java b/spring-boot-modules/spring-boot-autoconfiguration/src/test/java/com/baeldung/autoconfiguration/ConditionalOnPropertyIntegrationTest.java similarity index 100% rename from spring-boot-autoconfiguration/src/test/java/com/baeldung/autoconfiguration/ConditionalOnPropertyIntegrationTest.java rename to spring-boot-modules/spring-boot-autoconfiguration/src/test/java/com/baeldung/autoconfiguration/ConditionalOnPropertyIntegrationTest.java diff --git a/spring-boot-autoconfiguration/src/test/java/com/baeldung/autoconfiguration/SpringContextLiveTest.java b/spring-boot-modules/spring-boot-autoconfiguration/src/test/java/com/baeldung/autoconfiguration/SpringContextLiveTest.java similarity index 100% rename from spring-boot-autoconfiguration/src/test/java/com/baeldung/autoconfiguration/SpringContextLiveTest.java rename to spring-boot-modules/spring-boot-autoconfiguration/src/test/java/com/baeldung/autoconfiguration/SpringContextLiveTest.java diff --git a/spring-boot-autoconfiguration/src/test/java/com/baeldung/autoconfiguration/annotationprocessor/DatabasePropertiesIntegrationTest.java b/spring-boot-modules/spring-boot-autoconfiguration/src/test/java/com/baeldung/autoconfiguration/annotationprocessor/DatabasePropertiesIntegrationTest.java similarity index 100% rename from spring-boot-autoconfiguration/src/test/java/com/baeldung/autoconfiguration/annotationprocessor/DatabasePropertiesIntegrationTest.java rename to spring-boot-modules/spring-boot-autoconfiguration/src/test/java/com/baeldung/autoconfiguration/annotationprocessor/DatabasePropertiesIntegrationTest.java diff --git a/spring-boot-autoconfiguration/src/test/resources/ConditionalOnPropertyTest.properties b/spring-boot-modules/spring-boot-autoconfiguration/src/test/resources/ConditionalOnPropertyTest.properties similarity index 100% rename from spring-boot-autoconfiguration/src/test/resources/ConditionalOnPropertyTest.properties rename to spring-boot-modules/spring-boot-autoconfiguration/src/test/resources/ConditionalOnPropertyTest.properties diff --git a/spring-boot-autoconfiguration/src/test/resources/databaseproperties-test.properties b/spring-boot-modules/spring-boot-autoconfiguration/src/test/resources/databaseproperties-test.properties similarity index 100% rename from spring-boot-autoconfiguration/src/test/resources/databaseproperties-test.properties rename to spring-boot-modules/spring-boot-autoconfiguration/src/test/resources/databaseproperties-test.properties diff --git a/spring-boot-bootstrap/.gitignore b/spring-boot-modules/spring-boot-bootstrap/.gitignore similarity index 100% rename from spring-boot-bootstrap/.gitignore rename to spring-boot-modules/spring-boot-bootstrap/.gitignore diff --git a/spring-boot-bootstrap/README.md b/spring-boot-modules/spring-boot-bootstrap/README.md similarity index 100% rename from spring-boot-bootstrap/README.md rename to spring-boot-modules/spring-boot-bootstrap/README.md diff --git a/spring-boot-bootstrap/cloudfoundry/manifest.yml b/spring-boot-modules/spring-boot-bootstrap/cloudfoundry/manifest.yml similarity index 100% rename from spring-boot-bootstrap/cloudfoundry/manifest.yml rename to spring-boot-modules/spring-boot-bootstrap/cloudfoundry/manifest.yml diff --git a/spring-boot-bootstrap/openshift/configmap.yml b/spring-boot-modules/spring-boot-bootstrap/openshift/configmap.yml similarity index 100% rename from spring-boot-bootstrap/openshift/configmap.yml rename to spring-boot-modules/spring-boot-bootstrap/openshift/configmap.yml diff --git a/spring-boot-bootstrap/pom.xml b/spring-boot-modules/spring-boot-bootstrap/pom.xml similarity index 99% rename from spring-boot-bootstrap/pom.xml rename to spring-boot-modules/spring-boot-bootstrap/pom.xml index a81908d8b6..1dc75c7e61 100644 --- a/spring-boot-bootstrap/pom.xml +++ b/spring-boot-modules/spring-boot-bootstrap/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/spring-boot-bootstrap/src/main/appengine/app.yaml b/spring-boot-modules/spring-boot-bootstrap/src/main/appengine/app.yaml similarity index 100% rename from spring-boot-bootstrap/src/main/appengine/app.yaml rename to spring-boot-modules/spring-boot-bootstrap/src/main/appengine/app.yaml diff --git a/spring-boot-bootstrap/src/main/fabric8/deployment.yml b/spring-boot-modules/spring-boot-bootstrap/src/main/fabric8/deployment.yml similarity index 100% rename from spring-boot-bootstrap/src/main/fabric8/deployment.yml rename to spring-boot-modules/spring-boot-bootstrap/src/main/fabric8/deployment.yml diff --git a/spring-boot-bootstrap/src/main/java/com/baeldung/Application.java b/spring-boot-modules/spring-boot-bootstrap/src/main/java/com/baeldung/Application.java similarity index 100% rename from spring-boot-bootstrap/src/main/java/com/baeldung/Application.java rename to spring-boot-modules/spring-boot-bootstrap/src/main/java/com/baeldung/Application.java diff --git a/spring-boot-bootstrap/src/main/java/com/baeldung/cloud/config/CloudDataSourceConfig.java b/spring-boot-modules/spring-boot-bootstrap/src/main/java/com/baeldung/cloud/config/CloudDataSourceConfig.java similarity index 100% rename from spring-boot-bootstrap/src/main/java/com/baeldung/cloud/config/CloudDataSourceConfig.java rename to spring-boot-modules/spring-boot-bootstrap/src/main/java/com/baeldung/cloud/config/CloudDataSourceConfig.java diff --git a/spring-boot-bootstrap/src/main/java/com/baeldung/config/SecurityConfig.java b/spring-boot-modules/spring-boot-bootstrap/src/main/java/com/baeldung/config/SecurityConfig.java similarity index 100% rename from spring-boot-bootstrap/src/main/java/com/baeldung/config/SecurityConfig.java rename to spring-boot-modules/spring-boot-bootstrap/src/main/java/com/baeldung/config/SecurityConfig.java diff --git a/spring-boot-bootstrap/src/main/java/com/baeldung/persistence/model/Book.java b/spring-boot-modules/spring-boot-bootstrap/src/main/java/com/baeldung/persistence/model/Book.java similarity index 100% rename from spring-boot-bootstrap/src/main/java/com/baeldung/persistence/model/Book.java rename to spring-boot-modules/spring-boot-bootstrap/src/main/java/com/baeldung/persistence/model/Book.java diff --git a/spring-boot-bootstrap/src/main/java/com/baeldung/persistence/repo/BookRepository.java b/spring-boot-modules/spring-boot-bootstrap/src/main/java/com/baeldung/persistence/repo/BookRepository.java similarity index 100% rename from spring-boot-bootstrap/src/main/java/com/baeldung/persistence/repo/BookRepository.java rename to spring-boot-modules/spring-boot-bootstrap/src/main/java/com/baeldung/persistence/repo/BookRepository.java diff --git a/spring-boot-bootstrap/src/main/java/com/baeldung/springbootconfiguration/Application.java b/spring-boot-modules/spring-boot-bootstrap/src/main/java/com/baeldung/springbootconfiguration/Application.java similarity index 100% rename from spring-boot-bootstrap/src/main/java/com/baeldung/springbootconfiguration/Application.java rename to spring-boot-modules/spring-boot-bootstrap/src/main/java/com/baeldung/springbootconfiguration/Application.java diff --git a/spring-boot-bootstrap/src/main/java/com/baeldung/springbootconfiguration/PersonService.java b/spring-boot-modules/spring-boot-bootstrap/src/main/java/com/baeldung/springbootconfiguration/PersonService.java similarity index 100% rename from spring-boot-bootstrap/src/main/java/com/baeldung/springbootconfiguration/PersonService.java rename to spring-boot-modules/spring-boot-bootstrap/src/main/java/com/baeldung/springbootconfiguration/PersonService.java diff --git a/spring-boot-bootstrap/src/main/java/com/baeldung/springbootconfiguration/PersonServiceImpl.java b/spring-boot-modules/spring-boot-bootstrap/src/main/java/com/baeldung/springbootconfiguration/PersonServiceImpl.java similarity index 100% rename from spring-boot-bootstrap/src/main/java/com/baeldung/springbootconfiguration/PersonServiceImpl.java rename to spring-boot-modules/spring-boot-bootstrap/src/main/java/com/baeldung/springbootconfiguration/PersonServiceImpl.java diff --git a/spring-boot-bootstrap/src/main/java/com/baeldung/web/BookController.java b/spring-boot-modules/spring-boot-bootstrap/src/main/java/com/baeldung/web/BookController.java similarity index 100% rename from spring-boot-bootstrap/src/main/java/com/baeldung/web/BookController.java rename to spring-boot-modules/spring-boot-bootstrap/src/main/java/com/baeldung/web/BookController.java diff --git a/spring-boot-bootstrap/src/main/java/com/baeldung/web/RestExceptionHandler.java b/spring-boot-modules/spring-boot-bootstrap/src/main/java/com/baeldung/web/RestExceptionHandler.java similarity index 100% rename from spring-boot-bootstrap/src/main/java/com/baeldung/web/RestExceptionHandler.java rename to spring-boot-modules/spring-boot-bootstrap/src/main/java/com/baeldung/web/RestExceptionHandler.java diff --git a/spring-boot-bootstrap/src/main/java/com/baeldung/web/SimpleController.java b/spring-boot-modules/spring-boot-bootstrap/src/main/java/com/baeldung/web/SimpleController.java similarity index 100% rename from spring-boot-bootstrap/src/main/java/com/baeldung/web/SimpleController.java rename to spring-boot-modules/spring-boot-bootstrap/src/main/java/com/baeldung/web/SimpleController.java diff --git a/spring-boot-bootstrap/src/main/java/com/baeldung/web/exception/BookIdMismatchException.java b/spring-boot-modules/spring-boot-bootstrap/src/main/java/com/baeldung/web/exception/BookIdMismatchException.java similarity index 100% rename from spring-boot-bootstrap/src/main/java/com/baeldung/web/exception/BookIdMismatchException.java rename to spring-boot-modules/spring-boot-bootstrap/src/main/java/com/baeldung/web/exception/BookIdMismatchException.java diff --git a/spring-boot-bootstrap/src/main/java/com/baeldung/web/exception/BookNotFoundException.java b/spring-boot-modules/spring-boot-bootstrap/src/main/java/com/baeldung/web/exception/BookNotFoundException.java similarity index 100% rename from spring-boot-bootstrap/src/main/java/com/baeldung/web/exception/BookNotFoundException.java rename to spring-boot-modules/spring-boot-bootstrap/src/main/java/com/baeldung/web/exception/BookNotFoundException.java diff --git a/spring-boot-bootstrap/src/main/resources/application-beanstalk.properties b/spring-boot-modules/spring-boot-bootstrap/src/main/resources/application-beanstalk.properties similarity index 100% rename from spring-boot-bootstrap/src/main/resources/application-beanstalk.properties rename to spring-boot-modules/spring-boot-bootstrap/src/main/resources/application-beanstalk.properties diff --git a/spring-boot-bootstrap/src/main/resources/application-gcp.properties b/spring-boot-modules/spring-boot-bootstrap/src/main/resources/application-gcp.properties similarity index 100% rename from spring-boot-bootstrap/src/main/resources/application-gcp.properties rename to spring-boot-modules/spring-boot-bootstrap/src/main/resources/application-gcp.properties diff --git a/spring-boot-bootstrap/src/main/resources/application-local.properties b/spring-boot-modules/spring-boot-bootstrap/src/main/resources/application-local.properties similarity index 100% rename from spring-boot-bootstrap/src/main/resources/application-local.properties rename to spring-boot-modules/spring-boot-bootstrap/src/main/resources/application-local.properties diff --git a/spring-boot-modules/spring-boot-bootstrap/src/main/resources/application-mysql.properties b/spring-boot-modules/spring-boot-bootstrap/src/main/resources/application-mysql.properties new file mode 100644 index 0000000000..069bf2e9d6 --- /dev/null +++ b/spring-boot-modules/spring-boot-bootstrap/src/main/resources/application-mysql.properties @@ -0,0 +1,4 @@ +spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect +spring.application.name = spring-boot-bootstrap +spring.datasource.username = ${SPRING_DATASOURCE_USER} +spring.datasource.password = ${SPRING_DATASOURCE_PASSWORD} \ No newline at end of file diff --git a/spring-boot-bootstrap/src/main/resources/application.properties b/spring-boot-modules/spring-boot-bootstrap/src/main/resources/application.properties similarity index 100% rename from spring-boot-bootstrap/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-bootstrap/src/main/resources/application.properties diff --git a/spring-boot-bootstrap/src/main/resources/logback-gcp.xml b/spring-boot-modules/spring-boot-bootstrap/src/main/resources/logback-gcp.xml similarity index 100% rename from spring-boot-bootstrap/src/main/resources/logback-gcp.xml rename to spring-boot-modules/spring-boot-bootstrap/src/main/resources/logback-gcp.xml diff --git a/spring-boot-artifacts/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-bootstrap/src/main/resources/logback.xml similarity index 100% rename from spring-boot-artifacts/src/main/resources/logback.xml rename to spring-boot-modules/spring-boot-bootstrap/src/main/resources/logback.xml diff --git a/spring-boot-bootstrap/src/main/resources/spring-cloud-bootstrap.properties b/spring-boot-modules/spring-boot-bootstrap/src/main/resources/spring-cloud-bootstrap.properties similarity index 100% rename from spring-boot-bootstrap/src/main/resources/spring-cloud-bootstrap.properties rename to spring-boot-modules/spring-boot-bootstrap/src/main/resources/spring-cloud-bootstrap.properties diff --git a/spring-boot-bootstrap/src/main/resources/templates/error.html b/spring-boot-modules/spring-boot-bootstrap/src/main/resources/templates/error.html similarity index 100% rename from spring-boot-bootstrap/src/main/resources/templates/error.html rename to spring-boot-modules/spring-boot-bootstrap/src/main/resources/templates/error.html diff --git a/spring-boot-bootstrap/src/main/resources/templates/home.html b/spring-boot-modules/spring-boot-bootstrap/src/main/resources/templates/home.html similarity index 100% rename from spring-boot-bootstrap/src/main/resources/templates/home.html rename to spring-boot-modules/spring-boot-bootstrap/src/main/resources/templates/home.html diff --git a/spring-boot-bootstrap/src/test/java/com/baeldung/SpringBootBootstrapLiveTest.java b/spring-boot-modules/spring-boot-bootstrap/src/test/java/com/baeldung/SpringBootBootstrapLiveTest.java similarity index 100% rename from spring-boot-bootstrap/src/test/java/com/baeldung/SpringBootBootstrapLiveTest.java rename to spring-boot-modules/spring-boot-bootstrap/src/test/java/com/baeldung/SpringBootBootstrapLiveTest.java diff --git a/spring-boot-bootstrap/src/test/java/com/baeldung/SpringContextTest.java b/spring-boot-modules/spring-boot-bootstrap/src/test/java/com/baeldung/SpringContextTest.java similarity index 100% rename from spring-boot-bootstrap/src/test/java/com/baeldung/SpringContextTest.java rename to spring-boot-modules/spring-boot-bootstrap/src/test/java/com/baeldung/SpringContextTest.java diff --git a/spring-boot-camel/README.md b/spring-boot-modules/spring-boot-camel/README.md similarity index 100% rename from spring-boot-camel/README.md rename to spring-boot-modules/spring-boot-camel/README.md diff --git a/spring-boot-camel/pom.xml b/spring-boot-modules/spring-boot-camel/pom.xml similarity index 95% rename from spring-boot-camel/pom.xml rename to spring-boot-modules/spring-boot-camel/pom.xml index 8bab0ed5c8..7c1e28b3ee 100644 --- a/spring-boot-camel/pom.xml +++ b/spring-boot-modules/spring-boot-camel/pom.xml @@ -8,8 +8,8 @@ spring-boot-camel - com.baeldung - parent-modules + com.baeldung.spring-boot-modules + spring-boot-modules 1.0.0-SNAPSHOT diff --git a/spring-boot-camel/src/main/java/com/baeldung/camel/Application.java b/spring-boot-modules/spring-boot-camel/src/main/java/com/baeldung/camel/Application.java similarity index 100% rename from spring-boot-camel/src/main/java/com/baeldung/camel/Application.java rename to spring-boot-modules/spring-boot-camel/src/main/java/com/baeldung/camel/Application.java diff --git a/spring-boot-camel/src/main/java/com/baeldung/camel/ExampleServices.java b/spring-boot-modules/spring-boot-camel/src/main/java/com/baeldung/camel/ExampleServices.java similarity index 100% rename from spring-boot-camel/src/main/java/com/baeldung/camel/ExampleServices.java rename to spring-boot-modules/spring-boot-camel/src/main/java/com/baeldung/camel/ExampleServices.java diff --git a/spring-boot-camel/src/main/java/com/baeldung/camel/MyBean.java b/spring-boot-modules/spring-boot-camel/src/main/java/com/baeldung/camel/MyBean.java similarity index 100% rename from spring-boot-camel/src/main/java/com/baeldung/camel/MyBean.java rename to spring-boot-modules/spring-boot-camel/src/main/java/com/baeldung/camel/MyBean.java diff --git a/spring-boot-camel/src/main/resources/application.properties b/spring-boot-modules/spring-boot-camel/src/main/resources/application.properties similarity index 100% rename from spring-boot-camel/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-camel/src/main/resources/application.properties diff --git a/spring-boot-camel/src/main/resources/application.yml b/spring-boot-modules/spring-boot-camel/src/main/resources/application.yml similarity index 100% rename from spring-boot-camel/src/main/resources/application.yml rename to spring-boot-modules/spring-boot-camel/src/main/resources/application.yml diff --git a/spring-boot-camel/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-camel/src/main/resources/logback.xml similarity index 100% rename from spring-boot-camel/src/main/resources/logback.xml rename to spring-boot-modules/spring-boot-camel/src/main/resources/logback.xml diff --git a/spring-boot-camel/src/test/java/org/baeldung/SpringContextTest.java b/spring-boot-modules/spring-boot-camel/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-boot-camel/src/test/java/org/baeldung/SpringContextTest.java rename to spring-boot-modules/spring-boot-camel/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-boot-cli/README.md b/spring-boot-modules/spring-boot-cli/README.md similarity index 100% rename from spring-boot-cli/README.md rename to spring-boot-modules/spring-boot-cli/README.md diff --git a/spring-boot-cli/bash/groovy.sh b/spring-boot-modules/spring-boot-cli/bash/groovy.sh similarity index 100% rename from spring-boot-cli/bash/groovy.sh rename to spring-boot-modules/spring-boot-cli/bash/groovy.sh diff --git a/spring-boot-cli/bash/setup.sh b/spring-boot-modules/spring-boot-cli/bash/setup.sh similarity index 100% rename from spring-boot-cli/bash/setup.sh rename to spring-boot-modules/spring-boot-cli/bash/setup.sh diff --git a/spring-boot-cli/groovy/data/DataConfig.groovy b/spring-boot-modules/spring-boot-cli/groovy/data/DataConfig.groovy similarity index 100% rename from spring-boot-cli/groovy/data/DataConfig.groovy rename to spring-boot-modules/spring-boot-cli/groovy/data/DataConfig.groovy diff --git a/spring-boot-cli/groovy/security/Security.groovy b/spring-boot-modules/spring-boot-cli/groovy/security/Security.groovy similarity index 100% rename from spring-boot-cli/groovy/security/Security.groovy rename to spring-boot-modules/spring-boot-cli/groovy/security/Security.groovy diff --git a/spring-boot-cli/groovy/test/Test.groovy b/spring-boot-modules/spring-boot-cli/groovy/test/Test.groovy similarity index 100% rename from spring-boot-cli/groovy/test/Test.groovy rename to spring-boot-modules/spring-boot-cli/groovy/test/Test.groovy diff --git a/spring-boot-cli/groovy/yml/Application.groovy b/spring-boot-modules/spring-boot-cli/groovy/yml/Application.groovy similarity index 100% rename from spring-boot-cli/groovy/yml/Application.groovy rename to spring-boot-modules/spring-boot-cli/groovy/yml/Application.groovy diff --git a/spring-boot-cli/groovy/yml/config/application.yml b/spring-boot-modules/spring-boot-cli/groovy/yml/config/application.yml similarity index 100% rename from spring-boot-cli/groovy/yml/config/application.yml rename to spring-boot-modules/spring-boot-cli/groovy/yml/config/application.yml diff --git a/spring-boot-client/.gitignore b/spring-boot-modules/spring-boot-client/.gitignore similarity index 100% rename from spring-boot-client/.gitignore rename to spring-boot-modules/spring-boot-client/.gitignore diff --git a/spring-boot-client/README.MD b/spring-boot-modules/spring-boot-client/README.MD similarity index 100% rename from spring-boot-client/README.MD rename to spring-boot-modules/spring-boot-client/README.MD diff --git a/spring-boot-client/pom.xml b/spring-boot-modules/spring-boot-client/pom.xml similarity index 98% rename from spring-boot-client/pom.xml rename to spring-boot-modules/spring-boot-client/pom.xml index 2cfd413e93..40a8690953 100644 --- a/spring-boot-client/pom.xml +++ b/spring-boot-modules/spring-boot-client/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-boot-client/src/main/java/org/baeldung/boot/Application.java b/spring-boot-modules/spring-boot-client/src/main/java/org/baeldung/boot/Application.java similarity index 100% rename from spring-boot-client/src/main/java/org/baeldung/boot/Application.java rename to spring-boot-modules/spring-boot-client/src/main/java/org/baeldung/boot/Application.java diff --git a/spring-boot-client/src/main/java/org/baeldung/boot/client/Details.java b/spring-boot-modules/spring-boot-client/src/main/java/org/baeldung/boot/client/Details.java similarity index 100% rename from spring-boot-client/src/main/java/org/baeldung/boot/client/Details.java rename to spring-boot-modules/spring-boot-client/src/main/java/org/baeldung/boot/client/Details.java diff --git a/spring-boot-client/src/main/java/org/baeldung/boot/client/DetailsServiceClient.java b/spring-boot-modules/spring-boot-client/src/main/java/org/baeldung/boot/client/DetailsServiceClient.java similarity index 100% rename from spring-boot-client/src/main/java/org/baeldung/boot/client/DetailsServiceClient.java rename to spring-boot-modules/spring-boot-client/src/main/java/org/baeldung/boot/client/DetailsServiceClient.java diff --git a/spring-boot-client/src/main/java/org/baeldung/websocket/client/Message.java b/spring-boot-modules/spring-boot-client/src/main/java/org/baeldung/websocket/client/Message.java similarity index 100% rename from spring-boot-client/src/main/java/org/baeldung/websocket/client/Message.java rename to spring-boot-modules/spring-boot-client/src/main/java/org/baeldung/websocket/client/Message.java diff --git a/spring-boot-client/src/main/java/org/baeldung/websocket/client/MyStompSessionHandler.java b/spring-boot-modules/spring-boot-client/src/main/java/org/baeldung/websocket/client/MyStompSessionHandler.java similarity index 100% rename from spring-boot-client/src/main/java/org/baeldung/websocket/client/MyStompSessionHandler.java rename to spring-boot-modules/spring-boot-client/src/main/java/org/baeldung/websocket/client/MyStompSessionHandler.java diff --git a/spring-boot-client/src/main/java/org/baeldung/websocket/client/StompClient.java b/spring-boot-modules/spring-boot-client/src/main/java/org/baeldung/websocket/client/StompClient.java similarity index 100% rename from spring-boot-client/src/main/java/org/baeldung/websocket/client/StompClient.java rename to spring-boot-modules/spring-boot-client/src/main/java/org/baeldung/websocket/client/StompClient.java diff --git a/spring-boot-client/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-client/src/main/resources/logback.xml similarity index 100% rename from spring-boot-client/src/main/resources/logback.xml rename to spring-boot-modules/spring-boot-client/src/main/resources/logback.xml diff --git a/spring-boot-client/src/test/java/com/baeldung/websocket/client/MyStompSessionHandlerIntegrationTest.java b/spring-boot-modules/spring-boot-client/src/test/java/com/baeldung/websocket/client/MyStompSessionHandlerIntegrationTest.java similarity index 100% rename from spring-boot-client/src/test/java/com/baeldung/websocket/client/MyStompSessionHandlerIntegrationTest.java rename to spring-boot-modules/spring-boot-client/src/test/java/com/baeldung/websocket/client/MyStompSessionHandlerIntegrationTest.java diff --git a/spring-boot-client/src/test/java/org/baeldung/SpringContextTest.java b/spring-boot-modules/spring-boot-client/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-boot-client/src/test/java/org/baeldung/SpringContextTest.java rename to spring-boot-modules/spring-boot-client/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-boot-client/src/test/java/org/baeldung/boot/client/DetailsServiceClientIntegrationTest.java b/spring-boot-modules/spring-boot-client/src/test/java/org/baeldung/boot/client/DetailsServiceClientIntegrationTest.java similarity index 100% rename from spring-boot-client/src/test/java/org/baeldung/boot/client/DetailsServiceClientIntegrationTest.java rename to spring-boot-modules/spring-boot-client/src/test/java/org/baeldung/boot/client/DetailsServiceClientIntegrationTest.java diff --git a/spring-boot-config-jpa-error/README.md b/spring-boot-modules/spring-boot-config-jpa-error/README.md similarity index 100% rename from spring-boot-config-jpa-error/README.md rename to spring-boot-modules/spring-boot-config-jpa-error/README.md diff --git a/spring-boot-config-jpa-error/data-jpa-application/README.md b/spring-boot-modules/spring-boot-config-jpa-error/data-jpa-application/README.md similarity index 100% rename from spring-boot-config-jpa-error/data-jpa-application/README.md rename to spring-boot-modules/spring-boot-config-jpa-error/data-jpa-application/README.md diff --git a/spring-boot-config-jpa-error/data-jpa-application/pom.xml b/spring-boot-modules/spring-boot-config-jpa-error/data-jpa-application/pom.xml similarity index 100% rename from spring-boot-config-jpa-error/data-jpa-application/pom.xml rename to spring-boot-modules/spring-boot-config-jpa-error/data-jpa-application/pom.xml diff --git a/spring-boot-config-jpa-error/data-jpa-application/src/main/java/com/baeldung/data/jpa/ApplicationFound.java b/spring-boot-modules/spring-boot-config-jpa-error/data-jpa-application/src/main/java/com/baeldung/data/jpa/ApplicationFound.java similarity index 100% rename from spring-boot-config-jpa-error/data-jpa-application/src/main/java/com/baeldung/data/jpa/ApplicationFound.java rename to spring-boot-modules/spring-boot-config-jpa-error/data-jpa-application/src/main/java/com/baeldung/data/jpa/ApplicationFound.java diff --git a/spring-boot-config-jpa-error/data-jpa-application/src/main/java/com/baeldung/data/jpa/application/ApplicationNotFound.java b/spring-boot-modules/spring-boot-config-jpa-error/data-jpa-application/src/main/java/com/baeldung/data/jpa/application/ApplicationNotFound.java similarity index 100% rename from spring-boot-config-jpa-error/data-jpa-application/src/main/java/com/baeldung/data/jpa/application/ApplicationNotFound.java rename to spring-boot-modules/spring-boot-config-jpa-error/data-jpa-application/src/main/java/com/baeldung/data/jpa/application/ApplicationNotFound.java diff --git a/spring-boot-config-jpa-error/data-jpa-application/src/test/java/com/baeldung/data/jpa/DataJpaUnitTest.java b/spring-boot-modules/spring-boot-config-jpa-error/data-jpa-application/src/test/java/com/baeldung/data/jpa/DataJpaUnitTest.java similarity index 100% rename from spring-boot-config-jpa-error/data-jpa-application/src/test/java/com/baeldung/data/jpa/DataJpaUnitTest.java rename to spring-boot-modules/spring-boot-config-jpa-error/data-jpa-application/src/test/java/com/baeldung/data/jpa/DataJpaUnitTest.java diff --git a/spring-boot-config-jpa-error/data-jpa-library/README.md b/spring-boot-modules/spring-boot-config-jpa-error/data-jpa-library/README.md similarity index 100% rename from spring-boot-config-jpa-error/data-jpa-library/README.md rename to spring-boot-modules/spring-boot-config-jpa-error/data-jpa-library/README.md diff --git a/spring-boot-config-jpa-error/data-jpa-library/pom.xml b/spring-boot-modules/spring-boot-config-jpa-error/data-jpa-library/pom.xml similarity index 100% rename from spring-boot-config-jpa-error/data-jpa-library/pom.xml rename to spring-boot-modules/spring-boot-config-jpa-error/data-jpa-library/pom.xml diff --git a/spring-boot-config-jpa-error/data-jpa-library/src/main/java/com/baeldung/data/jpa/libarary/model/Example.java b/spring-boot-modules/spring-boot-config-jpa-error/data-jpa-library/src/main/java/com/baeldung/data/jpa/libarary/model/Example.java similarity index 100% rename from spring-boot-config-jpa-error/data-jpa-library/src/main/java/com/baeldung/data/jpa/libarary/model/Example.java rename to spring-boot-modules/spring-boot-config-jpa-error/data-jpa-library/src/main/java/com/baeldung/data/jpa/libarary/model/Example.java diff --git a/spring-boot-config-jpa-error/data-jpa-library/src/test/java/com/baeldung/data/jpa/TestApplication.java b/spring-boot-modules/spring-boot-config-jpa-error/data-jpa-library/src/test/java/com/baeldung/data/jpa/TestApplication.java similarity index 100% rename from spring-boot-config-jpa-error/data-jpa-library/src/test/java/com/baeldung/data/jpa/TestApplication.java rename to spring-boot-modules/spring-boot-config-jpa-error/data-jpa-library/src/test/java/com/baeldung/data/jpa/TestApplication.java diff --git a/spring-boot-config-jpa-error/data-jpa-library/src/test/java/com/baeldung/data/jpa/libarary/DataJpaUnitTest.java b/spring-boot-modules/spring-boot-config-jpa-error/data-jpa-library/src/test/java/com/baeldung/data/jpa/libarary/DataJpaUnitTest.java similarity index 100% rename from spring-boot-config-jpa-error/data-jpa-library/src/test/java/com/baeldung/data/jpa/libarary/DataJpaUnitTest.java rename to spring-boot-modules/spring-boot-config-jpa-error/data-jpa-library/src/test/java/com/baeldung/data/jpa/libarary/DataJpaUnitTest.java diff --git a/spring-boot-config-jpa-error/pom.xml b/spring-boot-modules/spring-boot-config-jpa-error/pom.xml similarity index 96% rename from spring-boot-config-jpa-error/pom.xml rename to spring-boot-modules/spring-boot-config-jpa-error/pom.xml index 4b99f9be93..f578957a1a 100644 --- a/spring-boot-config-jpa-error/pom.xml +++ b/spring-boot-modules/spring-boot-config-jpa-error/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2/pom.xml + ../../parent-boot-2/pom.xml diff --git a/spring-boot-crud/README.md b/spring-boot-modules/spring-boot-crud/README.md similarity index 100% rename from spring-boot-crud/README.md rename to spring-boot-modules/spring-boot-crud/README.md diff --git a/spring-boot-crud/pom.xml b/spring-boot-modules/spring-boot-crud/pom.xml similarity index 95% rename from spring-boot-crud/pom.xml rename to spring-boot-modules/spring-boot-crud/pom.xml index e78e939f0c..676d522f84 100644 --- a/spring-boot-crud/pom.xml +++ b/spring-boot-modules/spring-boot-crud/pom.xml @@ -1,86 +1,86 @@ - - - 4.0.0 - spring-boot-crud - spring-boot-crud - - - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../parent-boot-2 - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.springframework.boot - spring-boot-starter-test - - - org.mockito - mockito-core - test - - - com.h2database - h2 - runtime - - - - - spring-boot-crud - - - src/main/resources - true - - - - - org.springframework.boot - spring-boot-maven-plugin - - exec - - - - org.apache.maven.plugins - maven-assembly-plugin - - - jar-with-dependencies - - - - - make-assembly - package - - single - - - - - - - - - UTF-8 - - - + + + 4.0.0 + spring-boot-crud + spring-boot-crud + + + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../../parent-boot-2 + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-test + + + org.mockito + mockito-core + test + + + com.h2database + h2 + runtime + + + + + spring-boot-crud + + + src/main/resources + true + + + + + org.springframework.boot + spring-boot-maven-plugin + + exec + + + + org.apache.maven.plugins + maven-assembly-plugin + + + jar-with-dependencies + + + + + make-assembly + package + + single + + + + + + + + + UTF-8 + + + diff --git a/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java b/spring-boot-modules/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java similarity index 97% rename from spring-boot-crud/src/main/java/com/baeldung/crud/Application.java rename to spring-boot-modules/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java index 0b686e90e9..a56a2a04c0 100644 --- a/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java +++ b/spring-boot-modules/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java @@ -1,23 +1,23 @@ -package com.baeldung.crud; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.domain.EntityScan; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.data.jpa.repository.config.EnableJpaRepositories; -import org.springframework.transaction.annotation.EnableTransactionManagement; - -@SpringBootApplication -@EnableAutoConfiguration -@ComponentScan(basePackages={"com.baeldung.crud"}) -@EnableJpaRepositories(basePackages="com.baeldung.crud.repositories") -@EnableTransactionManagement -@EntityScan(basePackages="com.baeldung.crud.entities") -public class Application { - - public static void main(String[] args) { - SpringApplication.run(Application.class, args); - } - -} +package com.baeldung.crud; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.domain.EntityScan; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +@SpringBootApplication +@EnableAutoConfiguration +@ComponentScan(basePackages={"com.baeldung.crud"}) +@EnableJpaRepositories(basePackages="com.baeldung.crud.repositories") +@EnableTransactionManagement +@EntityScan(basePackages="com.baeldung.crud.entities") +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } + +} diff --git a/spring-boot-crud/src/main/java/com/baeldung/crud/controllers/UserController.java b/spring-boot-modules/spring-boot-crud/src/main/java/com/baeldung/crud/controllers/UserController.java similarity index 97% rename from spring-boot-crud/src/main/java/com/baeldung/crud/controllers/UserController.java rename to spring-boot-modules/spring-boot-crud/src/main/java/com/baeldung/crud/controllers/UserController.java index 9a6cb477aa..726be6a384 100644 --- a/spring-boot-crud/src/main/java/com/baeldung/crud/controllers/UserController.java +++ b/spring-boot-modules/spring-boot-crud/src/main/java/com/baeldung/crud/controllers/UserController.java @@ -1,68 +1,68 @@ -package com.baeldung.crud.controllers; - -import javax.validation.Valid; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; - -import com.baeldung.crud.entities.User; -import com.baeldung.crud.repositories.UserRepository; - -@Controller -public class UserController { - - private final UserRepository userRepository; - - @Autowired - public UserController(UserRepository userRepository) { - this.userRepository = userRepository; - } - - @GetMapping("/signup") - public String showSignUpForm(User user) { - return "add-user"; - } - - @PostMapping("/adduser") - public String addUser(@Valid User user, BindingResult result, Model model) { - if (result.hasErrors()) { - return "add-user"; - } - - userRepository.save(user); - model.addAttribute("users", userRepository.findAll()); - return "index"; - } - - @GetMapping("/edit/{id}") - public String showUpdateForm(@PathVariable("id") long id, Model model) { - User user = userRepository.findById(id).orElseThrow(() -> new IllegalArgumentException("Invalid user Id:" + id)); - model.addAttribute("user", user); - return "update-user"; - } - - @PostMapping("/update/{id}") - public String updateUser(@PathVariable("id") long id, @Valid User user, BindingResult result, Model model) { - if (result.hasErrors()) { - user.setId(id); - return "update-user"; - } - - userRepository.save(user); - model.addAttribute("users", userRepository.findAll()); - return "index"; - } - - @GetMapping("/delete/{id}") - public String deleteUser(@PathVariable("id") long id, Model model) { - User user = userRepository.findById(id).orElseThrow(() -> new IllegalArgumentException("Invalid user Id:" + id)); - userRepository.delete(user); - model.addAttribute("users", userRepository.findAll()); - return "index"; - } -} +package com.baeldung.crud.controllers; + +import javax.validation.Valid; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; + +import com.baeldung.crud.entities.User; +import com.baeldung.crud.repositories.UserRepository; + +@Controller +public class UserController { + + private final UserRepository userRepository; + + @Autowired + public UserController(UserRepository userRepository) { + this.userRepository = userRepository; + } + + @GetMapping("/signup") + public String showSignUpForm(User user) { + return "add-user"; + } + + @PostMapping("/adduser") + public String addUser(@Valid User user, BindingResult result, Model model) { + if (result.hasErrors()) { + return "add-user"; + } + + userRepository.save(user); + model.addAttribute("users", userRepository.findAll()); + return "index"; + } + + @GetMapping("/edit/{id}") + public String showUpdateForm(@PathVariable("id") long id, Model model) { + User user = userRepository.findById(id).orElseThrow(() -> new IllegalArgumentException("Invalid user Id:" + id)); + model.addAttribute("user", user); + return "update-user"; + } + + @PostMapping("/update/{id}") + public String updateUser(@PathVariable("id") long id, @Valid User user, BindingResult result, Model model) { + if (result.hasErrors()) { + user.setId(id); + return "update-user"; + } + + userRepository.save(user); + model.addAttribute("users", userRepository.findAll()); + return "index"; + } + + @GetMapping("/delete/{id}") + public String deleteUser(@PathVariable("id") long id, Model model) { + User user = userRepository.findById(id).orElseThrow(() -> new IllegalArgumentException("Invalid user Id:" + id)); + userRepository.delete(user); + model.addAttribute("users", userRepository.findAll()); + return "index"; + } +} diff --git a/spring-boot-crud/src/main/java/com/baeldung/crud/entities/User.java b/spring-boot-modules/spring-boot-crud/src/main/java/com/baeldung/crud/entities/User.java similarity index 95% rename from spring-boot-crud/src/main/java/com/baeldung/crud/entities/User.java rename to spring-boot-modules/spring-boot-crud/src/main/java/com/baeldung/crud/entities/User.java index 2074268179..372327532f 100644 --- a/spring-boot-crud/src/main/java/com/baeldung/crud/entities/User.java +++ b/spring-boot-modules/spring-boot-crud/src/main/java/com/baeldung/crud/entities/User.java @@ -1,56 +1,56 @@ -package com.baeldung.crud.entities; - -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.validation.constraints.NotBlank; - -@Entity -public class User { - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private long id; - @NotBlank(message = "Name is mandatory") - private String name; - - @NotBlank(message = "Email is mandatory") - private String email; - - public User() {} - - public User(String name, String email) { - this.name = name; - this.email = email; - } - - public void setId(long id) { - this.id = id; - } - - public long getId() { - return id; - } - - public void setName(String name) { - this.name = name; - } - - public void setEmail(String email) { - this.email = email; - } - - public String getName() { - return name; - } - - public String getEmail() { - return email; - } - - @Override - public String toString() { - return "User{" + "id=" + id + ", name=" + name + ", email=" + email + '}'; - } -} +package com.baeldung.crud.entities; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.validation.constraints.NotBlank; + +@Entity +public class User { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + @NotBlank(message = "Name is mandatory") + private String name; + + @NotBlank(message = "Email is mandatory") + private String email; + + public User() {} + + public User(String name, String email) { + this.name = name; + this.email = email; + } + + public void setId(long id) { + this.id = id; + } + + public long getId() { + return id; + } + + public void setName(String name) { + this.name = name; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getName() { + return name; + } + + public String getEmail() { + return email; + } + + @Override + public String toString() { + return "User{" + "id=" + id + ", name=" + name + ", email=" + email + '}'; + } +} diff --git a/spring-boot-crud/src/main/java/com/baeldung/crud/repositories/UserRepository.java b/spring-boot-modules/spring-boot-crud/src/main/java/com/baeldung/crud/repositories/UserRepository.java similarity index 96% rename from spring-boot-crud/src/main/java/com/baeldung/crud/repositories/UserRepository.java rename to spring-boot-modules/spring-boot-crud/src/main/java/com/baeldung/crud/repositories/UserRepository.java index 72348463f2..c17ebc56ba 100644 --- a/spring-boot-crud/src/main/java/com/baeldung/crud/repositories/UserRepository.java +++ b/spring-boot-modules/spring-boot-crud/src/main/java/com/baeldung/crud/repositories/UserRepository.java @@ -1,13 +1,13 @@ -package com.baeldung.crud.repositories; - -import com.baeldung.crud.entities.User; -import java.util.List; -import org.springframework.data.repository.CrudRepository; -import org.springframework.stereotype.Repository; - -@Repository -public interface UserRepository extends CrudRepository { - - List findByName(String name); - -} +package com.baeldung.crud.repositories; + +import com.baeldung.crud.entities.User; +import java.util.List; +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface UserRepository extends CrudRepository { + + List findByName(String name); + +} diff --git a/spring-boot-crud/src/main/resources/css/shards.min.css b/spring-boot-modules/spring-boot-crud/src/main/resources/css/shards.min.css similarity index 100% rename from spring-boot-crud/src/main/resources/css/shards.min.css rename to spring-boot-modules/spring-boot-crud/src/main/resources/css/shards.min.css diff --git a/spring-boot-crud/src/main/resources/templates/add-user.html b/spring-boot-modules/spring-boot-crud/src/main/resources/templates/add-user.html similarity index 100% rename from spring-boot-crud/src/main/resources/templates/add-user.html rename to spring-boot-modules/spring-boot-crud/src/main/resources/templates/add-user.html diff --git a/spring-boot-crud/src/main/resources/templates/index.html b/spring-boot-modules/spring-boot-crud/src/main/resources/templates/index.html similarity index 100% rename from spring-boot-crud/src/main/resources/templates/index.html rename to spring-boot-modules/spring-boot-crud/src/main/resources/templates/index.html diff --git a/spring-boot-crud/src/main/resources/templates/update-user.html b/spring-boot-modules/spring-boot-crud/src/main/resources/templates/update-user.html similarity index 100% rename from spring-boot-crud/src/main/resources/templates/update-user.html rename to spring-boot-modules/spring-boot-crud/src/main/resources/templates/update-user.html diff --git a/spring-boot-crud/src/test/java/com/baeldung/crud/UserControllerUnitTest.java b/spring-boot-modules/spring-boot-crud/src/test/java/com/baeldung/crud/UserControllerUnitTest.java similarity index 97% rename from spring-boot-crud/src/test/java/com/baeldung/crud/UserControllerUnitTest.java rename to spring-boot-modules/spring-boot-crud/src/test/java/com/baeldung/crud/UserControllerUnitTest.java index 2de0828ae5..033108c195 100644 --- a/spring-boot-crud/src/test/java/com/baeldung/crud/UserControllerUnitTest.java +++ b/spring-boot-modules/spring-boot-crud/src/test/java/com/baeldung/crud/UserControllerUnitTest.java @@ -1,83 +1,83 @@ -package com.baeldung.crud; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -import org.junit.BeforeClass; -import org.junit.Test; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; - -import com.baeldung.crud.controllers.UserController; -import com.baeldung.crud.entities.User; -import com.baeldung.crud.repositories.UserRepository; - -public class UserControllerUnitTest { - - private static UserController userController; - private static UserRepository mockedUserRepository; - private static BindingResult mockedBindingResult; - private static Model mockedModel; - - @BeforeClass - public static void setUpUserControllerInstance() { - mockedUserRepository = mock(UserRepository.class); - mockedBindingResult = mock(BindingResult.class); - mockedModel = mock(Model.class); - userController = new UserController(mockedUserRepository); - } - - @Test - public void whenCalledshowSignUpForm_thenCorrect() { - User user = new User("John", "john@domain.com"); - - assertThat(userController.showSignUpForm(user)).isEqualTo("add-user"); - } - - @Test - public void whenCalledaddUserAndValidUser_thenCorrect() { - User user = new User("John", "john@domain.com"); - - when(mockedBindingResult.hasErrors()).thenReturn(false); - - assertThat(userController.addUser(user, mockedBindingResult, mockedModel)).isEqualTo("index"); - } - - @Test - public void whenCalledaddUserAndInValidUser_thenCorrect() { - User user = new User("John", "john@domain.com"); - - when(mockedBindingResult.hasErrors()).thenReturn(true); - - assertThat(userController.addUser(user, mockedBindingResult, mockedModel)).isEqualTo("add-user"); - } - - @Test(expected = IllegalArgumentException.class) - public void whenCalledshowUpdateForm_thenIllegalArgumentException() { - assertThat(userController.showUpdateForm(0, mockedModel)).isEqualTo("update-user"); - } - - @Test - public void whenCalledupdateUserAndValidUser_thenCorrect() { - User user = new User("John", "john@domain.com"); - - when(mockedBindingResult.hasErrors()).thenReturn(false); - - assertThat(userController.updateUser(1l, user, mockedBindingResult, mockedModel)).isEqualTo("index"); - } - - @Test - public void whenCalledupdateUserAndInValidUser_thenCorrect() { - User user = new User("John", "john@domain.com"); - - when(mockedBindingResult.hasErrors()).thenReturn(true); - - assertThat(userController.updateUser(1l, user, mockedBindingResult, mockedModel)).isEqualTo("update-user"); - } - - @Test(expected = IllegalArgumentException.class) - public void whenCalleddeleteUser_thenIllegalArgumentException() { - assertThat(userController.deleteUser(1l, mockedModel)).isEqualTo("index"); - } -} +package com.baeldung.crud; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.springframework.ui.Model; +import org.springframework.validation.BindingResult; + +import com.baeldung.crud.controllers.UserController; +import com.baeldung.crud.entities.User; +import com.baeldung.crud.repositories.UserRepository; + +public class UserControllerUnitTest { + + private static UserController userController; + private static UserRepository mockedUserRepository; + private static BindingResult mockedBindingResult; + private static Model mockedModel; + + @BeforeClass + public static void setUpUserControllerInstance() { + mockedUserRepository = mock(UserRepository.class); + mockedBindingResult = mock(BindingResult.class); + mockedModel = mock(Model.class); + userController = new UserController(mockedUserRepository); + } + + @Test + public void whenCalledshowSignUpForm_thenCorrect() { + User user = new User("John", "john@domain.com"); + + assertThat(userController.showSignUpForm(user)).isEqualTo("add-user"); + } + + @Test + public void whenCalledaddUserAndValidUser_thenCorrect() { + User user = new User("John", "john@domain.com"); + + when(mockedBindingResult.hasErrors()).thenReturn(false); + + assertThat(userController.addUser(user, mockedBindingResult, mockedModel)).isEqualTo("index"); + } + + @Test + public void whenCalledaddUserAndInValidUser_thenCorrect() { + User user = new User("John", "john@domain.com"); + + when(mockedBindingResult.hasErrors()).thenReturn(true); + + assertThat(userController.addUser(user, mockedBindingResult, mockedModel)).isEqualTo("add-user"); + } + + @Test(expected = IllegalArgumentException.class) + public void whenCalledshowUpdateForm_thenIllegalArgumentException() { + assertThat(userController.showUpdateForm(0, mockedModel)).isEqualTo("update-user"); + } + + @Test + public void whenCalledupdateUserAndValidUser_thenCorrect() { + User user = new User("John", "john@domain.com"); + + when(mockedBindingResult.hasErrors()).thenReturn(false); + + assertThat(userController.updateUser(1l, user, mockedBindingResult, mockedModel)).isEqualTo("index"); + } + + @Test + public void whenCalledupdateUserAndInValidUser_thenCorrect() { + User user = new User("John", "john@domain.com"); + + when(mockedBindingResult.hasErrors()).thenReturn(true); + + assertThat(userController.updateUser(1l, user, mockedBindingResult, mockedModel)).isEqualTo("update-user"); + } + + @Test(expected = IllegalArgumentException.class) + public void whenCalleddeleteUser_thenIllegalArgumentException() { + assertThat(userController.deleteUser(1l, mockedModel)).isEqualTo("index"); + } +} diff --git a/spring-boot-crud/src/test/java/com/baeldung/crud/UserUnitTest.java b/spring-boot-modules/spring-boot-crud/src/test/java/com/baeldung/crud/UserUnitTest.java similarity index 96% rename from spring-boot-crud/src/test/java/com/baeldung/crud/UserUnitTest.java rename to spring-boot-modules/spring-boot-crud/src/test/java/com/baeldung/crud/UserUnitTest.java index 565f6727c3..3e33e868ad 100644 --- a/spring-boot-crud/src/test/java/com/baeldung/crud/UserUnitTest.java +++ b/spring-boot-modules/spring-boot-crud/src/test/java/com/baeldung/crud/UserUnitTest.java @@ -1,48 +1,48 @@ -package com.baeldung.crud; - -import static org.assertj.core.api.Assertions.assertThat; - -import org.junit.Test; - -import com.baeldung.crud.entities.User; - -public class UserUnitTest { - - @Test - public void whenCalledGetName_thenCorrect() { - User user = new User("Julie", "julie@domain.com"); - - assertThat(user.getName()).isEqualTo("Julie"); - } - - @Test - public void whenCalledGetEmail_thenCorrect() { - User user = new User("Julie", "julie@domain.com"); - - assertThat(user.getEmail()).isEqualTo("julie@domain.com"); - } - - @Test - public void whenCalledSetName_thenCorrect() { - User user = new User("Julie", "julie@domain.com"); - - user.setName("John"); - - assertThat(user.getName()).isEqualTo("John"); - } - - @Test - public void whenCalledSetEmail_thenCorrect() { - User user = new User("Julie", "julie@domain.com"); - - user.setEmail("john@domain.com"); - - assertThat(user.getEmail()).isEqualTo("john@domain.com"); - } - - @Test - public void whenCalledtoString_thenCorrect() { - User user = new User("Julie", "julie@domain.com"); - assertThat(user.toString()).isEqualTo("User{id=0, name=Julie, email=julie@domain.com}"); - } -} +package com.baeldung.crud; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.junit.Test; + +import com.baeldung.crud.entities.User; + +public class UserUnitTest { + + @Test + public void whenCalledGetName_thenCorrect() { + User user = new User("Julie", "julie@domain.com"); + + assertThat(user.getName()).isEqualTo("Julie"); + } + + @Test + public void whenCalledGetEmail_thenCorrect() { + User user = new User("Julie", "julie@domain.com"); + + assertThat(user.getEmail()).isEqualTo("julie@domain.com"); + } + + @Test + public void whenCalledSetName_thenCorrect() { + User user = new User("Julie", "julie@domain.com"); + + user.setName("John"); + + assertThat(user.getName()).isEqualTo("John"); + } + + @Test + public void whenCalledSetEmail_thenCorrect() { + User user = new User("Julie", "julie@domain.com"); + + user.setEmail("john@domain.com"); + + assertThat(user.getEmail()).isEqualTo("john@domain.com"); + } + + @Test + public void whenCalledtoString_thenCorrect() { + User user = new User("Julie", "julie@domain.com"); + assertThat(user.toString()).isEqualTo("User{id=0, name=Julie, email=julie@domain.com}"); + } +} diff --git a/spring-boot-ctx-fluent/README.md b/spring-boot-modules/spring-boot-ctx-fluent/README.md similarity index 100% rename from spring-boot-ctx-fluent/README.md rename to spring-boot-modules/spring-boot-ctx-fluent/README.md diff --git a/spring-boot-ctx-fluent/pom.xml b/spring-boot-modules/spring-boot-ctx-fluent/pom.xml similarity index 93% rename from spring-boot-ctx-fluent/pom.xml rename to spring-boot-modules/spring-boot-ctx-fluent/pom.xml index 782e1fd7f6..872e15d307 100644 --- a/spring-boot-ctx-fluent/pom.xml +++ b/spring-boot-modules/spring-boot-ctx-fluent/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/spring-boot-ctx-fluent/src/main/java/com/baeldung/ctx1/Ctx1Config.java b/spring-boot-modules/spring-boot-ctx-fluent/src/main/java/com/baeldung/ctx1/Ctx1Config.java similarity index 100% rename from spring-boot-ctx-fluent/src/main/java/com/baeldung/ctx1/Ctx1Config.java rename to spring-boot-modules/spring-boot-ctx-fluent/src/main/java/com/baeldung/ctx1/Ctx1Config.java diff --git a/spring-boot-ctx-fluent/src/main/java/com/baeldung/ctx1/Ctx1Controller.java b/spring-boot-modules/spring-boot-ctx-fluent/src/main/java/com/baeldung/ctx1/Ctx1Controller.java similarity index 100% rename from spring-boot-ctx-fluent/src/main/java/com/baeldung/ctx1/Ctx1Controller.java rename to spring-boot-modules/spring-boot-ctx-fluent/src/main/java/com/baeldung/ctx1/Ctx1Controller.java diff --git a/spring-boot-ctx-fluent/src/main/java/com/baeldung/ctx1/GreetingService.java b/spring-boot-modules/spring-boot-ctx-fluent/src/main/java/com/baeldung/ctx1/GreetingService.java similarity index 100% rename from spring-boot-ctx-fluent/src/main/java/com/baeldung/ctx1/GreetingService.java rename to spring-boot-modules/spring-boot-ctx-fluent/src/main/java/com/baeldung/ctx1/GreetingService.java diff --git a/spring-boot-ctx-fluent/src/main/java/com/baeldung/ctx2/Ctx2Config.java b/spring-boot-modules/spring-boot-ctx-fluent/src/main/java/com/baeldung/ctx2/Ctx2Config.java similarity index 100% rename from spring-boot-ctx-fluent/src/main/java/com/baeldung/ctx2/Ctx2Config.java rename to spring-boot-modules/spring-boot-ctx-fluent/src/main/java/com/baeldung/ctx2/Ctx2Config.java diff --git a/spring-boot-ctx-fluent/src/main/java/com/baeldung/ctx2/Ctx2Controller.java b/spring-boot-modules/spring-boot-ctx-fluent/src/main/java/com/baeldung/ctx2/Ctx2Controller.java similarity index 100% rename from spring-boot-ctx-fluent/src/main/java/com/baeldung/ctx2/Ctx2Controller.java rename to spring-boot-modules/spring-boot-ctx-fluent/src/main/java/com/baeldung/ctx2/Ctx2Controller.java diff --git a/spring-boot-ctx-fluent/src/main/java/com/baeldung/parent/App.java b/spring-boot-modules/spring-boot-ctx-fluent/src/main/java/com/baeldung/parent/App.java similarity index 100% rename from spring-boot-ctx-fluent/src/main/java/com/baeldung/parent/App.java rename to spring-boot-modules/spring-boot-ctx-fluent/src/main/java/com/baeldung/parent/App.java diff --git a/spring-boot-ctx-fluent/src/main/java/com/baeldung/parent/HomeService.java b/spring-boot-modules/spring-boot-ctx-fluent/src/main/java/com/baeldung/parent/HomeService.java similarity index 100% rename from spring-boot-ctx-fluent/src/main/java/com/baeldung/parent/HomeService.java rename to spring-boot-modules/spring-boot-ctx-fluent/src/main/java/com/baeldung/parent/HomeService.java diff --git a/spring-boot-ctx-fluent/src/main/java/com/baeldung/parent/IHomeService.java b/spring-boot-modules/spring-boot-ctx-fluent/src/main/java/com/baeldung/parent/IHomeService.java similarity index 100% rename from spring-boot-ctx-fluent/src/main/java/com/baeldung/parent/IHomeService.java rename to spring-boot-modules/spring-boot-ctx-fluent/src/main/java/com/baeldung/parent/IHomeService.java diff --git a/spring-boot-ctx-fluent/src/main/java/com/baeldung/parent/ParentConfig.java b/spring-boot-modules/spring-boot-ctx-fluent/src/main/java/com/baeldung/parent/ParentConfig.java similarity index 100% rename from spring-boot-ctx-fluent/src/main/java/com/baeldung/parent/ParentConfig.java rename to spring-boot-modules/spring-boot-ctx-fluent/src/main/java/com/baeldung/parent/ParentConfig.java diff --git a/spring-boot-ctx-fluent/src/main/resources/ctx1.properties b/spring-boot-modules/spring-boot-ctx-fluent/src/main/resources/ctx1.properties similarity index 100% rename from spring-boot-ctx-fluent/src/main/resources/ctx1.properties rename to spring-boot-modules/spring-boot-ctx-fluent/src/main/resources/ctx1.properties diff --git a/spring-boot-ctx-fluent/src/main/resources/ctx2.properties b/spring-boot-modules/spring-boot-ctx-fluent/src/main/resources/ctx2.properties similarity index 100% rename from spring-boot-ctx-fluent/src/main/resources/ctx2.properties rename to spring-boot-modules/spring-boot-ctx-fluent/src/main/resources/ctx2.properties diff --git a/spring-boot-autoconfiguration/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-ctx-fluent/src/main/resources/logback.xml similarity index 100% rename from spring-boot-autoconfiguration/src/main/resources/logback.xml rename to spring-boot-modules/spring-boot-ctx-fluent/src/main/resources/logback.xml diff --git a/spring-boot-ctx-fluent/src/test/java/org/baeldung/SpringContextTest.java b/spring-boot-modules/spring-boot-ctx-fluent/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-boot-ctx-fluent/src/test/java/org/baeldung/SpringContextTest.java rename to spring-boot-modules/spring-boot-ctx-fluent/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-boot-custom-starter/README.md b/spring-boot-modules/spring-boot-custom-starter/README.md similarity index 100% rename from spring-boot-custom-starter/README.md rename to spring-boot-modules/spring-boot-custom-starter/README.md diff --git a/spring-boot-custom-starter/greeter-library/README.md b/spring-boot-modules/spring-boot-custom-starter/greeter-library/README.md similarity index 100% rename from spring-boot-custom-starter/greeter-library/README.md rename to spring-boot-modules/spring-boot-custom-starter/greeter-library/README.md diff --git a/spring-boot-custom-starter/greeter-library/pom.xml b/spring-boot-modules/spring-boot-custom-starter/greeter-library/pom.xml similarity index 83% rename from spring-boot-custom-starter/greeter-library/pom.xml rename to spring-boot-modules/spring-boot-custom-starter/greeter-library/pom.xml index da30f2e4be..34cc530f2f 100644 --- a/spring-boot-custom-starter/greeter-library/pom.xml +++ b/spring-boot-modules/spring-boot-custom-starter/greeter-library/pom.xml @@ -7,10 +7,9 @@ greeter-library - com.baeldung + com.baeldung.spring-boot-modules spring-boot-custom-starter 0.0.1-SNAPSHOT - ../../spring-boot-custom-starter \ No newline at end of file diff --git a/spring-boot-custom-starter/greeter-library/src/main/java/com/baeldung/greeter/library/Greeter.java b/spring-boot-modules/spring-boot-custom-starter/greeter-library/src/main/java/com/baeldung/greeter/library/Greeter.java similarity index 100% rename from spring-boot-custom-starter/greeter-library/src/main/java/com/baeldung/greeter/library/Greeter.java rename to spring-boot-modules/spring-boot-custom-starter/greeter-library/src/main/java/com/baeldung/greeter/library/Greeter.java diff --git a/spring-boot-custom-starter/greeter-library/src/main/java/com/baeldung/greeter/library/GreeterConfigParams.java b/spring-boot-modules/spring-boot-custom-starter/greeter-library/src/main/java/com/baeldung/greeter/library/GreeterConfigParams.java similarity index 100% rename from spring-boot-custom-starter/greeter-library/src/main/java/com/baeldung/greeter/library/GreeterConfigParams.java rename to spring-boot-modules/spring-boot-custom-starter/greeter-library/src/main/java/com/baeldung/greeter/library/GreeterConfigParams.java diff --git a/spring-boot-custom-starter/greeter-library/src/main/java/com/baeldung/greeter/library/GreetingConfig.java b/spring-boot-modules/spring-boot-custom-starter/greeter-library/src/main/java/com/baeldung/greeter/library/GreetingConfig.java similarity index 100% rename from spring-boot-custom-starter/greeter-library/src/main/java/com/baeldung/greeter/library/GreetingConfig.java rename to spring-boot-modules/spring-boot-custom-starter/greeter-library/src/main/java/com/baeldung/greeter/library/GreetingConfig.java diff --git a/spring-boot-bootstrap/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-custom-starter/greeter-library/src/main/resources/logback.xml similarity index 100% rename from spring-boot-bootstrap/src/main/resources/logback.xml rename to spring-boot-modules/spring-boot-custom-starter/greeter-library/src/main/resources/logback.xml diff --git a/spring-boot-custom-starter/greeter-library/src/test/java/com/baeldung/greeter/GreeterIntegrationTest.java b/spring-boot-modules/spring-boot-custom-starter/greeter-library/src/test/java/com/baeldung/greeter/GreeterIntegrationTest.java similarity index 100% rename from spring-boot-custom-starter/greeter-library/src/test/java/com/baeldung/greeter/GreeterIntegrationTest.java rename to spring-boot-modules/spring-boot-custom-starter/greeter-library/src/test/java/com/baeldung/greeter/GreeterIntegrationTest.java diff --git a/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml b/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml similarity index 94% rename from spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml rename to spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml index 58dd683131..0bba2936a7 100644 --- a/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml +++ b/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml @@ -7,10 +7,9 @@ greeter-spring-boot-autoconfigure - com.baeldung + com.baeldung.spring-boot-modules spring-boot-custom-starter 0.0.1-SNAPSHOT - ../../spring-boot-custom-starter @@ -34,7 +33,7 @@ - com.baeldung + com.baeldung.spring-boot-modules greeter-library ${greeter.version} true diff --git a/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/src/main/java/com/baeldung/greeter/autoconfigure/GreeterAutoConfiguration.java b/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/src/main/java/com/baeldung/greeter/autoconfigure/GreeterAutoConfiguration.java similarity index 100% rename from spring-boot-custom-starter/greeter-spring-boot-autoconfigure/src/main/java/com/baeldung/greeter/autoconfigure/GreeterAutoConfiguration.java rename to spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/src/main/java/com/baeldung/greeter/autoconfigure/GreeterAutoConfiguration.java diff --git a/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/src/main/java/com/baeldung/greeter/autoconfigure/GreeterProperties.java b/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/src/main/java/com/baeldung/greeter/autoconfigure/GreeterProperties.java similarity index 100% rename from spring-boot-custom-starter/greeter-spring-boot-autoconfigure/src/main/java/com/baeldung/greeter/autoconfigure/GreeterProperties.java rename to spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/src/main/java/com/baeldung/greeter/autoconfigure/GreeterProperties.java diff --git a/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories b/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories similarity index 100% rename from spring-boot-custom-starter/greeter-spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories rename to spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories diff --git a/spring-boot-ctx-fluent/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/src/main/resources/logback.xml similarity index 100% rename from spring-boot-ctx-fluent/src/main/resources/logback.xml rename to spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/src/main/resources/logback.xml diff --git a/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/src/test/java/org/baeldung/SpringContextTest.java b/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-boot-custom-starter/greeter-spring-boot-autoconfigure/src/test/java/org/baeldung/SpringContextTest.java rename to spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml b/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml similarity index 91% rename from spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml rename to spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml index bb1e656963..818ce5c107 100644 --- a/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml +++ b/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml @@ -10,12 +10,12 @@ com.baeldung parent-boot-1 0.0.1-SNAPSHOT - ../../spring-boot-custom-starter + ../../../parent-boot-1 - com.baeldung + com.baeldung.spring-boot-modules greeter-spring-boot-starter ${greeter-starter.version} diff --git a/spring-boot-custom-starter/greeter-spring-boot-sample-app/src/main/java/com/baeldung/greeter/sample/GreeterSampleApplication.java b/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-sample-app/src/main/java/com/baeldung/greeter/sample/GreeterSampleApplication.java similarity index 100% rename from spring-boot-custom-starter/greeter-spring-boot-sample-app/src/main/java/com/baeldung/greeter/sample/GreeterSampleApplication.java rename to spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-sample-app/src/main/java/com/baeldung/greeter/sample/GreeterSampleApplication.java diff --git a/spring-boot-custom-starter/greeter-spring-boot-sample-app/src/main/resources/application.properties b/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-sample-app/src/main/resources/application.properties similarity index 100% rename from spring-boot-custom-starter/greeter-spring-boot-sample-app/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-sample-app/src/main/resources/application.properties diff --git a/spring-boot-custom-starter/greeter-library/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-sample-app/src/main/resources/logback.xml similarity index 100% rename from spring-boot-custom-starter/greeter-library/src/main/resources/logback.xml rename to spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-sample-app/src/main/resources/logback.xml diff --git a/spring-boot-custom-starter/greeter-spring-boot-sample-app/src/test/java/com/baeldung/greeter/sample/GreeterSampleApplicationIntegrationTest.java b/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-sample-app/src/test/java/com/baeldung/greeter/sample/GreeterSampleApplicationIntegrationTest.java similarity index 100% rename from spring-boot-custom-starter/greeter-spring-boot-sample-app/src/test/java/com/baeldung/greeter/sample/GreeterSampleApplicationIntegrationTest.java rename to spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-sample-app/src/test/java/com/baeldung/greeter/sample/GreeterSampleApplicationIntegrationTest.java diff --git a/spring-boot-custom-starter/greeter-spring-boot-sample-app/src/test/java/org/baeldung/SpringContextTest.java b/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-sample-app/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-boot-custom-starter/greeter-spring-boot-sample-app/src/test/java/org/baeldung/SpringContextTest.java rename to spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-sample-app/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml b/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml similarity index 90% rename from spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml rename to spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml index d298756b8e..ba2b4101e8 100644 --- a/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml +++ b/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml @@ -7,10 +7,9 @@ greeter-spring-boot-starter - com.baeldung + com.baeldung.spring-boot-modules spring-boot-custom-starter 0.0.1-SNAPSHOT - ../../spring-boot-custom-starter @@ -22,13 +21,13 @@ - com.baeldung + com.baeldung.spring-boot-modules greeter-spring-boot-autoconfigure ${project.version} - com.baeldung + com.baeldung.spring-boot-modules greeter-library ${greeter.version} diff --git a/spring-boot-custom-starter/greeter/pom.xml b/spring-boot-modules/spring-boot-custom-starter/greeter/pom.xml similarity index 90% rename from spring-boot-custom-starter/greeter/pom.xml rename to spring-boot-modules/spring-boot-custom-starter/greeter/pom.xml index 3117cfa355..89119e2e99 100644 --- a/spring-boot-custom-starter/greeter/pom.xml +++ b/spring-boot-modules/spring-boot-custom-starter/greeter/pom.xml @@ -10,7 +10,7 @@ com.baeldung parent-boot-1 0.0.1-SNAPSHOT - ../../parent-boot-1 + ../../../parent-boot-1 \ No newline at end of file diff --git a/spring-boot-custom-starter/pom.xml b/spring-boot-modules/spring-boot-custom-starter/pom.xml similarity index 87% rename from spring-boot-custom-starter/pom.xml rename to spring-boot-modules/spring-boot-custom-starter/pom.xml index 96c0d0a585..596b993f81 100644 --- a/spring-boot-custom-starter/pom.xml +++ b/spring-boot-modules/spring-boot-custom-starter/pom.xml @@ -8,8 +8,8 @@ pom - com.baeldung - parent-modules + com.baeldung.spring-boot-modules + spring-boot-modules 1.0.0-SNAPSHOT diff --git a/spring-boot-data/README.md b/spring-boot-modules/spring-boot-data/README.md similarity index 100% rename from spring-boot-data/README.md rename to spring-boot-modules/spring-boot-data/README.md diff --git a/spring-boot-data/pom.xml b/spring-boot-modules/spring-boot-data/pom.xml similarity index 99% rename from spring-boot-data/pom.xml rename to spring-boot-modules/spring-boot-data/pom.xml index f9e51920c2..f25b4ee472 100644 --- a/spring-boot-data/pom.xml +++ b/spring-boot-modules/spring-boot-data/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/spring-boot-data/src/main/java/com/baeldung/SpringBootDataApplication.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/SpringBootDataApplication.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/SpringBootDataApplication.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/SpringBootDataApplication.java diff --git a/spring-boot-data/src/main/java/com/baeldung/disableautoconfig/SpringDataJPA.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/disableautoconfig/SpringDataJPA.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/disableautoconfig/SpringDataJPA.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/disableautoconfig/SpringDataJPA.java diff --git a/spring-boot-data/src/main/java/com/baeldung/disableautoconfig/SpringDataMongoDB.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/disableautoconfig/SpringDataMongoDB.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/disableautoconfig/SpringDataMongoDB.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/disableautoconfig/SpringDataMongoDB.java diff --git a/spring-boot-data/src/main/java/com/baeldung/disableautoconfig/SpringDataRedis.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/disableautoconfig/SpringDataRedis.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/disableautoconfig/SpringDataRedis.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/disableautoconfig/SpringDataRedis.java diff --git a/spring-boot-data/src/main/java/com/baeldung/javers/README.md b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/javers/README.md similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/javers/README.md rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/javers/README.md diff --git a/spring-boot-data/src/main/java/com/baeldung/javers/SpringBootJaVersApplication.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/javers/SpringBootJaVersApplication.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/javers/SpringBootJaVersApplication.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/javers/SpringBootJaVersApplication.java diff --git a/spring-boot-data/src/main/java/com/baeldung/javers/config/JaversConfiguration.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/javers/config/JaversConfiguration.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/javers/config/JaversConfiguration.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/javers/config/JaversConfiguration.java diff --git a/spring-boot-data/src/main/java/com/baeldung/javers/domain/Address.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/javers/domain/Address.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/javers/domain/Address.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/javers/domain/Address.java diff --git a/spring-boot-data/src/main/java/com/baeldung/javers/domain/Product.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/javers/domain/Product.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/javers/domain/Product.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/javers/domain/Product.java diff --git a/spring-boot-data/src/main/java/com/baeldung/javers/domain/Store.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/javers/domain/Store.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/javers/domain/Store.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/javers/domain/Store.java diff --git a/spring-boot-data/src/main/java/com/baeldung/javers/repo/ProductRepository.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/javers/repo/ProductRepository.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/javers/repo/ProductRepository.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/javers/repo/ProductRepository.java diff --git a/spring-boot-data/src/main/java/com/baeldung/javers/repo/StoreRepository.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/javers/repo/StoreRepository.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/javers/repo/StoreRepository.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/javers/repo/StoreRepository.java diff --git a/spring-boot-data/src/main/java/com/baeldung/javers/service/StoreService.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/javers/service/StoreService.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/javers/service/StoreService.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/javers/service/StoreService.java diff --git a/spring-boot-data/src/main/java/com/baeldung/javers/web/RebrandStoreDto.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/javers/web/RebrandStoreDto.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/javers/web/RebrandStoreDto.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/javers/web/RebrandStoreDto.java diff --git a/spring-boot-data/src/main/java/com/baeldung/javers/web/StoreController.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/javers/web/StoreController.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/javers/web/StoreController.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/javers/web/StoreController.java diff --git a/spring-boot-data/src/main/java/com/baeldung/javers/web/UpdatePriceDto.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/javers/web/UpdatePriceDto.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/javers/web/UpdatePriceDto.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/javers/web/UpdatePriceDto.java diff --git a/spring-boot-data/src/main/java/com/baeldung/jsondateformat/Contact.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/jsondateformat/Contact.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/jsondateformat/Contact.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/jsondateformat/Contact.java diff --git a/spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactApp.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactApp.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactApp.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactApp.java diff --git a/spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactAppConfig.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactAppConfig.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactAppConfig.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactAppConfig.java diff --git a/spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactController.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactController.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactController.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactController.java diff --git a/spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactWithJavaUtilDate.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactWithJavaUtilDate.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactWithJavaUtilDate.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactWithJavaUtilDate.java diff --git a/spring-boot-data/src/main/java/com/baeldung/jsondateformat/PlainContact.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/jsondateformat/PlainContact.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/jsondateformat/PlainContact.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/jsondateformat/PlainContact.java diff --git a/spring-boot-data/src/main/java/com/baeldung/jsondateformat/PlainContactWithJavaUtilDate.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/jsondateformat/PlainContactWithJavaUtilDate.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/jsondateformat/PlainContactWithJavaUtilDate.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/jsondateformat/PlainContactWithJavaUtilDate.java diff --git a/spring-boot-data/src/main/java/com/baeldung/jsonexception/CustomException.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/jsonexception/CustomException.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/jsonexception/CustomException.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/jsonexception/CustomException.java diff --git a/spring-boot-data/src/main/java/com/baeldung/jsonexception/ErrorHandler.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/jsonexception/ErrorHandler.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/jsonexception/ErrorHandler.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/jsonexception/ErrorHandler.java diff --git a/spring-boot-data/src/main/java/com/baeldung/jsonexception/MainController.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/jsonexception/MainController.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/jsonexception/MainController.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/jsonexception/MainController.java diff --git a/spring-boot-data/src/main/java/com/baeldung/propertyeditor/PropertyEditorApplication.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/propertyeditor/PropertyEditorApplication.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/propertyeditor/PropertyEditorApplication.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/propertyeditor/PropertyEditorApplication.java diff --git a/spring-boot-data/src/main/java/com/baeldung/propertyeditor/PropertyEditorRestController.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/propertyeditor/PropertyEditorRestController.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/propertyeditor/PropertyEditorRestController.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/propertyeditor/PropertyEditorRestController.java diff --git a/spring-boot-data/src/main/java/com/baeldung/propertyeditor/creditcard/CreditCard.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/propertyeditor/creditcard/CreditCard.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/propertyeditor/creditcard/CreditCard.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/propertyeditor/creditcard/CreditCard.java diff --git a/spring-boot-data/src/main/java/com/baeldung/propertyeditor/creditcard/CreditCardEditor.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/propertyeditor/creditcard/CreditCardEditor.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/propertyeditor/creditcard/CreditCardEditor.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/propertyeditor/creditcard/CreditCardEditor.java diff --git a/spring-boot-data/src/main/java/com/baeldung/propertyeditor/exotictype/editor/CustomExoticTypeEditor.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/propertyeditor/exotictype/editor/CustomExoticTypeEditor.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/propertyeditor/exotictype/editor/CustomExoticTypeEditor.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/propertyeditor/exotictype/editor/CustomExoticTypeEditor.java diff --git a/spring-boot-data/src/main/java/com/baeldung/propertyeditor/exotictype/model/ExoticType.java b/spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/propertyeditor/exotictype/model/ExoticType.java similarity index 100% rename from spring-boot-data/src/main/java/com/baeldung/propertyeditor/exotictype/model/ExoticType.java rename to spring-boot-modules/spring-boot-data/src/main/java/com/baeldung/propertyeditor/exotictype/model/ExoticType.java diff --git a/spring-boot-data/src/main/resources/application.properties b/spring-boot-modules/spring-boot-data/src/main/resources/application.properties similarity index 100% rename from spring-boot-data/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-data/src/main/resources/application.properties diff --git a/spring-boot-data/src/test/java/com/baeldung/disableautoconfig/SpringDataJPAIntegrationTest.java b/spring-boot-modules/spring-boot-data/src/test/java/com/baeldung/disableautoconfig/SpringDataJPAIntegrationTest.java similarity index 100% rename from spring-boot-data/src/test/java/com/baeldung/disableautoconfig/SpringDataJPAIntegrationTest.java rename to spring-boot-modules/spring-boot-data/src/test/java/com/baeldung/disableautoconfig/SpringDataJPAIntegrationTest.java diff --git a/spring-boot-data/src/test/java/com/baeldung/disableautoconfig/SpringDataMongoDBIntegrationTest.java b/spring-boot-modules/spring-boot-data/src/test/java/com/baeldung/disableautoconfig/SpringDataMongoDBIntegrationTest.java similarity index 100% rename from spring-boot-data/src/test/java/com/baeldung/disableautoconfig/SpringDataMongoDBIntegrationTest.java rename to spring-boot-modules/spring-boot-data/src/test/java/com/baeldung/disableautoconfig/SpringDataMongoDBIntegrationTest.java diff --git a/spring-boot-data/src/test/java/com/baeldung/disableautoconfig/SpringDataRedisIntegrationTest.java b/spring-boot-modules/spring-boot-data/src/test/java/com/baeldung/disableautoconfig/SpringDataRedisIntegrationTest.java similarity index 100% rename from spring-boot-data/src/test/java/com/baeldung/disableautoconfig/SpringDataRedisIntegrationTest.java rename to spring-boot-modules/spring-boot-data/src/test/java/com/baeldung/disableautoconfig/SpringDataRedisIntegrationTest.java diff --git a/spring-boot-data/src/test/java/com/baeldung/jsondateformat/ContactAppIntegrationTest.java b/spring-boot-modules/spring-boot-data/src/test/java/com/baeldung/jsondateformat/ContactAppIntegrationTest.java similarity index 100% rename from spring-boot-data/src/test/java/com/baeldung/jsondateformat/ContactAppIntegrationTest.java rename to spring-boot-modules/spring-boot-data/src/test/java/com/baeldung/jsondateformat/ContactAppIntegrationTest.java diff --git a/spring-boot-data/src/test/java/com/baeldung/jsondateformat/ContactAppWithObjectMapperCustomizerIntegrationTest.java b/spring-boot-modules/spring-boot-data/src/test/java/com/baeldung/jsondateformat/ContactAppWithObjectMapperCustomizerIntegrationTest.java similarity index 100% rename from spring-boot-data/src/test/java/com/baeldung/jsondateformat/ContactAppWithObjectMapperCustomizerIntegrationTest.java rename to spring-boot-modules/spring-boot-data/src/test/java/com/baeldung/jsondateformat/ContactAppWithObjectMapperCustomizerIntegrationTest.java diff --git a/spring-boot-data/src/test/java/com/baeldung/jsonexception/MainControllerIntegrationTest.java b/spring-boot-modules/spring-boot-data/src/test/java/com/baeldung/jsonexception/MainControllerIntegrationTest.java similarity index 100% rename from spring-boot-data/src/test/java/com/baeldung/jsonexception/MainControllerIntegrationTest.java rename to spring-boot-modules/spring-boot-data/src/test/java/com/baeldung/jsonexception/MainControllerIntegrationTest.java diff --git a/spring-boot-data/src/test/java/com/baeldung/propertyeditor/creditcard/CreditCardEditorUnitTest.java b/spring-boot-modules/spring-boot-data/src/test/java/com/baeldung/propertyeditor/creditcard/CreditCardEditorUnitTest.java similarity index 100% rename from spring-boot-data/src/test/java/com/baeldung/propertyeditor/creditcard/CreditCardEditorUnitTest.java rename to spring-boot-modules/spring-boot-data/src/test/java/com/baeldung/propertyeditor/creditcard/CreditCardEditorUnitTest.java diff --git a/spring-boot-data/src/test/resources/application.properties b/spring-boot-modules/spring-boot-data/src/test/resources/application.properties similarity index 100% rename from spring-boot-data/src/test/resources/application.properties rename to spring-boot-modules/spring-boot-data/src/test/resources/application.properties diff --git a/spring-boot-deployment/README.md b/spring-boot-modules/spring-boot-deployment/README.md similarity index 100% rename from spring-boot-deployment/README.md rename to spring-boot-modules/spring-boot-deployment/README.md diff --git a/spring-boot-deployment/pom.xml b/spring-boot-modules/spring-boot-deployment/pom.xml similarity index 99% rename from spring-boot-deployment/pom.xml rename to spring-boot-modules/spring-boot-deployment/pom.xml index 6f724f312b..64c0e698f6 100644 --- a/spring-boot-deployment/pom.xml +++ b/spring-boot-modules/spring-boot-deployment/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/spring-boot-deployment/src/main/java/com/baeldung/compare/ComparisonApplication.java b/spring-boot-modules/spring-boot-deployment/src/main/java/com/baeldung/compare/ComparisonApplication.java similarity index 100% rename from spring-boot-deployment/src/main/java/com/baeldung/compare/ComparisonApplication.java rename to spring-boot-modules/spring-boot-deployment/src/main/java/com/baeldung/compare/ComparisonApplication.java diff --git a/spring-boot-deployment/src/main/java/com/baeldung/compare/StartupEventHandler.java b/spring-boot-modules/spring-boot-deployment/src/main/java/com/baeldung/compare/StartupEventHandler.java similarity index 100% rename from spring-boot-deployment/src/main/java/com/baeldung/compare/StartupEventHandler.java rename to spring-boot-modules/spring-boot-deployment/src/main/java/com/baeldung/compare/StartupEventHandler.java diff --git a/spring-boot-deployment/src/main/java/com/baeldung/gracefulshutdown/GracefulShutdownApplication.java b/spring-boot-modules/spring-boot-deployment/src/main/java/com/baeldung/gracefulshutdown/GracefulShutdownApplication.java similarity index 100% rename from spring-boot-deployment/src/main/java/com/baeldung/gracefulshutdown/GracefulShutdownApplication.java rename to spring-boot-modules/spring-boot-deployment/src/main/java/com/baeldung/gracefulshutdown/GracefulShutdownApplication.java diff --git a/spring-boot-deployment/src/main/java/com/baeldung/gracefulshutdown/beans/LongRunningProcessBean.java b/spring-boot-modules/spring-boot-deployment/src/main/java/com/baeldung/gracefulshutdown/beans/LongRunningProcessBean.java similarity index 100% rename from spring-boot-deployment/src/main/java/com/baeldung/gracefulshutdown/beans/LongRunningProcessBean.java rename to spring-boot-modules/spring-boot-deployment/src/main/java/com/baeldung/gracefulshutdown/beans/LongRunningProcessBean.java diff --git a/spring-boot-deployment/src/main/java/com/baeldung/gracefulshutdown/config/SpringConfiguration.java b/spring-boot-modules/spring-boot-deployment/src/main/java/com/baeldung/gracefulshutdown/config/SpringConfiguration.java similarity index 100% rename from spring-boot-deployment/src/main/java/com/baeldung/gracefulshutdown/config/SpringConfiguration.java rename to spring-boot-modules/spring-boot-deployment/src/main/java/com/baeldung/gracefulshutdown/config/SpringConfiguration.java diff --git a/spring-boot-deployment/src/main/java/com/baeldung/springbootconfiguration/SpringBootConfigurationApplication.java b/spring-boot-modules/spring-boot-deployment/src/main/java/com/baeldung/springbootconfiguration/SpringBootConfigurationApplication.java similarity index 100% rename from spring-boot-deployment/src/main/java/com/baeldung/springbootconfiguration/SpringBootConfigurationApplication.java rename to spring-boot-modules/spring-boot-deployment/src/main/java/com/baeldung/springbootconfiguration/SpringBootConfigurationApplication.java diff --git a/spring-boot-deployment/src/main/java/com/baeldung/springbootconfiguration/controller/GreetingsController.java b/spring-boot-modules/spring-boot-deployment/src/main/java/com/baeldung/springbootconfiguration/controller/GreetingsController.java similarity index 100% rename from spring-boot-deployment/src/main/java/com/baeldung/springbootconfiguration/controller/GreetingsController.java rename to spring-boot-modules/spring-boot-deployment/src/main/java/com/baeldung/springbootconfiguration/controller/GreetingsController.java diff --git a/spring-boot-deployment/src/main/java/com/baeldung/springbootnonwebapp/SpringBootConsoleApplication.java b/spring-boot-modules/spring-boot-deployment/src/main/java/com/baeldung/springbootnonwebapp/SpringBootConsoleApplication.java similarity index 100% rename from spring-boot-deployment/src/main/java/com/baeldung/springbootnonwebapp/SpringBootConsoleApplication.java rename to spring-boot-modules/spring-boot-deployment/src/main/java/com/baeldung/springbootnonwebapp/SpringBootConsoleApplication.java diff --git a/spring-boot-deployment/src/main/java/com/baeldung/springbootsimple/SpringBootTomcatApplication.java b/spring-boot-modules/spring-boot-deployment/src/main/java/com/baeldung/springbootsimple/SpringBootTomcatApplication.java similarity index 100% rename from spring-boot-deployment/src/main/java/com/baeldung/springbootsimple/SpringBootTomcatApplication.java rename to spring-boot-modules/spring-boot-deployment/src/main/java/com/baeldung/springbootsimple/SpringBootTomcatApplication.java diff --git a/spring-boot-deployment/src/main/java/com/baeldung/springbootsimple/TomcatController.java b/spring-boot-modules/spring-boot-deployment/src/main/java/com/baeldung/springbootsimple/TomcatController.java similarity index 100% rename from spring-boot-deployment/src/main/java/com/baeldung/springbootsimple/TomcatController.java rename to spring-boot-modules/spring-boot-deployment/src/main/java/com/baeldung/springbootsimple/TomcatController.java diff --git a/spring-boot-deployment/src/main/resources/application.properties b/spring-boot-modules/spring-boot-deployment/src/main/resources/application.properties similarity index 100% rename from spring-boot-deployment/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-deployment/src/main/resources/application.properties diff --git a/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-deployment/src/main/resources/logback.xml similarity index 100% rename from spring-boot-custom-starter/greeter-spring-boot-autoconfigure/src/main/resources/logback.xml rename to spring-boot-modules/spring-boot-deployment/src/main/resources/logback.xml diff --git a/spring-boot-deployment/src/test/java/com/baeldung/springbootconfiguration/SpringContextTest.java b/spring-boot-modules/spring-boot-deployment/src/test/java/com/baeldung/springbootconfiguration/SpringContextTest.java similarity index 100% rename from spring-boot-deployment/src/test/java/com/baeldung/springbootconfiguration/SpringContextTest.java rename to spring-boot-modules/spring-boot-deployment/src/test/java/com/baeldung/springbootconfiguration/SpringContextTest.java diff --git a/spring-boot-deployment/src/test/java/com/baeldung/springbootsimple/SpringBootTomcatApplicationIntegrationTest.java b/spring-boot-modules/spring-boot-deployment/src/test/java/com/baeldung/springbootsimple/SpringBootTomcatApplicationIntegrationTest.java similarity index 100% rename from spring-boot-deployment/src/test/java/com/baeldung/springbootsimple/SpringBootTomcatApplicationIntegrationTest.java rename to spring-boot-modules/spring-boot-deployment/src/test/java/com/baeldung/springbootsimple/SpringBootTomcatApplicationIntegrationTest.java diff --git a/spring-boot-di/README.MD b/spring-boot-modules/spring-boot-di/README.MD similarity index 100% rename from spring-boot-di/README.MD rename to spring-boot-modules/spring-boot-di/README.MD diff --git a/spring-boot-di/pom.xml b/spring-boot-modules/spring-boot-di/pom.xml similarity index 97% rename from spring-boot-di/pom.xml rename to spring-boot-modules/spring-boot-di/pom.xml index 61059630c4..b24e4a9037 100644 --- a/spring-boot-di/pom.xml +++ b/spring-boot-modules/spring-boot-di/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-boot-di/src/main/java/com/baeldung/SpringBootDiApplication.java b/spring-boot-modules/spring-boot-di/src/main/java/com/baeldung/SpringBootDiApplication.java similarity index 100% rename from spring-boot-di/src/main/java/com/baeldung/SpringBootDiApplication.java rename to spring-boot-modules/spring-boot-di/src/main/java/com/baeldung/SpringBootDiApplication.java diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/ExampleBean.java b/spring-boot-modules/spring-boot-di/src/main/java/com/baeldung/componentscan/ExampleBean.java similarity index 100% rename from spring-boot-di/src/main/java/com/baeldung/componentscan/ExampleBean.java rename to spring-boot-modules/spring-boot-di/src/main/java/com/baeldung/componentscan/ExampleBean.java diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/Animal.java b/spring-boot-modules/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/Animal.java similarity index 100% rename from spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/Animal.java rename to spring-boot-modules/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/Animal.java diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/ComponentScanAnnotationFilterApp.java b/spring-boot-modules/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/ComponentScanAnnotationFilterApp.java similarity index 100% rename from spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/ComponentScanAnnotationFilterApp.java rename to spring-boot-modules/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/ComponentScanAnnotationFilterApp.java diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/Elephant.java b/spring-boot-modules/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/Elephant.java similarity index 100% rename from spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/Elephant.java rename to spring-boot-modules/spring-boot-di/src/main/java/com/baeldung/componentscan/filter/annotation/Elephant.java diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/springapp/SpringComponentScanApp.java b/spring-boot-modules/spring-boot-di/src/main/java/com/baeldung/componentscan/springapp/SpringComponentScanApp.java similarity index 100% rename from spring-boot-di/src/main/java/com/baeldung/componentscan/springapp/SpringComponentScanApp.java rename to spring-boot-modules/spring-boot-di/src/main/java/com/baeldung/componentscan/springapp/SpringComponentScanApp.java diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/springapp/animals/Cat.java b/spring-boot-modules/spring-boot-di/src/main/java/com/baeldung/componentscan/springapp/animals/Cat.java similarity index 100% rename from spring-boot-di/src/main/java/com/baeldung/componentscan/springapp/animals/Cat.java rename to spring-boot-modules/spring-boot-di/src/main/java/com/baeldung/componentscan/springapp/animals/Cat.java diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/springapp/animals/Dog.java b/spring-boot-modules/spring-boot-di/src/main/java/com/baeldung/componentscan/springapp/animals/Dog.java similarity index 100% rename from spring-boot-di/src/main/java/com/baeldung/componentscan/springapp/animals/Dog.java rename to spring-boot-modules/spring-boot-di/src/main/java/com/baeldung/componentscan/springapp/animals/Dog.java diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/springapp/flowers/Rose.java b/spring-boot-modules/spring-boot-di/src/main/java/com/baeldung/componentscan/springapp/flowers/Rose.java similarity index 100% rename from spring-boot-di/src/main/java/com/baeldung/componentscan/springapp/flowers/Rose.java rename to spring-boot-modules/spring-boot-di/src/main/java/com/baeldung/componentscan/springapp/flowers/Rose.java diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/springbootapp/SpringBootComponentScanApp.java b/spring-boot-modules/spring-boot-di/src/main/java/com/baeldung/componentscan/springbootapp/SpringBootComponentScanApp.java similarity index 100% rename from spring-boot-di/src/main/java/com/baeldung/componentscan/springbootapp/SpringBootComponentScanApp.java rename to spring-boot-modules/spring-boot-di/src/main/java/com/baeldung/componentscan/springbootapp/SpringBootComponentScanApp.java diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/springbootapp/animals/Cat.java b/spring-boot-modules/spring-boot-di/src/main/java/com/baeldung/componentscan/springbootapp/animals/Cat.java similarity index 100% rename from spring-boot-di/src/main/java/com/baeldung/componentscan/springbootapp/animals/Cat.java rename to spring-boot-modules/spring-boot-di/src/main/java/com/baeldung/componentscan/springbootapp/animals/Cat.java diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/springbootapp/animals/Dog.java b/spring-boot-modules/spring-boot-di/src/main/java/com/baeldung/componentscan/springbootapp/animals/Dog.java similarity index 100% rename from spring-boot-di/src/main/java/com/baeldung/componentscan/springbootapp/animals/Dog.java rename to spring-boot-modules/spring-boot-di/src/main/java/com/baeldung/componentscan/springbootapp/animals/Dog.java diff --git a/spring-boot-di/src/main/java/com/baeldung/componentscan/springbootapp/flowers/Rose.java b/spring-boot-modules/spring-boot-di/src/main/java/com/baeldung/componentscan/springbootapp/flowers/Rose.java similarity index 100% rename from spring-boot-di/src/main/java/com/baeldung/componentscan/springbootapp/flowers/Rose.java rename to spring-boot-modules/spring-boot-di/src/main/java/com/baeldung/componentscan/springbootapp/flowers/Rose.java diff --git a/spring-boot-environment/README.md b/spring-boot-modules/spring-boot-environment/README.md similarity index 100% rename from spring-boot-environment/README.md rename to spring-boot-modules/spring-boot-environment/README.md diff --git a/spring-boot-environment/pom.xml b/spring-boot-modules/spring-boot-environment/pom.xml similarity index 98% rename from spring-boot-environment/pom.xml rename to spring-boot-modules/spring-boot-environment/pom.xml index 531ef697d7..138c59847d 100644 --- a/spring-boot-environment/pom.xml +++ b/spring-boot-modules/spring-boot-environment/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/PriceCalculationApplication.java b/spring-boot-modules/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/PriceCalculationApplication.java similarity index 100% rename from spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/PriceCalculationApplication.java rename to spring-boot-modules/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/PriceCalculationApplication.java diff --git a/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/PriceCalculationEnvironmentPostProcessor.java b/spring-boot-modules/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/PriceCalculationEnvironmentPostProcessor.java similarity index 100% rename from spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/PriceCalculationEnvironmentPostProcessor.java rename to spring-boot-modules/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/PriceCalculationEnvironmentPostProcessor.java diff --git a/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/autoconfig/PriceCalculationAutoConfig.java b/spring-boot-modules/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/autoconfig/PriceCalculationAutoConfig.java similarity index 100% rename from spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/autoconfig/PriceCalculationAutoConfig.java rename to spring-boot-modules/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/autoconfig/PriceCalculationAutoConfig.java diff --git a/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/calculator/GrossPriceCalculator.java b/spring-boot-modules/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/calculator/GrossPriceCalculator.java similarity index 100% rename from spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/calculator/GrossPriceCalculator.java rename to spring-boot-modules/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/calculator/GrossPriceCalculator.java diff --git a/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/calculator/NetPriceCalculator.java b/spring-boot-modules/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/calculator/NetPriceCalculator.java similarity index 100% rename from spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/calculator/NetPriceCalculator.java rename to spring-boot-modules/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/calculator/NetPriceCalculator.java diff --git a/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/calculator/PriceCalculator.java b/spring-boot-modules/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/calculator/PriceCalculator.java similarity index 100% rename from spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/calculator/PriceCalculator.java rename to spring-boot-modules/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/calculator/PriceCalculator.java diff --git a/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/service/PriceCalculationService.java b/spring-boot-modules/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/service/PriceCalculationService.java similarity index 100% rename from spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/service/PriceCalculationService.java rename to spring-boot-modules/spring-boot-environment/src/main/java/com/baeldung/environmentpostprocessor/service/PriceCalculationService.java diff --git a/spring-boot-environment/src/main/java/com/baeldung/properties/ConfProperties.java b/spring-boot-modules/spring-boot-environment/src/main/java/com/baeldung/properties/ConfProperties.java similarity index 100% rename from spring-boot-environment/src/main/java/com/baeldung/properties/ConfProperties.java rename to spring-boot-modules/spring-boot-environment/src/main/java/com/baeldung/properties/ConfProperties.java diff --git a/spring-boot-environment/src/main/java/com/baeldung/properties/ExternalPropertyConfigurer.java b/spring-boot-modules/spring-boot-environment/src/main/java/com/baeldung/properties/ExternalPropertyConfigurer.java similarity index 100% rename from spring-boot-environment/src/main/java/com/baeldung/properties/ExternalPropertyConfigurer.java rename to spring-boot-modules/spring-boot-environment/src/main/java/com/baeldung/properties/ExternalPropertyConfigurer.java diff --git a/spring-boot-environment/src/main/java/com/baeldung/properties/ExternalPropertyFileLoader.java b/spring-boot-modules/spring-boot-environment/src/main/java/com/baeldung/properties/ExternalPropertyFileLoader.java similarity index 100% rename from spring-boot-environment/src/main/java/com/baeldung/properties/ExternalPropertyFileLoader.java rename to spring-boot-modules/spring-boot-environment/src/main/java/com/baeldung/properties/ExternalPropertyFileLoader.java diff --git a/spring-boot-environment/src/main/resources/META-INF/spring.factories b/spring-boot-modules/spring-boot-environment/src/main/resources/META-INF/spring.factories similarity index 100% rename from spring-boot-environment/src/main/resources/META-INF/spring.factories rename to spring-boot-modules/spring-boot-environment/src/main/resources/META-INF/spring.factories diff --git a/spring-boot-environment/src/main/resources/application.properties b/spring-boot-modules/spring-boot-environment/src/main/resources/application.properties similarity index 100% rename from spring-boot-environment/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-environment/src/main/resources/application.properties diff --git a/spring-boot-environment/src/main/resources/external/conf.properties b/spring-boot-modules/spring-boot-environment/src/main/resources/external/conf.properties similarity index 100% rename from spring-boot-environment/src/main/resources/external/conf.properties rename to spring-boot-modules/spring-boot-environment/src/main/resources/external/conf.properties diff --git a/spring-boot-custom-starter/greeter-spring-boot-sample-app/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-environment/src/main/resources/logback.xml similarity index 100% rename from spring-boot-custom-starter/greeter-spring-boot-sample-app/src/main/resources/logback.xml rename to spring-boot-modules/spring-boot-environment/src/main/resources/logback.xml diff --git a/spring-boot-environment/src/test/java/com/baeldung/environmentpostprocessor/PriceCalculationEnvironmentPostProcessorLiveTest.java b/spring-boot-modules/spring-boot-environment/src/test/java/com/baeldung/environmentpostprocessor/PriceCalculationEnvironmentPostProcessorLiveTest.java similarity index 100% rename from spring-boot-environment/src/test/java/com/baeldung/environmentpostprocessor/PriceCalculationEnvironmentPostProcessorLiveTest.java rename to spring-boot-modules/spring-boot-environment/src/test/java/com/baeldung/environmentpostprocessor/PriceCalculationEnvironmentPostProcessorLiveTest.java diff --git a/spring-boot-environment/src/test/java/com/baeldung/properties/ExternalPropertyFileLoaderIntegrationTest.java b/spring-boot-modules/spring-boot-environment/src/test/java/com/baeldung/properties/ExternalPropertyFileLoaderIntegrationTest.java similarity index 100% rename from spring-boot-environment/src/test/java/com/baeldung/properties/ExternalPropertyFileLoaderIntegrationTest.java rename to spring-boot-modules/spring-boot-environment/src/test/java/com/baeldung/properties/ExternalPropertyFileLoaderIntegrationTest.java diff --git a/spring-boot-flowable/README.md b/spring-boot-modules/spring-boot-flowable/README.md similarity index 100% rename from spring-boot-flowable/README.md rename to spring-boot-modules/spring-boot-flowable/README.md diff --git a/spring-boot-flowable/pom.xml b/spring-boot-modules/spring-boot-flowable/pom.xml similarity index 97% rename from spring-boot-flowable/pom.xml rename to spring-boot-modules/spring-boot-flowable/pom.xml index 96558b8595..7d9fb97cba 100644 --- a/spring-boot-flowable/pom.xml +++ b/spring-boot-modules/spring-boot-flowable/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-boot-flowable/src/main/java/com/baeldung/Application.java b/spring-boot-modules/spring-boot-flowable/src/main/java/com/baeldung/Application.java similarity index 100% rename from spring-boot-flowable/src/main/java/com/baeldung/Application.java rename to spring-boot-modules/spring-boot-flowable/src/main/java/com/baeldung/Application.java diff --git a/spring-boot-flowable/src/main/java/com/baeldung/controller/ArticleWorkflowController.java b/spring-boot-modules/spring-boot-flowable/src/main/java/com/baeldung/controller/ArticleWorkflowController.java similarity index 100% rename from spring-boot-flowable/src/main/java/com/baeldung/controller/ArticleWorkflowController.java rename to spring-boot-modules/spring-boot-flowable/src/main/java/com/baeldung/controller/ArticleWorkflowController.java diff --git a/spring-boot-flowable/src/main/java/com/baeldung/domain/Approval.java b/spring-boot-modules/spring-boot-flowable/src/main/java/com/baeldung/domain/Approval.java similarity index 100% rename from spring-boot-flowable/src/main/java/com/baeldung/domain/Approval.java rename to spring-boot-modules/spring-boot-flowable/src/main/java/com/baeldung/domain/Approval.java diff --git a/spring-boot-flowable/src/main/java/com/baeldung/domain/Article.java b/spring-boot-modules/spring-boot-flowable/src/main/java/com/baeldung/domain/Article.java similarity index 100% rename from spring-boot-flowable/src/main/java/com/baeldung/domain/Article.java rename to spring-boot-modules/spring-boot-flowable/src/main/java/com/baeldung/domain/Article.java diff --git a/spring-boot-flowable/src/main/java/com/baeldung/service/ArticleWorkflowService.java b/spring-boot-modules/spring-boot-flowable/src/main/java/com/baeldung/service/ArticleWorkflowService.java similarity index 100% rename from spring-boot-flowable/src/main/java/com/baeldung/service/ArticleWorkflowService.java rename to spring-boot-modules/spring-boot-flowable/src/main/java/com/baeldung/service/ArticleWorkflowService.java diff --git a/spring-boot-flowable/src/main/java/com/baeldung/service/PublishArticleService.java b/spring-boot-modules/spring-boot-flowable/src/main/java/com/baeldung/service/PublishArticleService.java similarity index 100% rename from spring-boot-flowable/src/main/java/com/baeldung/service/PublishArticleService.java rename to spring-boot-modules/spring-boot-flowable/src/main/java/com/baeldung/service/PublishArticleService.java diff --git a/spring-boot-flowable/src/main/java/com/baeldung/service/SendMailService.java b/spring-boot-modules/spring-boot-flowable/src/main/java/com/baeldung/service/SendMailService.java similarity index 100% rename from spring-boot-flowable/src/main/java/com/baeldung/service/SendMailService.java rename to spring-boot-modules/spring-boot-flowable/src/main/java/com/baeldung/service/SendMailService.java diff --git a/spring-boot-flowable/src/main/resources/application.properties b/spring-boot-modules/spring-boot-flowable/src/main/resources/application.properties similarity index 100% rename from spring-boot-flowable/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-flowable/src/main/resources/application.properties diff --git a/spring-boot-flowable/src/main/resources/processes/article-workflow.bpmn20.xml b/spring-boot-modules/spring-boot-flowable/src/main/resources/processes/article-workflow.bpmn20.xml similarity index 100% rename from spring-boot-flowable/src/main/resources/processes/article-workflow.bpmn20.xml rename to spring-boot-modules/spring-boot-flowable/src/main/resources/processes/article-workflow.bpmn20.xml diff --git a/spring-boot-flowable/src/test/java/com/baeldung/processes/ArticleWorkflowIntegrationTest.java b/spring-boot-modules/spring-boot-flowable/src/test/java/com/baeldung/processes/ArticleWorkflowIntegrationTest.java similarity index 100% rename from spring-boot-flowable/src/test/java/com/baeldung/processes/ArticleWorkflowIntegrationTest.java rename to spring-boot-modules/spring-boot-flowable/src/test/java/com/baeldung/processes/ArticleWorkflowIntegrationTest.java diff --git a/spring-boot-gradle/.gitignore b/spring-boot-modules/spring-boot-gradle/.gitignore similarity index 100% rename from spring-boot-gradle/.gitignore rename to spring-boot-modules/spring-boot-gradle/.gitignore diff --git a/spring-boot-gradle/README.md b/spring-boot-modules/spring-boot-gradle/README.md similarity index 100% rename from spring-boot-gradle/README.md rename to spring-boot-modules/spring-boot-gradle/README.md diff --git a/spring-boot-gradle/build.gradle b/spring-boot-modules/spring-boot-gradle/build.gradle similarity index 100% rename from spring-boot-gradle/build.gradle rename to spring-boot-modules/spring-boot-gradle/build.gradle diff --git a/spring-boot-gradle/gradle/wrapper/gradle-wrapper.properties b/spring-boot-modules/spring-boot-gradle/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from spring-boot-gradle/gradle/wrapper/gradle-wrapper.properties rename to spring-boot-modules/spring-boot-gradle/gradle/wrapper/gradle-wrapper.properties diff --git a/spring-boot-gradle/gradlew b/spring-boot-modules/spring-boot-gradle/gradlew similarity index 100% rename from spring-boot-gradle/gradlew rename to spring-boot-modules/spring-boot-gradle/gradlew diff --git a/spring-boot-gradle/gradlew.bat b/spring-boot-modules/spring-boot-gradle/gradlew.bat similarity index 96% rename from spring-boot-gradle/gradlew.bat rename to spring-boot-modules/spring-boot-gradle/gradlew.bat index e95643d6a2..f9553162f1 100644 --- a/spring-boot-gradle/gradlew.bat +++ b/spring-boot-modules/spring-boot-gradle/gradlew.bat @@ -1,84 +1,84 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/spring-boot-gradle/settings.gradle b/spring-boot-modules/spring-boot-gradle/settings.gradle similarity index 100% rename from spring-boot-gradle/settings.gradle rename to spring-boot-modules/spring-boot-gradle/settings.gradle diff --git a/spring-boot-gradle/src/main/java/org/baeldung/DemoApplication.java b/spring-boot-modules/spring-boot-gradle/src/main/java/org/baeldung/DemoApplication.java similarity index 100% rename from spring-boot-gradle/src/main/java/org/baeldung/DemoApplication.java rename to spring-boot-modules/spring-boot-gradle/src/main/java/org/baeldung/DemoApplication.java diff --git a/spring-boot-gradle/src/main/resources/application.properties b/spring-boot-modules/spring-boot-gradle/src/main/resources/application.properties similarity index 100% rename from spring-boot-gradle/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-gradle/src/main/resources/application.properties diff --git a/spring-boot-deployment/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-gradle/src/main/resources/logback.xml similarity index 100% rename from spring-boot-deployment/src/main/resources/logback.xml rename to spring-boot-modules/spring-boot-gradle/src/main/resources/logback.xml diff --git a/spring-boot-gradle/src/test/java/org/baeldung/DemoApplicationTests.java b/spring-boot-modules/spring-boot-gradle/src/test/java/org/baeldung/DemoApplicationTests.java similarity index 100% rename from spring-boot-gradle/src/test/java/org/baeldung/DemoApplicationTests.java rename to spring-boot-modules/spring-boot-gradle/src/test/java/org/baeldung/DemoApplicationTests.java diff --git a/spring-boot-jasypt/.gitignore b/spring-boot-modules/spring-boot-jasypt/.gitignore similarity index 100% rename from spring-boot-jasypt/.gitignore rename to spring-boot-modules/spring-boot-jasypt/.gitignore diff --git a/spring-boot-jasypt/README.md b/spring-boot-modules/spring-boot-jasypt/README.md similarity index 100% rename from spring-boot-jasypt/README.md rename to spring-boot-modules/spring-boot-jasypt/README.md diff --git a/spring-boot-jasypt/pom.xml b/spring-boot-modules/spring-boot-jasypt/pom.xml similarity index 96% rename from spring-boot-jasypt/pom.xml rename to spring-boot-modules/spring-boot-jasypt/pom.xml index 76a501c455..e63a02729f 100644 --- a/spring-boot-jasypt/pom.xml +++ b/spring-boot-modules/spring-boot-jasypt/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-boot-jasypt/src/main/java/com/baeldung/jasypt/Main.java b/spring-boot-modules/spring-boot-jasypt/src/main/java/com/baeldung/jasypt/Main.java similarity index 100% rename from spring-boot-jasypt/src/main/java/com/baeldung/jasypt/Main.java rename to spring-boot-modules/spring-boot-jasypt/src/main/java/com/baeldung/jasypt/Main.java diff --git a/spring-boot-jasypt/src/main/java/com/baeldung/jasypt/simple/AppConfigForJasyptSimple.java b/spring-boot-modules/spring-boot-jasypt/src/main/java/com/baeldung/jasypt/simple/AppConfigForJasyptSimple.java similarity index 100% rename from spring-boot-jasypt/src/main/java/com/baeldung/jasypt/simple/AppConfigForJasyptSimple.java rename to spring-boot-modules/spring-boot-jasypt/src/main/java/com/baeldung/jasypt/simple/AppConfigForJasyptSimple.java diff --git a/spring-boot-jasypt/src/main/java/com/baeldung/jasypt/simple/PropertyServiceForJasyptSimple.java b/spring-boot-modules/spring-boot-jasypt/src/main/java/com/baeldung/jasypt/simple/PropertyServiceForJasyptSimple.java similarity index 100% rename from spring-boot-jasypt/src/main/java/com/baeldung/jasypt/simple/PropertyServiceForJasyptSimple.java rename to spring-boot-modules/spring-boot-jasypt/src/main/java/com/baeldung/jasypt/simple/PropertyServiceForJasyptSimple.java diff --git a/spring-boot-jasypt/src/main/java/com/baeldung/jasypt/starter/AppConfigForJasyptStarter.java b/spring-boot-modules/spring-boot-jasypt/src/main/java/com/baeldung/jasypt/starter/AppConfigForJasyptStarter.java similarity index 100% rename from spring-boot-jasypt/src/main/java/com/baeldung/jasypt/starter/AppConfigForJasyptStarter.java rename to spring-boot-modules/spring-boot-jasypt/src/main/java/com/baeldung/jasypt/starter/AppConfigForJasyptStarter.java diff --git a/spring-boot-jasypt/src/main/java/com/baeldung/jasypt/starter/PropertyServiceForJasyptStarter.java b/spring-boot-modules/spring-boot-jasypt/src/main/java/com/baeldung/jasypt/starter/PropertyServiceForJasyptStarter.java similarity index 100% rename from spring-boot-jasypt/src/main/java/com/baeldung/jasypt/starter/PropertyServiceForJasyptStarter.java rename to spring-boot-modules/spring-boot-jasypt/src/main/java/com/baeldung/jasypt/starter/PropertyServiceForJasyptStarter.java diff --git a/spring-boot-jasypt/src/main/resources/application.properties b/spring-boot-modules/spring-boot-jasypt/src/main/resources/application.properties similarity index 100% rename from spring-boot-jasypt/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-jasypt/src/main/resources/application.properties diff --git a/spring-boot-jasypt/src/main/resources/encrypted.properties b/spring-boot-modules/spring-boot-jasypt/src/main/resources/encrypted.properties similarity index 100% rename from spring-boot-jasypt/src/main/resources/encrypted.properties rename to spring-boot-modules/spring-boot-jasypt/src/main/resources/encrypted.properties diff --git a/spring-boot-jasypt/src/main/resources/encryptedv2.properties b/spring-boot-modules/spring-boot-jasypt/src/main/resources/encryptedv2.properties similarity index 100% rename from spring-boot-jasypt/src/main/resources/encryptedv2.properties rename to spring-boot-modules/spring-boot-jasypt/src/main/resources/encryptedv2.properties diff --git a/spring-boot-environment/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-jasypt/src/main/resources/logback.xml similarity index 100% rename from spring-boot-environment/src/main/resources/logback.xml rename to spring-boot-modules/spring-boot-jasypt/src/main/resources/logback.xml diff --git a/spring-boot-jasypt/src/test/java/com/baeldung/jasypt/CustomJasyptIntegrationTest.java b/spring-boot-modules/spring-boot-jasypt/src/test/java/com/baeldung/jasypt/CustomJasyptIntegrationTest.java similarity index 100% rename from spring-boot-jasypt/src/test/java/com/baeldung/jasypt/CustomJasyptIntegrationTest.java rename to spring-boot-modules/spring-boot-jasypt/src/test/java/com/baeldung/jasypt/CustomJasyptIntegrationTest.java diff --git a/spring-boot-jasypt/src/test/java/com/baeldung/jasypt/JasyptSimpleIntegrationTest.java b/spring-boot-modules/spring-boot-jasypt/src/test/java/com/baeldung/jasypt/JasyptSimpleIntegrationTest.java similarity index 100% rename from spring-boot-jasypt/src/test/java/com/baeldung/jasypt/JasyptSimpleIntegrationTest.java rename to spring-boot-modules/spring-boot-jasypt/src/test/java/com/baeldung/jasypt/JasyptSimpleIntegrationTest.java diff --git a/spring-boot-jasypt/src/test/java/com/baeldung/jasypt/JasyptWithStarterIntegrationTest.java b/spring-boot-modules/spring-boot-jasypt/src/test/java/com/baeldung/jasypt/JasyptWithStarterIntegrationTest.java similarity index 100% rename from spring-boot-jasypt/src/test/java/com/baeldung/jasypt/JasyptWithStarterIntegrationTest.java rename to spring-boot-modules/spring-boot-jasypt/src/test/java/com/baeldung/jasypt/JasyptWithStarterIntegrationTest.java diff --git a/spring-boot-jasypt/src/test/java/org/baeldung/SpringContextTest.java b/spring-boot-modules/spring-boot-jasypt/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-boot-jasypt/src/test/java/org/baeldung/SpringContextTest.java rename to spring-boot-modules/spring-boot-jasypt/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-boot-keycloak/.gitignore b/spring-boot-modules/spring-boot-keycloak/.gitignore similarity index 100% rename from spring-boot-keycloak/.gitignore rename to spring-boot-modules/spring-boot-keycloak/.gitignore diff --git a/spring-boot-keycloak/.mvn/wrapper/maven-wrapper.jar b/spring-boot-modules/spring-boot-keycloak/.mvn/wrapper/maven-wrapper.jar similarity index 100% rename from spring-boot-keycloak/.mvn/wrapper/maven-wrapper.jar rename to spring-boot-modules/spring-boot-keycloak/.mvn/wrapper/maven-wrapper.jar diff --git a/spring-boot-keycloak/.mvn/wrapper/maven-wrapper.properties b/spring-boot-modules/spring-boot-keycloak/.mvn/wrapper/maven-wrapper.properties similarity index 100% rename from spring-boot-keycloak/.mvn/wrapper/maven-wrapper.properties rename to spring-boot-modules/spring-boot-keycloak/.mvn/wrapper/maven-wrapper.properties diff --git a/spring-boot-keycloak/README.md b/spring-boot-modules/spring-boot-keycloak/README.md similarity index 100% rename from spring-boot-keycloak/README.md rename to spring-boot-modules/spring-boot-keycloak/README.md diff --git a/spring-boot-keycloak/mvnw b/spring-boot-modules/spring-boot-keycloak/mvnw similarity index 100% rename from spring-boot-keycloak/mvnw rename to spring-boot-modules/spring-boot-keycloak/mvnw diff --git a/spring-boot-keycloak/mvnw.cmd b/spring-boot-modules/spring-boot-keycloak/mvnw.cmd similarity index 100% rename from spring-boot-keycloak/mvnw.cmd rename to spring-boot-modules/spring-boot-keycloak/mvnw.cmd diff --git a/spring-boot-keycloak/pom.xml b/spring-boot-modules/spring-boot-keycloak/pom.xml similarity index 98% rename from spring-boot-keycloak/pom.xml rename to spring-boot-modules/spring-boot-keycloak/pom.xml index 609b4d1dec..c29c1a738b 100644 --- a/spring-boot-keycloak/pom.xml +++ b/spring-boot-modules/spring-boot-keycloak/pom.xml @@ -13,7 +13,7 @@ com.baeldung parent-boot-1 0.0.1-SNAPSHOT - ../parent-boot-1 + ../../parent-boot-1 diff --git a/spring-boot-keycloak/src/main/java/com/baeldung/keycloak/Customer.java b/spring-boot-modules/spring-boot-keycloak/src/main/java/com/baeldung/keycloak/Customer.java similarity index 100% rename from spring-boot-keycloak/src/main/java/com/baeldung/keycloak/Customer.java rename to spring-boot-modules/spring-boot-keycloak/src/main/java/com/baeldung/keycloak/Customer.java diff --git a/spring-boot-keycloak/src/main/java/com/baeldung/keycloak/CustomerDAO.java b/spring-boot-modules/spring-boot-keycloak/src/main/java/com/baeldung/keycloak/CustomerDAO.java similarity index 100% rename from spring-boot-keycloak/src/main/java/com/baeldung/keycloak/CustomerDAO.java rename to spring-boot-modules/spring-boot-keycloak/src/main/java/com/baeldung/keycloak/CustomerDAO.java diff --git a/spring-boot-keycloak/src/main/java/com/baeldung/keycloak/SecurityConfig.java b/spring-boot-modules/spring-boot-keycloak/src/main/java/com/baeldung/keycloak/SecurityConfig.java similarity index 100% rename from spring-boot-keycloak/src/main/java/com/baeldung/keycloak/SecurityConfig.java rename to spring-boot-modules/spring-boot-keycloak/src/main/java/com/baeldung/keycloak/SecurityConfig.java diff --git a/spring-boot-keycloak/src/main/java/com/baeldung/keycloak/SpringBoot.java b/spring-boot-modules/spring-boot-keycloak/src/main/java/com/baeldung/keycloak/SpringBoot.java similarity index 100% rename from spring-boot-keycloak/src/main/java/com/baeldung/keycloak/SpringBoot.java rename to spring-boot-modules/spring-boot-keycloak/src/main/java/com/baeldung/keycloak/SpringBoot.java diff --git a/spring-boot-keycloak/src/main/java/com/baeldung/keycloak/WebController.java b/spring-boot-modules/spring-boot-keycloak/src/main/java/com/baeldung/keycloak/WebController.java similarity index 100% rename from spring-boot-keycloak/src/main/java/com/baeldung/keycloak/WebController.java rename to spring-boot-modules/spring-boot-keycloak/src/main/java/com/baeldung/keycloak/WebController.java diff --git a/spring-boot-keycloak/src/main/resources/application.properties b/spring-boot-modules/spring-boot-keycloak/src/main/resources/application.properties similarity index 100% rename from spring-boot-keycloak/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-keycloak/src/main/resources/application.properties diff --git a/spring-boot-gradle/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-keycloak/src/main/resources/logback.xml similarity index 100% rename from spring-boot-gradle/src/main/resources/logback.xml rename to spring-boot-modules/spring-boot-keycloak/src/main/resources/logback.xml diff --git a/spring-boot-keycloak/src/main/resources/templates/customers.html b/spring-boot-modules/spring-boot-keycloak/src/main/resources/templates/customers.html similarity index 100% rename from spring-boot-keycloak/src/main/resources/templates/customers.html rename to spring-boot-modules/spring-boot-keycloak/src/main/resources/templates/customers.html diff --git a/spring-boot-keycloak/src/main/resources/templates/external.html b/spring-boot-modules/spring-boot-keycloak/src/main/resources/templates/external.html similarity index 100% rename from spring-boot-keycloak/src/main/resources/templates/external.html rename to spring-boot-modules/spring-boot-keycloak/src/main/resources/templates/external.html diff --git a/spring-boot-keycloak/src/main/resources/templates/layout.html b/spring-boot-modules/spring-boot-keycloak/src/main/resources/templates/layout.html similarity index 100% rename from spring-boot-keycloak/src/main/resources/templates/layout.html rename to spring-boot-modules/spring-boot-keycloak/src/main/resources/templates/layout.html diff --git a/spring-boot-keycloak/src/test/java/com/baeldung/keycloak/KeycloakConfigurationIntegrationTest.java b/spring-boot-modules/spring-boot-keycloak/src/test/java/com/baeldung/keycloak/KeycloakConfigurationIntegrationTest.java similarity index 100% rename from spring-boot-keycloak/src/test/java/com/baeldung/keycloak/KeycloakConfigurationIntegrationTest.java rename to spring-boot-modules/spring-boot-keycloak/src/test/java/com/baeldung/keycloak/KeycloakConfigurationIntegrationTest.java diff --git a/spring-boot-keycloak/src/test/java/org/baeldung/SpringContextTest.java b/spring-boot-modules/spring-boot-keycloak/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-boot-keycloak/src/test/java/org/baeldung/SpringContextTest.java rename to spring-boot-modules/spring-boot-keycloak/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-boot-kotlin/README.md b/spring-boot-modules/spring-boot-kotlin/README.md similarity index 74% rename from spring-boot-kotlin/README.md rename to spring-boot-modules/spring-boot-kotlin/README.md index d393805ed1..fb91fdee15 100644 --- a/spring-boot-kotlin/README.md +++ b/spring-boot-modules/spring-boot-kotlin/README.md @@ -3,4 +3,4 @@ This module contains articles about Kotlin in Spring Boot projects. ### Relevant Articles: -- [Non-blocking Spring Boot with Kotlin Coroutines](https://www.baeldung.com/non-blocking-spring-boot-with-kotlin-coroutines) +- [Non-blocking Spring Boot with Kotlin Coroutines](https://www.baeldung.com/spring-boot-kotlin-coroutines) diff --git a/spring-boot-kotlin/pom.xml b/spring-boot-modules/spring-boot-kotlin/pom.xml similarity index 98% rename from spring-boot-kotlin/pom.xml rename to spring-boot-modules/spring-boot-kotlin/pom.xml index a98d76a398..79d62645da 100644 --- a/spring-boot-kotlin/pom.xml +++ b/spring-boot-modules/spring-boot-kotlin/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-kotlin 1.0.0-SNAPSHOT - ../parent-kotlin + ../../parent-kotlin diff --git a/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/SpringApplication.kt b/spring-boot-modules/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/SpringApplication.kt similarity index 100% rename from spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/SpringApplication.kt rename to spring-boot-modules/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/SpringApplication.kt diff --git a/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/config/DatastoreConfig.kt b/spring-boot-modules/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/config/DatastoreConfig.kt similarity index 100% rename from spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/config/DatastoreConfig.kt rename to spring-boot-modules/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/config/DatastoreConfig.kt diff --git a/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/config/RouterConfiguration.kt b/spring-boot-modules/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/config/RouterConfiguration.kt similarity index 100% rename from spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/config/RouterConfiguration.kt rename to spring-boot-modules/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/config/RouterConfiguration.kt diff --git a/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/config/WebClientConfiguration.kt b/spring-boot-modules/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/config/WebClientConfiguration.kt similarity index 100% rename from spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/config/WebClientConfiguration.kt rename to spring-boot-modules/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/config/WebClientConfiguration.kt diff --git a/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/controller/ProductController.kt b/spring-boot-modules/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/controller/ProductController.kt similarity index 100% rename from spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/controller/ProductController.kt rename to spring-boot-modules/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/controller/ProductController.kt diff --git a/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/controller/ProductControllerCoroutines.kt b/spring-boot-modules/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/controller/ProductControllerCoroutines.kt similarity index 100% rename from spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/controller/ProductControllerCoroutines.kt rename to spring-boot-modules/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/controller/ProductControllerCoroutines.kt diff --git a/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/controller/ProductStockView.kt b/spring-boot-modules/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/controller/ProductStockView.kt similarity index 100% rename from spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/controller/ProductStockView.kt rename to spring-boot-modules/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/controller/ProductStockView.kt diff --git a/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/handlers/ProductsHandler.kt b/spring-boot-modules/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/handlers/ProductsHandler.kt similarity index 100% rename from spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/handlers/ProductsHandler.kt rename to spring-boot-modules/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/handlers/ProductsHandler.kt diff --git a/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/model/Product.kt b/spring-boot-modules/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/model/Product.kt similarity index 100% rename from spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/model/Product.kt rename to spring-boot-modules/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/model/Product.kt diff --git a/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/repository/ProductRepository.kt b/spring-boot-modules/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/repository/ProductRepository.kt similarity index 100% rename from spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/repository/ProductRepository.kt rename to spring-boot-modules/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/repository/ProductRepository.kt diff --git a/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/repository/ProductRepositoryCoroutines.kt b/spring-boot-modules/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/repository/ProductRepositoryCoroutines.kt similarity index 100% rename from spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/repository/ProductRepositoryCoroutines.kt rename to spring-boot-modules/spring-boot-kotlin/src/main/kotlin/com/baeldung/nonblockingcoroutines/repository/ProductRepositoryCoroutines.kt diff --git a/spring-boot-kotlin/src/main/resources/application.properties b/spring-boot-modules/spring-boot-kotlin/src/main/resources/application.properties similarity index 100% rename from spring-boot-kotlin/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-kotlin/src/main/resources/application.properties diff --git a/spring-boot-jasypt/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-kotlin/src/main/resources/logback.xml similarity index 100% rename from spring-boot-jasypt/src/main/resources/logback.xml rename to spring-boot-modules/spring-boot-kotlin/src/main/resources/logback.xml diff --git a/spring-boot-kotlin/src/test/kotlin/com/baeldung/nonblockingcoroutines/ProductHandlerTest.kt b/spring-boot-modules/spring-boot-kotlin/src/test/kotlin/com/baeldung/nonblockingcoroutines/ProductHandlerTest.kt similarity index 100% rename from spring-boot-kotlin/src/test/kotlin/com/baeldung/nonblockingcoroutines/ProductHandlerTest.kt rename to spring-boot-modules/spring-boot-kotlin/src/test/kotlin/com/baeldung/nonblockingcoroutines/ProductHandlerTest.kt diff --git a/spring-boot-libraries/.gitignore b/spring-boot-modules/spring-boot-libraries/.gitignore similarity index 100% rename from spring-boot-libraries/.gitignore rename to spring-boot-modules/spring-boot-libraries/.gitignore diff --git a/spring-boot-libraries/README.md b/spring-boot-modules/spring-boot-libraries/README.md similarity index 100% rename from spring-boot-libraries/README.md rename to spring-boot-modules/spring-boot-libraries/README.md diff --git a/spring-boot-libraries/mvnw b/spring-boot-modules/spring-boot-libraries/mvnw similarity index 100% rename from spring-boot-libraries/mvnw rename to spring-boot-modules/spring-boot-libraries/mvnw diff --git a/spring-boot-libraries/mvnw.cmd b/spring-boot-modules/spring-boot-libraries/mvnw.cmd similarity index 100% rename from spring-boot-libraries/mvnw.cmd rename to spring-boot-modules/spring-boot-libraries/mvnw.cmd diff --git a/spring-boot-libraries/pom.xml b/spring-boot-modules/spring-boot-libraries/pom.xml similarity index 99% rename from spring-boot-libraries/pom.xml rename to spring-boot-modules/spring-boot-libraries/pom.xml index d9c9073542..ba1164dd59 100644 --- a/spring-boot-libraries/pom.xml +++ b/spring-boot-modules/spring-boot-libraries/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-boot-libraries/src/main/java/com/baeldung/boot/Application.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/boot/Application.java similarity index 100% rename from spring-boot-libraries/src/main/java/com/baeldung/boot/Application.java rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/boot/Application.java diff --git a/spring-boot-libraries/src/main/java/com/baeldung/boot/problem/SpringProblemApplication.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/boot/problem/SpringProblemApplication.java similarity index 100% rename from spring-boot-libraries/src/main/java/com/baeldung/boot/problem/SpringProblemApplication.java rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/boot/problem/SpringProblemApplication.java diff --git a/spring-boot-libraries/src/main/java/com/baeldung/boot/problem/advice/ExceptionHandler.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/boot/problem/advice/ExceptionHandler.java similarity index 100% rename from spring-boot-libraries/src/main/java/com/baeldung/boot/problem/advice/ExceptionHandler.java rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/boot/problem/advice/ExceptionHandler.java diff --git a/spring-boot-libraries/src/main/java/com/baeldung/boot/problem/advice/SecurityExceptionHandler.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/boot/problem/advice/SecurityExceptionHandler.java similarity index 100% rename from spring-boot-libraries/src/main/java/com/baeldung/boot/problem/advice/SecurityExceptionHandler.java rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/boot/problem/advice/SecurityExceptionHandler.java diff --git a/spring-boot-libraries/src/main/java/com/baeldung/boot/problem/configuration/ProblemDemoConfiguration.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/boot/problem/configuration/ProblemDemoConfiguration.java similarity index 100% rename from spring-boot-libraries/src/main/java/com/baeldung/boot/problem/configuration/ProblemDemoConfiguration.java rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/boot/problem/configuration/ProblemDemoConfiguration.java diff --git a/spring-boot-libraries/src/main/java/com/baeldung/boot/problem/configuration/SecurityConfiguration.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/boot/problem/configuration/SecurityConfiguration.java similarity index 100% rename from spring-boot-libraries/src/main/java/com/baeldung/boot/problem/configuration/SecurityConfiguration.java rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/boot/problem/configuration/SecurityConfiguration.java diff --git a/spring-boot-libraries/src/main/java/com/baeldung/boot/problem/controller/ProblemDemoController.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/boot/problem/controller/ProblemDemoController.java similarity index 100% rename from spring-boot-libraries/src/main/java/com/baeldung/boot/problem/controller/ProblemDemoController.java rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/boot/problem/controller/ProblemDemoController.java diff --git a/spring-boot-libraries/src/main/java/com/baeldung/boot/problem/dto/Task.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/boot/problem/dto/Task.java similarity index 100% rename from spring-boot-libraries/src/main/java/com/baeldung/boot/problem/dto/Task.java rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/boot/problem/dto/Task.java diff --git a/spring-boot-libraries/src/main/java/com/baeldung/boot/problem/problems/TaskNotFoundProblem.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/boot/problem/problems/TaskNotFoundProblem.java similarity index 100% rename from spring-boot-libraries/src/main/java/com/baeldung/boot/problem/problems/TaskNotFoundProblem.java rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/boot/problem/problems/TaskNotFoundProblem.java diff --git a/spring-boot-libraries/src/main/java/com/baeldung/scheduling/shedlock/SchedulerConfiguration.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/scheduling/shedlock/SchedulerConfiguration.java similarity index 100% rename from spring-boot-libraries/src/main/java/com/baeldung/scheduling/shedlock/SchedulerConfiguration.java rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/scheduling/shedlock/SchedulerConfiguration.java diff --git a/spring-boot-libraries/src/main/java/com/baeldung/scheduling/shedlock/TaskScheduler.java b/spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/scheduling/shedlock/TaskScheduler.java similarity index 100% rename from spring-boot-libraries/src/main/java/com/baeldung/scheduling/shedlock/TaskScheduler.java rename to spring-boot-modules/spring-boot-libraries/src/main/java/com/baeldung/scheduling/shedlock/TaskScheduler.java diff --git a/spring-boot-libraries/src/main/resources/application-problem.properties b/spring-boot-modules/spring-boot-libraries/src/main/resources/application-problem.properties similarity index 100% rename from spring-boot-libraries/src/main/resources/application-problem.properties rename to spring-boot-modules/spring-boot-libraries/src/main/resources/application-problem.properties diff --git a/spring-boot-libraries/src/test/java/com/baeldung/boot/problem/controller/ProblemDemoControllerIntegrationTest.java b/spring-boot-modules/spring-boot-libraries/src/test/java/com/baeldung/boot/problem/controller/ProblemDemoControllerIntegrationTest.java similarity index 100% rename from spring-boot-libraries/src/test/java/com/baeldung/boot/problem/controller/ProblemDemoControllerIntegrationTest.java rename to spring-boot-modules/spring-boot-libraries/src/test/java/com/baeldung/boot/problem/controller/ProblemDemoControllerIntegrationTest.java diff --git a/spring-boot-logging-log4j2/.gitignore b/spring-boot-modules/spring-boot-logging-log4j2/.gitignore similarity index 100% rename from spring-boot-logging-log4j2/.gitignore rename to spring-boot-modules/spring-boot-logging-log4j2/.gitignore diff --git a/spring-boot-logging-log4j2/README.md b/spring-boot-modules/spring-boot-logging-log4j2/README.md similarity index 100% rename from spring-boot-logging-log4j2/README.md rename to spring-boot-modules/spring-boot-logging-log4j2/README.md diff --git a/spring-boot-logging-log4j2/pom.xml b/spring-boot-modules/spring-boot-logging-log4j2/pom.xml similarity index 98% rename from spring-boot-logging-log4j2/pom.xml rename to spring-boot-modules/spring-boot-logging-log4j2/pom.xml index a7065bc925..6e709230dd 100644 --- a/spring-boot-logging-log4j2/pom.xml +++ b/spring-boot-modules/spring-boot-logging-log4j2/pom.xml @@ -12,7 +12,7 @@ org.springframework.boot spring-boot-starter-parent - 2.2.1.RELEASE + 2.2.2.RELEASE diff --git a/spring-boot-logging-log4j2/src/main/java/com/baeldung/graylog/GraylogDemoApplication.java b/spring-boot-modules/spring-boot-logging-log4j2/src/main/java/com/baeldung/graylog/GraylogDemoApplication.java similarity index 100% rename from spring-boot-logging-log4j2/src/main/java/com/baeldung/graylog/GraylogDemoApplication.java rename to spring-boot-modules/spring-boot-logging-log4j2/src/main/java/com/baeldung/graylog/GraylogDemoApplication.java diff --git a/spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/LoggingController.java b/spring-boot-modules/spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/LoggingController.java similarity index 100% rename from spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/LoggingController.java rename to spring-boot-modules/spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/LoggingController.java diff --git a/spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/LombokLoggingController.java b/spring-boot-modules/spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/LombokLoggingController.java similarity index 100% rename from spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/LombokLoggingController.java rename to spring-boot-modules/spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/LombokLoggingController.java diff --git a/spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/SpringBootLoggingApplication.java b/spring-boot-modules/spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/SpringBootLoggingApplication.java similarity index 100% rename from spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/SpringBootLoggingApplication.java rename to spring-boot-modules/spring-boot-logging-log4j2/src/main/java/com/baeldung/springbootlogging/SpringBootLoggingApplication.java diff --git a/spring-boot-logging-log4j2/src/main/resources/application.properties b/spring-boot-modules/spring-boot-logging-log4j2/src/main/resources/application.properties similarity index 100% rename from spring-boot-logging-log4j2/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-logging-log4j2/src/main/resources/application.properties diff --git a/spring-boot-logging-log4j2/src/main/resources/log4j.xml b/spring-boot-modules/spring-boot-logging-log4j2/src/main/resources/log4j.xml similarity index 100% rename from spring-boot-logging-log4j2/src/main/resources/log4j.xml rename to spring-boot-modules/spring-boot-logging-log4j2/src/main/resources/log4j.xml diff --git a/spring-boot-logging-log4j2/src/main/resources/log4j2-spring.xml b/spring-boot-modules/spring-boot-logging-log4j2/src/main/resources/log4j2-spring.xml similarity index 100% rename from spring-boot-logging-log4j2/src/main/resources/log4j2-spring.xml rename to spring-boot-modules/spring-boot-logging-log4j2/src/main/resources/log4j2-spring.xml diff --git a/spring-boot-logging-log4j2/src/test/java/org/baeldung/SpringContextTest.java b/spring-boot-modules/spring-boot-logging-log4j2/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-boot-logging-log4j2/src/test/java/org/baeldung/SpringContextTest.java rename to spring-boot-modules/spring-boot-logging-log4j2/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-boot-mvc-2/.gitignore b/spring-boot-modules/spring-boot-mvc-2/.gitignore similarity index 100% rename from spring-boot-mvc-2/.gitignore rename to spring-boot-modules/spring-boot-mvc-2/.gitignore diff --git a/spring-boot-mvc-2/README.md b/spring-boot-modules/spring-boot-mvc-2/README.md similarity index 81% rename from spring-boot-mvc-2/README.md rename to spring-boot-modules/spring-boot-mvc-2/README.md index 81a969bf87..dae815a1c1 100644 --- a/spring-boot-mvc-2/README.md +++ b/spring-boot-modules/spring-boot-mvc-2/README.md @@ -5,5 +5,5 @@ This module contains articles about Spring Web MVC in Spring Boot projects. ### Relevant Articles: - [Functional Controllers in Spring MVC](https://www.baeldung.com/spring-mvc-functional-controllers) -- [Specify an array of strings as body parameter in Swagger API](https://www.baeldung.com/array-of-strings-as-body-parameter-in-swagger-api) +- [Specify an array of strings as body parameter in Swagger API](https://www.baeldung.com/swagger-body-array-of-strings) - More articles: [[prev -->]](/spring-boot-mvc) diff --git a/spring-boot-mvc-2/pom.xml b/spring-boot-modules/spring-boot-mvc-2/pom.xml similarity index 92% rename from spring-boot-mvc-2/pom.xml rename to spring-boot-modules/spring-boot-mvc-2/pom.xml index 0f5a4bcd77..edebd41986 100644 --- a/spring-boot-mvc-2/pom.xml +++ b/spring-boot-modules/spring-boot-mvc-2/pom.xml @@ -9,10 +9,10 @@ Module For Spring Boot MVC Web Fn - org.springframework.boot - spring-boot-starter-parent - 2.2.0.BUILD-SNAPSHOT - + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../../parent-boot-2 @@ -102,6 +102,7 @@ 3.0.0-SNAPSHOT com.baeldung.swagger2boot.SpringBootSwaggerApplication + 2.2.0.BUILD-SNAPSHOT \ No newline at end of file diff --git a/spring-boot-mvc-2/src/main/java/com/baeldung/springbootmvc/SpringBootMvcFnApplication.java b/spring-boot-modules/spring-boot-mvc-2/src/main/java/com/baeldung/springbootmvc/SpringBootMvcFnApplication.java similarity index 100% rename from spring-boot-mvc-2/src/main/java/com/baeldung/springbootmvc/SpringBootMvcFnApplication.java rename to spring-boot-modules/spring-boot-mvc-2/src/main/java/com/baeldung/springbootmvc/SpringBootMvcFnApplication.java diff --git a/spring-boot-mvc-2/src/main/java/com/baeldung/springbootmvc/ctrl/ProductController.java b/spring-boot-modules/spring-boot-mvc-2/src/main/java/com/baeldung/springbootmvc/ctrl/ProductController.java similarity index 100% rename from spring-boot-mvc-2/src/main/java/com/baeldung/springbootmvc/ctrl/ProductController.java rename to spring-boot-modules/spring-boot-mvc-2/src/main/java/com/baeldung/springbootmvc/ctrl/ProductController.java diff --git a/spring-boot-mvc-2/src/main/java/com/baeldung/springbootmvc/model/Product.java b/spring-boot-modules/spring-boot-mvc-2/src/main/java/com/baeldung/springbootmvc/model/Product.java similarity index 100% rename from spring-boot-mvc-2/src/main/java/com/baeldung/springbootmvc/model/Product.java rename to spring-boot-modules/spring-boot-mvc-2/src/main/java/com/baeldung/springbootmvc/model/Product.java diff --git a/spring-boot-mvc-2/src/main/java/com/baeldung/springbootmvc/svc/ProductService.java b/spring-boot-modules/spring-boot-mvc-2/src/main/java/com/baeldung/springbootmvc/svc/ProductService.java similarity index 100% rename from spring-boot-mvc-2/src/main/java/com/baeldung/springbootmvc/svc/ProductService.java rename to spring-boot-modules/spring-boot-mvc-2/src/main/java/com/baeldung/springbootmvc/svc/ProductService.java diff --git a/spring-boot-mvc-2/src/main/java/com/baeldung/swagger2boot/SpringBootSwaggerApplication.java b/spring-boot-modules/spring-boot-mvc-2/src/main/java/com/baeldung/swagger2boot/SpringBootSwaggerApplication.java similarity index 100% rename from spring-boot-mvc-2/src/main/java/com/baeldung/swagger2boot/SpringBootSwaggerApplication.java rename to spring-boot-modules/spring-boot-mvc-2/src/main/java/com/baeldung/swagger2boot/SpringBootSwaggerApplication.java diff --git a/spring-boot-mvc-2/src/main/java/com/baeldung/swagger2boot/config/Swagger2Config.java b/spring-boot-modules/spring-boot-mvc-2/src/main/java/com/baeldung/swagger2boot/config/Swagger2Config.java similarity index 100% rename from spring-boot-mvc-2/src/main/java/com/baeldung/swagger2boot/config/Swagger2Config.java rename to spring-boot-modules/spring-boot-mvc-2/src/main/java/com/baeldung/swagger2boot/config/Swagger2Config.java diff --git a/spring-boot-mvc-2/src/main/java/com/baeldung/swagger2boot/controller/FooController.java b/spring-boot-modules/spring-boot-mvc-2/src/main/java/com/baeldung/swagger2boot/controller/FooController.java similarity index 100% rename from spring-boot-mvc-2/src/main/java/com/baeldung/swagger2boot/controller/FooController.java rename to spring-boot-modules/spring-boot-mvc-2/src/main/java/com/baeldung/swagger2boot/controller/FooController.java diff --git a/spring-boot-mvc-2/src/main/java/com/baeldung/swagger2boot/model/Foo.java b/spring-boot-modules/spring-boot-mvc-2/src/main/java/com/baeldung/swagger2boot/model/Foo.java similarity index 100% rename from spring-boot-mvc-2/src/main/java/com/baeldung/swagger2boot/model/Foo.java rename to spring-boot-modules/spring-boot-mvc-2/src/main/java/com/baeldung/swagger2boot/model/Foo.java diff --git a/spring-boot-mvc-2/src/main/resources/application.properties b/spring-boot-modules/spring-boot-mvc-2/src/main/resources/application.properties similarity index 100% rename from spring-boot-mvc-2/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-mvc-2/src/main/resources/application.properties diff --git a/spring-boot-keycloak/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-mvc-2/src/main/resources/logback.xml similarity index 100% rename from spring-boot-keycloak/src/main/resources/logback.xml rename to spring-boot-modules/spring-boot-mvc-2/src/main/resources/logback.xml diff --git a/spring-boot-mvc-2/src/main/resources/swagger-description.yml b/spring-boot-modules/spring-boot-mvc-2/src/main/resources/swagger-description.yml similarity index 100% rename from spring-boot-mvc-2/src/main/resources/swagger-description.yml rename to spring-boot-modules/spring-boot-mvc-2/src/main/resources/swagger-description.yml diff --git a/spring-boot-mvc-birt/README.md b/spring-boot-modules/spring-boot-mvc-birt/README.md similarity index 100% rename from spring-boot-mvc-birt/README.md rename to spring-boot-modules/spring-boot-mvc-birt/README.md diff --git a/spring-boot-mvc-birt/pom.xml b/spring-boot-modules/spring-boot-mvc-birt/pom.xml similarity index 98% rename from spring-boot-mvc-birt/pom.xml rename to spring-boot-modules/spring-boot-mvc-birt/pom.xml index 76760e661b..f65b851f30 100644 --- a/spring-boot-mvc-birt/pom.xml +++ b/spring-boot-modules/spring-boot-mvc-birt/pom.xml @@ -13,7 +13,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/spring-boot-mvc-birt/reports/csv_data_report.rptdesign b/spring-boot-modules/spring-boot-mvc-birt/reports/csv_data_report.rptdesign similarity index 100% rename from spring-boot-mvc-birt/reports/csv_data_report.rptdesign rename to spring-boot-modules/spring-boot-mvc-birt/reports/csv_data_report.rptdesign diff --git a/spring-boot-mvc-birt/reports/data.csv b/spring-boot-modules/spring-boot-mvc-birt/reports/data.csv similarity index 100% rename from spring-boot-mvc-birt/reports/data.csv rename to spring-boot-modules/spring-boot-mvc-birt/reports/data.csv diff --git a/spring-boot-mvc-birt/reports/static_report.rptdesign b/spring-boot-modules/spring-boot-mvc-birt/reports/static_report.rptdesign similarity index 100% rename from spring-boot-mvc-birt/reports/static_report.rptdesign rename to spring-boot-modules/spring-boot-mvc-birt/reports/static_report.rptdesign diff --git a/spring-boot-mvc-birt/src/main/java/com/baeldung/birt/designer/ReportDesignApplication.java b/spring-boot-modules/spring-boot-mvc-birt/src/main/java/com/baeldung/birt/designer/ReportDesignApplication.java similarity index 100% rename from spring-boot-mvc-birt/src/main/java/com/baeldung/birt/designer/ReportDesignApplication.java rename to spring-boot-modules/spring-boot-mvc-birt/src/main/java/com/baeldung/birt/designer/ReportDesignApplication.java diff --git a/spring-boot-mvc-birt/src/main/java/com/baeldung/birt/engine/ReportEngineApplication.java b/spring-boot-modules/spring-boot-mvc-birt/src/main/java/com/baeldung/birt/engine/ReportEngineApplication.java similarity index 100% rename from spring-boot-mvc-birt/src/main/java/com/baeldung/birt/engine/ReportEngineApplication.java rename to spring-boot-modules/spring-boot-mvc-birt/src/main/java/com/baeldung/birt/engine/ReportEngineApplication.java diff --git a/spring-boot-mvc-birt/src/main/java/com/baeldung/birt/engine/controller/BirtReportController.java b/spring-boot-modules/spring-boot-mvc-birt/src/main/java/com/baeldung/birt/engine/controller/BirtReportController.java similarity index 100% rename from spring-boot-mvc-birt/src/main/java/com/baeldung/birt/engine/controller/BirtReportController.java rename to spring-boot-modules/spring-boot-mvc-birt/src/main/java/com/baeldung/birt/engine/controller/BirtReportController.java diff --git a/spring-boot-mvc-birt/src/main/java/com/baeldung/birt/engine/dto/OutputType.java b/spring-boot-modules/spring-boot-mvc-birt/src/main/java/com/baeldung/birt/engine/dto/OutputType.java similarity index 100% rename from spring-boot-mvc-birt/src/main/java/com/baeldung/birt/engine/dto/OutputType.java rename to spring-boot-modules/spring-boot-mvc-birt/src/main/java/com/baeldung/birt/engine/dto/OutputType.java diff --git a/spring-boot-mvc-birt/src/main/java/com/baeldung/birt/engine/dto/Report.java b/spring-boot-modules/spring-boot-mvc-birt/src/main/java/com/baeldung/birt/engine/dto/Report.java similarity index 100% rename from spring-boot-mvc-birt/src/main/java/com/baeldung/birt/engine/dto/Report.java rename to spring-boot-modules/spring-boot-mvc-birt/src/main/java/com/baeldung/birt/engine/dto/Report.java diff --git a/spring-boot-mvc-birt/src/main/java/com/baeldung/birt/engine/service/BirtReportService.java b/spring-boot-modules/spring-boot-mvc-birt/src/main/java/com/baeldung/birt/engine/service/BirtReportService.java similarity index 100% rename from spring-boot-mvc-birt/src/main/java/com/baeldung/birt/engine/service/BirtReportService.java rename to spring-boot-modules/spring-boot-mvc-birt/src/main/java/com/baeldung/birt/engine/service/BirtReportService.java diff --git a/spring-boot-mvc-birt/src/main/resources/application.properties b/spring-boot-modules/spring-boot-mvc-birt/src/main/resources/application.properties similarity index 100% rename from spring-boot-mvc-birt/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-mvc-birt/src/main/resources/application.properties diff --git a/spring-boot-mvc/.gitignore b/spring-boot-modules/spring-boot-mvc/.gitignore similarity index 100% rename from spring-boot-mvc/.gitignore rename to spring-boot-modules/spring-boot-mvc/.gitignore diff --git a/spring-boot-mvc/README.md b/spring-boot-modules/spring-boot-mvc/README.md similarity index 100% rename from spring-boot-mvc/README.md rename to spring-boot-modules/spring-boot-mvc/README.md diff --git a/spring-boot-mvc/pom.xml b/spring-boot-modules/spring-boot-mvc/pom.xml similarity index 98% rename from spring-boot-mvc/pom.xml rename to spring-boot-modules/spring-boot-mvc/pom.xml index 06400a3502..6a951ace93 100644 --- a/spring-boot-mvc/pom.xml +++ b/spring-boot-modules/spring-boot-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-boot-mvc/src/main/java/com/baeldung/accessparamsjs/App.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/accessparamsjs/App.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/accessparamsjs/App.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/accessparamsjs/App.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/accessparamsjs/Controller.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/accessparamsjs/Controller.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/accessparamsjs/Controller.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/accessparamsjs/Controller.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/annotations/Bike.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/Bike.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/annotations/Bike.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/Bike.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/annotations/Biker.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/Biker.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/annotations/Biker.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/Biker.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/annotations/Car.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/Car.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/annotations/Car.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/Car.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/annotations/CarMechanic.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/CarMechanic.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/annotations/CarMechanic.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/CarMechanic.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/annotations/CarUtility.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/CarUtility.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/annotations/CarUtility.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/CarUtility.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/annotations/CustomException.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/CustomException.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/annotations/CustomException.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/CustomException.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/annotations/Driver.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/Driver.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/annotations/Driver.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/Driver.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/annotations/Engine.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/Engine.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/annotations/Engine.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/Engine.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/annotations/PerformanceAspect.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/PerformanceAspect.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/annotations/PerformanceAspect.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/PerformanceAspect.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/annotations/Vehicle.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/Vehicle.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/annotations/Vehicle.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/Vehicle.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/annotations/VehicleController.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/VehicleController.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/annotations/VehicleController.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/VehicleController.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/annotations/VehicleFactoryApplication.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/VehicleFactoryApplication.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/annotations/VehicleFactoryApplication.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/VehicleFactoryApplication.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/annotations/VehicleFactoryConfig.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/VehicleFactoryConfig.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/annotations/VehicleFactoryConfig.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/VehicleFactoryConfig.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/annotations/VehicleRepository.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/VehicleRepository.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/annotations/VehicleRepository.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/VehicleRepository.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/annotations/VehicleRestController.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/VehicleRestController.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/annotations/VehicleRestController.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/VehicleRestController.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/annotations/VehicleService.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/VehicleService.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/annotations/VehicleService.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/annotations/VehicleService.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/nosuchbeandefinitionexception/BeanA.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/nosuchbeandefinitionexception/BeanA.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/nosuchbeandefinitionexception/BeanA.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/nosuchbeandefinitionexception/BeanA.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/nosuchbeandefinitionexception/BeanB.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/nosuchbeandefinitionexception/BeanB.java similarity index 93% rename from spring-boot-mvc/src/main/java/com/baeldung/nosuchbeandefinitionexception/BeanB.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/nosuchbeandefinitionexception/BeanB.java index f0cc263504..9fc228b201 100644 --- a/spring-boot-mvc/src/main/java/com/baeldung/nosuchbeandefinitionexception/BeanB.java +++ b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/nosuchbeandefinitionexception/BeanB.java @@ -1,5 +1,5 @@ -package com.baeldung.nosuchbeandefinitionexception; - -public class BeanB { - -} +package com.baeldung.nosuchbeandefinitionexception; + +public class BeanB { + +} diff --git a/spring-boot-mvc/src/main/java/com/baeldung/nosuchbeandefinitionexception/NoSuchBeanDefinitionDemoApp.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/nosuchbeandefinitionexception/NoSuchBeanDefinitionDemoApp.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/nosuchbeandefinitionexception/NoSuchBeanDefinitionDemoApp.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/nosuchbeandefinitionexception/NoSuchBeanDefinitionDemoApp.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/responseentity/CustomResponseController.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/responseentity/CustomResponseController.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/responseentity/CustomResponseController.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/responseentity/CustomResponseController.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/responseentity/CustomResponseWithBuilderController.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/responseentity/CustomResponseWithBuilderController.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/responseentity/CustomResponseWithBuilderController.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/responseentity/CustomResponseWithBuilderController.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/rss/RssFeedApplication.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/rss/RssFeedApplication.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/rss/RssFeedApplication.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/rss/RssFeedApplication.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/rss/RssFeedController.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/rss/RssFeedController.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/rss/RssFeedController.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/rss/RssFeedController.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/rss/RssFeedView.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/rss/RssFeedView.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/rss/RssFeedView.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/rss/RssFeedView.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduleJobsByProfile.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduleJobsByProfile.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduleJobsByProfile.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduleJobsByProfile.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJob.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJob.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJob.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJob.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJobsWithBoolean.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJobsWithBoolean.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJobsWithBoolean.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJobsWithBoolean.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJobsWithConditional.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJobsWithConditional.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJobsWithConditional.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJobsWithConditional.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJobsWithExpression.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJobsWithExpression.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJobsWithExpression.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/ScheduledJobsWithExpression.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/scheduling/SchedulingApplication.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/SchedulingApplication.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/scheduling/SchedulingApplication.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/scheduling/SchedulingApplication.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/springbootannotations/MySQLAutoconfiguration.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/springbootannotations/MySQLAutoconfiguration.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/springbootannotations/MySQLAutoconfiguration.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/springbootannotations/MySQLAutoconfiguration.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/LoggingController.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/LoggingController.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/LoggingController.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/LoggingController.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/LoginController.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/LoginController.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/LoginController.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/LoginController.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/SpringBootMvcApplication.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/SpringBootMvcApplication.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/SpringBootMvcApplication.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/SpringBootMvcApplication.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/config/CustomMessageSourceConfiguration.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/config/CustomMessageSourceConfiguration.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/config/CustomMessageSourceConfiguration.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/config/CustomMessageSourceConfiguration.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/config/FaviconConfiguration.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/config/FaviconConfiguration.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/config/FaviconConfiguration.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/config/FaviconConfiguration.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/jsfapplication/JsfApplication.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/jsfapplication/JsfApplication.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/jsfapplication/JsfApplication.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/jsfapplication/JsfApplication.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/jsfapplication/controller/JsfController.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/jsfapplication/controller/JsfController.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/jsfapplication/controller/JsfController.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/jsfapplication/controller/JsfController.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/jsfapplication/model/Dao.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/jsfapplication/model/Dao.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/jsfapplication/model/Dao.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/jsfapplication/model/Dao.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/jsfapplication/model/Todo.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/jsfapplication/model/Todo.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/jsfapplication/model/Todo.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/jsfapplication/model/Todo.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/jsfapplication/model/TodoDao.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/jsfapplication/model/TodoDao.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/jsfapplication/model/TodoDao.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/jsfapplication/model/TodoDao.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/jsfapplication/service/TodoService.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/jsfapplication/service/TodoService.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/jsfapplication/service/TodoService.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/jsfapplication/service/TodoService.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/model/LoginForm.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/model/LoginForm.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/model/LoginForm.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/springbootmvc/model/LoginForm.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/Application.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/Application.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/Application.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/Application.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/configuration/SpringFoxConfig.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/configuration/SpringFoxConfig.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/configuration/SpringFoxConfig.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/configuration/SpringFoxConfig.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/controller/RegularRestController.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/controller/RegularRestController.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/controller/RegularRestController.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/controller/RegularRestController.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/model/User.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/model/User.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/model/User.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/model/User.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/plugin/EmailAnnotationPlugin.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/plugin/EmailAnnotationPlugin.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/plugin/EmailAnnotationPlugin.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/plugin/EmailAnnotationPlugin.java diff --git a/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/repository/UserRepository.java b/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/repository/UserRepository.java similarity index 100% rename from spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/repository/UserRepository.java rename to spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/repository/UserRepository.java diff --git a/spring-boot-mvc/src/main/resources/application.properties b/spring-boot-modules/spring-boot-mvc/src/main/resources/application.properties similarity index 100% rename from spring-boot-mvc/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-mvc/src/main/resources/application.properties diff --git a/spring-boot-mvc/src/main/resources/com/baeldung/images/favicon.ico b/spring-boot-modules/spring-boot-mvc/src/main/resources/com/baeldung/images/favicon.ico similarity index 100% rename from spring-boot-mvc/src/main/resources/com/baeldung/images/favicon.ico rename to spring-boot-modules/spring-boot-mvc/src/main/resources/com/baeldung/images/favicon.ico diff --git a/spring-boot-mvc/src/main/resources/favicon.ico b/spring-boot-modules/spring-boot-mvc/src/main/resources/favicon.ico similarity index 100% rename from spring-boot-mvc/src/main/resources/favicon.ico rename to spring-boot-modules/spring-boot-mvc/src/main/resources/favicon.ico diff --git a/spring-boot-kotlin/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-mvc/src/main/resources/logback.xml similarity index 100% rename from spring-boot-kotlin/src/main/resources/logback.xml rename to spring-boot-modules/spring-boot-mvc/src/main/resources/logback.xml diff --git a/spring-boot-mvc/src/main/resources/messages.properties b/spring-boot-modules/spring-boot-mvc/src/main/resources/messages.properties similarity index 100% rename from spring-boot-mvc/src/main/resources/messages.properties rename to spring-boot-modules/spring-boot-mvc/src/main/resources/messages.properties diff --git a/spring-boot-mvc/src/main/resources/messages_fr.properties b/spring-boot-modules/spring-boot-mvc/src/main/resources/messages_fr.properties similarity index 100% rename from spring-boot-mvc/src/main/resources/messages_fr.properties rename to spring-boot-modules/spring-boot-mvc/src/main/resources/messages_fr.properties diff --git a/spring-boot-mvc/src/main/resources/mysql.properties b/spring-boot-modules/spring-boot-mvc/src/main/resources/mysql.properties similarity index 100% rename from spring-boot-mvc/src/main/resources/mysql.properties rename to spring-boot-modules/spring-boot-mvc/src/main/resources/mysql.properties diff --git a/spring-boot-mvc/src/main/resources/static/favicon.ico b/spring-boot-modules/spring-boot-mvc/src/main/resources/static/favicon.ico similarity index 100% rename from spring-boot-mvc/src/main/resources/static/favicon.ico rename to spring-boot-modules/spring-boot-mvc/src/main/resources/static/favicon.ico diff --git a/spring-boot-mvc/src/main/resources/static/index.html b/spring-boot-modules/spring-boot-mvc/src/main/resources/static/index.html similarity index 100% rename from spring-boot-mvc/src/main/resources/static/index.html rename to spring-boot-modules/spring-boot-mvc/src/main/resources/static/index.html diff --git a/spring-boot-mvc/src/main/resources/templates/thymeleaf/index.html b/spring-boot-modules/spring-boot-mvc/src/main/resources/templates/thymeleaf/index.html similarity index 100% rename from spring-boot-mvc/src/main/resources/templates/thymeleaf/index.html rename to spring-boot-modules/spring-boot-mvc/src/main/resources/templates/thymeleaf/index.html diff --git a/spring-boot-mvc/src/main/webapp/WEB-INF/faces-config.xml b/spring-boot-modules/spring-boot-mvc/src/main/webapp/WEB-INF/faces-config.xml similarity index 100% rename from spring-boot-mvc/src/main/webapp/WEB-INF/faces-config.xml rename to spring-boot-modules/spring-boot-mvc/src/main/webapp/WEB-INF/faces-config.xml diff --git a/spring-boot-mvc/src/main/webapp/WEB-INF/web.xml b/spring-boot-modules/spring-boot-mvc/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from spring-boot-mvc/src/main/webapp/WEB-INF/web.xml rename to spring-boot-modules/spring-boot-mvc/src/main/webapp/WEB-INF/web.xml diff --git a/spring-boot-mvc/src/main/webapp/index.xhtml b/spring-boot-modules/spring-boot-mvc/src/main/webapp/index.xhtml similarity index 100% rename from spring-boot-mvc/src/main/webapp/index.xhtml rename to spring-boot-modules/spring-boot-mvc/src/main/webapp/index.xhtml diff --git a/spring-boot-mvc/src/main/webapp/js/jquery.js b/spring-boot-modules/spring-boot-mvc/src/main/webapp/js/jquery.js similarity index 100% rename from spring-boot-mvc/src/main/webapp/js/jquery.js rename to spring-boot-modules/spring-boot-mvc/src/main/webapp/js/jquery.js diff --git a/spring-boot-mvc/src/main/webapp/js/script-async-jquery.js b/spring-boot-modules/spring-boot-mvc/src/main/webapp/js/script-async-jquery.js similarity index 100% rename from spring-boot-mvc/src/main/webapp/js/script-async-jquery.js rename to spring-boot-modules/spring-boot-mvc/src/main/webapp/js/script-async-jquery.js diff --git a/spring-boot-mvc/src/main/webapp/js/script-async.js b/spring-boot-modules/spring-boot-mvc/src/main/webapp/js/script-async.js similarity index 100% rename from spring-boot-mvc/src/main/webapp/js/script-async.js rename to spring-boot-modules/spring-boot-mvc/src/main/webapp/js/script-async.js diff --git a/spring-boot-mvc/src/main/webapp/js/script.js b/spring-boot-modules/spring-boot-mvc/src/main/webapp/js/script.js similarity index 100% rename from spring-boot-mvc/src/main/webapp/js/script.js rename to spring-boot-modules/spring-boot-mvc/src/main/webapp/js/script.js diff --git a/spring-boot-mvc/src/main/webapp/todo.xhtml b/spring-boot-modules/spring-boot-mvc/src/main/webapp/todo.xhtml similarity index 100% rename from spring-boot-mvc/src/main/webapp/todo.xhtml rename to spring-boot-modules/spring-boot-mvc/src/main/webapp/todo.xhtml diff --git a/spring-boot-mvc/src/test/java/com/baeldung/accessparamsjs/ControllerUnitTest.java b/spring-boot-modules/spring-boot-mvc/src/test/java/com/baeldung/accessparamsjs/ControllerUnitTest.java similarity index 100% rename from spring-boot-mvc/src/test/java/com/baeldung/accessparamsjs/ControllerUnitTest.java rename to spring-boot-modules/spring-boot-mvc/src/test/java/com/baeldung/accessparamsjs/ControllerUnitTest.java diff --git a/spring-boot-mvc/src/test/java/com/baeldung/rss/RssFeedUnitTest.java b/spring-boot-modules/spring-boot-mvc/src/test/java/com/baeldung/rss/RssFeedUnitTest.java similarity index 100% rename from spring-boot-mvc/src/test/java/com/baeldung/rss/RssFeedUnitTest.java rename to spring-boot-modules/spring-boot-mvc/src/test/java/com/baeldung/rss/RssFeedUnitTest.java diff --git a/spring-boot-mvc/src/test/java/com/baeldung/springbootmvc/LoginControllerUnitTest.java b/spring-boot-modules/spring-boot-mvc/src/test/java/com/baeldung/springbootmvc/LoginControllerUnitTest.java similarity index 95% rename from spring-boot-mvc/src/test/java/com/baeldung/springbootmvc/LoginControllerUnitTest.java rename to spring-boot-modules/spring-boot-mvc/src/test/java/com/baeldung/springbootmvc/LoginControllerUnitTest.java index 68229f459c..8ccf451e86 100644 --- a/spring-boot-mvc/src/test/java/com/baeldung/springbootmvc/LoginControllerUnitTest.java +++ b/spring-boot-modules/spring-boot-mvc/src/test/java/com/baeldung/springbootmvc/LoginControllerUnitTest.java @@ -15,7 +15,7 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; import com.baeldung.springbootmvc.config.CustomMessageSourceConfiguration; @RunWith(SpringRunner.class) -@WebMvcTest(value = LoginController.class, secure = false) +@WebMvcTest(value = LoginController.class) @ContextConfiguration(classes = { SpringBootMvcApplication.class, CustomMessageSourceConfiguration.class }) public class LoginControllerUnitTest { diff --git a/spring-boot-mvc/src/test/java/org/baeldung/SpringContextLiveTest.java b/spring-boot-modules/spring-boot-mvc/src/test/java/org/baeldung/SpringContextLiveTest.java similarity index 100% rename from spring-boot-mvc/src/test/java/org/baeldung/SpringContextLiveTest.java rename to spring-boot-modules/spring-boot-mvc/src/test/java/org/baeldung/SpringContextLiveTest.java diff --git a/spring-boot-mvc/src/test/java/org/baeldung/SpringContextTest.java b/spring-boot-modules/spring-boot-mvc/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-boot-mvc/src/test/java/org/baeldung/SpringContextTest.java rename to spring-boot-modules/spring-boot-mvc/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-boot-nashorn/README.md b/spring-boot-modules/spring-boot-nashorn/README.md similarity index 100% rename from spring-boot-nashorn/README.md rename to spring-boot-modules/spring-boot-nashorn/README.md diff --git a/spring-boot-nashorn/pom.xml b/spring-boot-modules/spring-boot-nashorn/pom.xml similarity index 96% rename from spring-boot-nashorn/pom.xml rename to spring-boot-modules/spring-boot-nashorn/pom.xml index af11f14fdc..c60997005d 100644 --- a/spring-boot-nashorn/pom.xml +++ b/spring-boot-modules/spring-boot-nashorn/pom.xml @@ -13,7 +13,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/spring-boot-nashorn/src/main/java/com/baeldung/nashorn/Application.java b/spring-boot-modules/spring-boot-nashorn/src/main/java/com/baeldung/nashorn/Application.java similarity index 100% rename from spring-boot-nashorn/src/main/java/com/baeldung/nashorn/Application.java rename to spring-boot-modules/spring-boot-nashorn/src/main/java/com/baeldung/nashorn/Application.java diff --git a/spring-boot-nashorn/src/main/java/com/baeldung/nashorn/controller/MyRestController.java b/spring-boot-modules/spring-boot-nashorn/src/main/java/com/baeldung/nashorn/controller/MyRestController.java similarity index 100% rename from spring-boot-nashorn/src/main/java/com/baeldung/nashorn/controller/MyRestController.java rename to spring-boot-modules/spring-boot-nashorn/src/main/java/com/baeldung/nashorn/controller/MyRestController.java diff --git a/spring-boot-nashorn/src/main/java/com/baeldung/nashorn/controller/MyWebController.java b/spring-boot-modules/spring-boot-nashorn/src/main/java/com/baeldung/nashorn/controller/MyWebController.java similarity index 100% rename from spring-boot-nashorn/src/main/java/com/baeldung/nashorn/controller/MyWebController.java rename to spring-boot-modules/spring-boot-nashorn/src/main/java/com/baeldung/nashorn/controller/MyWebController.java diff --git a/spring-boot-nashorn/src/main/resources/application.properties b/spring-boot-modules/spring-boot-nashorn/src/main/resources/application.properties similarity index 100% rename from spring-boot-nashorn/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-nashorn/src/main/resources/application.properties diff --git a/spring-boot-nashorn/src/main/resources/static/app.js b/spring-boot-modules/spring-boot-nashorn/src/main/resources/static/app.js similarity index 100% rename from spring-boot-nashorn/src/main/resources/static/app.js rename to spring-boot-modules/spring-boot-nashorn/src/main/resources/static/app.js diff --git a/spring-boot-nashorn/src/main/resources/static/js/react-dom-server.js b/spring-boot-modules/spring-boot-nashorn/src/main/resources/static/js/react-dom-server.js similarity index 100% rename from spring-boot-nashorn/src/main/resources/static/js/react-dom-server.js rename to spring-boot-modules/spring-boot-nashorn/src/main/resources/static/js/react-dom-server.js diff --git a/spring-boot-nashorn/src/main/resources/static/js/react-dom.js b/spring-boot-modules/spring-boot-nashorn/src/main/resources/static/js/react-dom.js similarity index 100% rename from spring-boot-nashorn/src/main/resources/static/js/react-dom.js rename to spring-boot-modules/spring-boot-nashorn/src/main/resources/static/js/react-dom.js diff --git a/spring-boot-nashorn/src/main/resources/static/js/react.js b/spring-boot-modules/spring-boot-nashorn/src/main/resources/static/js/react.js similarity index 100% rename from spring-boot-nashorn/src/main/resources/static/js/react.js rename to spring-boot-modules/spring-boot-nashorn/src/main/resources/static/js/react.js diff --git a/spring-boot-nashorn/src/main/webapp/WEB-INF/jsp/index.jsp b/spring-boot-modules/spring-boot-nashorn/src/main/webapp/WEB-INF/jsp/index.jsp similarity index 100% rename from spring-boot-nashorn/src/main/webapp/WEB-INF/jsp/index.jsp rename to spring-boot-modules/spring-boot-nashorn/src/main/webapp/WEB-INF/jsp/index.jsp diff --git a/spring-boot-performance/README.md b/spring-boot-modules/spring-boot-performance/README.md similarity index 100% rename from spring-boot-performance/README.md rename to spring-boot-modules/spring-boot-performance/README.md diff --git a/spring-boot-performance/pom.xml b/spring-boot-modules/spring-boot-performance/pom.xml similarity index 96% rename from spring-boot-performance/pom.xml rename to spring-boot-modules/spring-boot-performance/pom.xml index 7bf3885618..882763f0bc 100644 --- a/spring-boot-performance/pom.xml +++ b/spring-boot-modules/spring-boot-performance/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/spring-boot-performance/src/main/java/com/baeldung/lazyinitialization/Application.java b/spring-boot-modules/spring-boot-performance/src/main/java/com/baeldung/lazyinitialization/Application.java similarity index 100% rename from spring-boot-performance/src/main/java/com/baeldung/lazyinitialization/Application.java rename to spring-boot-modules/spring-boot-performance/src/main/java/com/baeldung/lazyinitialization/Application.java diff --git a/spring-boot-performance/src/main/java/com/baeldung/lazyinitialization/services/Writer.java b/spring-boot-modules/spring-boot-performance/src/main/java/com/baeldung/lazyinitialization/services/Writer.java similarity index 100% rename from spring-boot-performance/src/main/java/com/baeldung/lazyinitialization/services/Writer.java rename to spring-boot-modules/spring-boot-performance/src/main/java/com/baeldung/lazyinitialization/services/Writer.java diff --git a/spring-boot-performance/src/main/resources/application.yml b/spring-boot-modules/spring-boot-performance/src/main/resources/application.yml similarity index 100% rename from spring-boot-performance/src/main/resources/application.yml rename to spring-boot-modules/spring-boot-performance/src/main/resources/application.yml diff --git a/spring-boot-properties/README.md b/spring-boot-modules/spring-boot-properties/README.md similarity index 100% rename from spring-boot-properties/README.md rename to spring-boot-modules/spring-boot-properties/README.md diff --git a/spring-boot-properties/extra.properties b/spring-boot-modules/spring-boot-properties/extra.properties similarity index 100% rename from spring-boot-properties/extra.properties rename to spring-boot-modules/spring-boot-properties/extra.properties diff --git a/spring-boot-properties/extra2.properties b/spring-boot-modules/spring-boot-properties/extra2.properties similarity index 100% rename from spring-boot-properties/extra2.properties rename to spring-boot-modules/spring-boot-properties/extra2.properties diff --git a/spring-boot-properties/pom.xml b/spring-boot-modules/spring-boot-properties/pom.xml similarity index 98% rename from spring-boot-properties/pom.xml rename to spring-boot-modules/spring-boot-properties/pom.xml index 705a0eb786..5fa1a37792 100644 --- a/spring-boot-properties/pom.xml +++ b/spring-boot-modules/spring-boot-properties/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/spring-boot-properties/src/main/java/com/baeldung/configurationproperties/ConfigProperties.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configurationproperties/ConfigProperties.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/configurationproperties/ConfigProperties.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configurationproperties/ConfigProperties.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/configurationproperties/Employee.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configurationproperties/Employee.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/configurationproperties/Employee.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configurationproperties/Employee.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/configurationproperties/EmployeeConverter.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configurationproperties/EmployeeConverter.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/configurationproperties/EmployeeConverter.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configurationproperties/EmployeeConverter.java diff --git a/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configurationproperties/ImmutableConfigPropertiesApp.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configurationproperties/ImmutableConfigPropertiesApp.java new file mode 100644 index 0000000000..b9d84238c3 --- /dev/null +++ b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configurationproperties/ImmutableConfigPropertiesApp.java @@ -0,0 +1,14 @@ +package com.baeldung.configurationproperties; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.context.properties.ConfigurationPropertiesScan; + +@SpringBootApplication +@ConfigurationPropertiesScan +public class ImmutableConfigPropertiesApp { + + public static void main(String[] args) { + SpringApplication.run(ImmutableConfigPropertiesApp.class, args); + } +} diff --git a/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configurationproperties/ImmutableCredentials.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configurationproperties/ImmutableCredentials.java new file mode 100644 index 0000000000..a58e4143e5 --- /dev/null +++ b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configurationproperties/ImmutableCredentials.java @@ -0,0 +1,31 @@ +package com.baeldung.configurationproperties; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.ConstructorBinding; + +@ConfigurationProperties(prefix = "mail.credentials") +@ConstructorBinding +public class ImmutableCredentials { + + private final String authMethod; + private final String username; + private final String password; + + public ImmutableCredentials(String authMethod, String username, String password) { + this.authMethod = authMethod; + this.username = username; + this.password = password; + } + + public String getAuthMethod() { + return authMethod; + } + + public String getUsername() { + return username; + } + + public String getPassword() { + return password; + } +} diff --git a/spring-boot-properties/src/main/java/com/baeldung/configurationproperties/Item.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configurationproperties/Item.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/configurationproperties/Item.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configurationproperties/Item.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/configurationproperties/PropertiesConversionApplication.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configurationproperties/PropertiesConversionApplication.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/configurationproperties/PropertiesConversionApplication.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configurationproperties/PropertiesConversionApplication.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/configurationproperties/PropertyConversion.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configurationproperties/PropertyConversion.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/configurationproperties/PropertyConversion.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configurationproperties/PropertyConversion.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/properties/AdditionalConfiguration.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/AdditionalConfiguration.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/properties/AdditionalConfiguration.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/AdditionalConfiguration.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/properties/AdditionalProperties.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/AdditionalProperties.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/properties/AdditionalProperties.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/AdditionalProperties.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/properties/ConfigPropertiesDemoApplication.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/ConfigPropertiesDemoApplication.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/properties/ConfigPropertiesDemoApplication.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/ConfigPropertiesDemoApplication.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/properties/CustomJsonProperties.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/CustomJsonProperties.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/properties/CustomJsonProperties.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/CustomJsonProperties.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/properties/JsonProperties.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/JsonProperties.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/properties/JsonProperties.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/JsonProperties.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/properties/JsonPropertyContextInitializer.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/JsonPropertyContextInitializer.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/properties/JsonPropertyContextInitializer.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/JsonPropertyContextInitializer.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/properties/JsonPropertySourceFactory.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/JsonPropertySourceFactory.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/properties/JsonPropertySourceFactory.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/JsonPropertySourceFactory.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/properties/core/ComponentInXmlUsingProperties.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/core/ComponentInXmlUsingProperties.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/properties/core/ComponentInXmlUsingProperties.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/core/ComponentInXmlUsingProperties.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/properties/core/ComponentUsingProperties.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/core/ComponentUsingProperties.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/properties/core/ComponentUsingProperties.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/core/ComponentUsingProperties.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithJavaConfig.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithJavaConfig.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithJavaConfig.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithJavaConfig.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithXmlConfig.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithXmlConfig.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithXmlConfig.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithXmlConfig.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithXmlConfigOne.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithXmlConfigOne.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithXmlConfigOne.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithXmlConfigOne.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithXmlConfigTwo.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithXmlConfigTwo.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithXmlConfigTwo.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithXmlConfigTwo.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/properties/reloading/SpringBootPropertiesApplication.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/reloading/SpringBootPropertiesApplication.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/properties/reloading/SpringBootPropertiesApplication.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/reloading/SpringBootPropertiesApplication.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/properties/reloading/configs/PropertiesException.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/reloading/configs/PropertiesException.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/properties/reloading/configs/PropertiesException.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/reloading/configs/PropertiesException.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/properties/reloading/configs/ReloadableProperties.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/reloading/configs/ReloadableProperties.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/properties/reloading/configs/ReloadableProperties.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/reloading/configs/ReloadableProperties.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/properties/reloading/configs/ReloadablePropertySource.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/reloading/configs/ReloadablePropertySource.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/properties/reloading/configs/ReloadablePropertySource.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/reloading/configs/ReloadablePropertySource.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/properties/reloading/configs/ReloadablePropertySourceConfig.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/reloading/configs/ReloadablePropertySourceConfig.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/properties/reloading/configs/ReloadablePropertySourceConfig.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/reloading/configs/ReloadablePropertySourceConfig.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/properties/reloading/configs/ReloadablePropertySourceFactory.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/reloading/configs/ReloadablePropertySourceFactory.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/properties/reloading/configs/ReloadablePropertySourceFactory.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/reloading/configs/ReloadablePropertySourceFactory.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/properties/spring/BasicPropertiesWithJavaConfig.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/spring/BasicPropertiesWithJavaConfig.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/properties/spring/BasicPropertiesWithJavaConfig.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/spring/BasicPropertiesWithJavaConfig.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/properties/spring/PropertiesWithJavaConfig.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/spring/PropertiesWithJavaConfig.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/properties/spring/PropertiesWithJavaConfig.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/spring/PropertiesWithJavaConfig.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/properties/spring/PropertiesWithJavaConfigOther.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/spring/PropertiesWithJavaConfigOther.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/properties/spring/PropertiesWithJavaConfigOther.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/spring/PropertiesWithJavaConfigOther.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/properties/spring/PropertiesWithPlaceHolderConfigurer.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/spring/PropertiesWithPlaceHolderConfigurer.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/properties/spring/PropertiesWithPlaceHolderConfigurer.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/properties/spring/PropertiesWithPlaceHolderConfigurer.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/value/ClassNotManagedBySpring.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/value/ClassNotManagedBySpring.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/value/ClassNotManagedBySpring.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/value/ClassNotManagedBySpring.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/value/InitializerBean.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/value/InitializerBean.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/value/InitializerBean.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/value/InitializerBean.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/value/SomeBean.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/value/SomeBean.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/value/SomeBean.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/value/SomeBean.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/value/ValuesApp.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/value/ValuesApp.java similarity index 100% rename from spring-boot-properties/src/main/java/com/baeldung/value/ValuesApp.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/value/ValuesApp.java diff --git a/spring-boot-properties/src/main/java/com/baeldung/valuewithdefaults/ValuesWithDefaultsApp.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/valuewithdefaults/ValuesWithDefaultsApp.java similarity index 97% rename from spring-boot-properties/src/main/java/com/baeldung/valuewithdefaults/ValuesWithDefaultsApp.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/valuewithdefaults/ValuesWithDefaultsApp.java index d2cda19ae6..589f891e6b 100644 --- a/spring-boot-properties/src/main/java/com/baeldung/valuewithdefaults/ValuesWithDefaultsApp.java +++ b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/valuewithdefaults/ValuesWithDefaultsApp.java @@ -1,75 +1,75 @@ -package com.baeldung.valuewithdefaults; - -import java.util.Arrays; -import java.util.List; - -import javax.annotation.PostConstruct; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.AnnotationConfigApplicationContext; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.PropertySource; -import org.springframework.util.Assert; - -import com.google.common.collect.Lists; -import com.google.common.primitives.Ints; - -/** - * Demonstrates setting defaults for @Value annotation. Note that there are no properties - * defined in the specified property source. We also assume that the user here - * does not have a system property named some.key. - * - */ -@Configuration -@PropertySource(name = "myProperties", value = "valueswithdefaults.properties") -public class ValuesWithDefaultsApp { - - @Value("${some.key:my default value}") - private String stringWithDefaultValue; - - @Value("${some.key:}") - private String stringWithBlankDefaultValue; - - @Value("${some.key:true}") - private boolean booleanWithDefaultValue; - - @Value("${some.key:42}") - private int intWithDefaultValue; - - @Value("${some.key:one,two,three}") - private String[] stringArrayWithDefaults; - - @Value("${some.key:1,2,3}") - private int[] intArrayWithDefaults; - - @Value("#{systemProperties['some.key'] ?: 'my default system property value'}") - private String spelWithDefaultValue; - - - public static void main(String[] args) { - ApplicationContext applicationContext = new AnnotationConfigApplicationContext(ValuesWithDefaultsApp.class); - } - - @PostConstruct - public void afterInitialize() { - // strings - Assert.isTrue(stringWithDefaultValue.equals("my default value")); - Assert.isTrue(stringWithBlankDefaultValue.equals("")); - - // other primitives - Assert.isTrue(booleanWithDefaultValue); - Assert.isTrue(intWithDefaultValue == 42); - - // arrays - List stringListValues = Lists.newArrayList("one", "two", "three"); - Assert.isTrue(Arrays.asList(stringArrayWithDefaults).containsAll(stringListValues)); - - List intListValues = Lists.newArrayList(1, 2, 3); - Assert.isTrue(Ints.asList(intArrayWithDefaults).containsAll(intListValues)); - - // SpEL - Assert.isTrue(spelWithDefaultValue.equals("my default system property value")); - - } -} +package com.baeldung.valuewithdefaults; + +import java.util.Arrays; +import java.util.List; + +import javax.annotation.PostConstruct; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.PropertySource; +import org.springframework.util.Assert; + +import com.google.common.collect.Lists; +import com.google.common.primitives.Ints; + +/** + * Demonstrates setting defaults for @Value annotation. Note that there are no properties + * defined in the specified property source. We also assume that the user here + * does not have a system property named some.key. + * + */ +@Configuration +@PropertySource(name = "myProperties", value = "valueswithdefaults.properties") +public class ValuesWithDefaultsApp { + + @Value("${some.key:my default value}") + private String stringWithDefaultValue; + + @Value("${some.key:}") + private String stringWithBlankDefaultValue; + + @Value("${some.key:true}") + private boolean booleanWithDefaultValue; + + @Value("${some.key:42}") + private int intWithDefaultValue; + + @Value("${some.key:one,two,three}") + private String[] stringArrayWithDefaults; + + @Value("${some.key:1,2,3}") + private int[] intArrayWithDefaults; + + @Value("#{systemProperties['some.key'] ?: 'my default system property value'}") + private String spelWithDefaultValue; + + + public static void main(String[] args) { + ApplicationContext applicationContext = new AnnotationConfigApplicationContext(ValuesWithDefaultsApp.class); + } + + @PostConstruct + public void afterInitialize() { + // strings + Assert.isTrue(stringWithDefaultValue.equals("my default value")); + Assert.isTrue(stringWithBlankDefaultValue.equals("")); + + // other primitives + Assert.isTrue(booleanWithDefaultValue); + Assert.isTrue(intWithDefaultValue == 42); + + // arrays + List stringListValues = Lists.newArrayList("one", "two", "three"); + Assert.isTrue(Arrays.asList(stringArrayWithDefaults).containsAll(stringListValues)); + + List intListValues = Lists.newArrayList(1, 2, 3); + Assert.isTrue(Ints.asList(intArrayWithDefaults).containsAll(intListValues)); + + // SpEL + Assert.isTrue(spelWithDefaultValue.equals("my default system property value")); + + } +} diff --git a/spring-boot-properties/src/main/java/com/baeldung/yaml/MyApplication.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/yaml/MyApplication.java similarity index 97% rename from spring-boot-properties/src/main/java/com/baeldung/yaml/MyApplication.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/yaml/MyApplication.java index 4a585df998..d42b731213 100644 --- a/spring-boot-properties/src/main/java/com/baeldung/yaml/MyApplication.java +++ b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/yaml/MyApplication.java @@ -1,31 +1,31 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.baeldung.yaml; - -import java.util.Collections; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class MyApplication implements CommandLineRunner { - - @Autowired - private YAMLConfig myConfig; - - public static void main(String[] args) { - SpringApplication app = new SpringApplication(MyApplication.class); - app.run(); - } - - public void run(String... args) throws Exception { - System.out.println("using environment:" + myConfig.getEnvironment()); - System.out.println("name:" + myConfig.getName()); - System.out.println("servers:" + myConfig.getServers()); - } - -} +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.baeldung.yaml; + +import java.util.Collections; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class MyApplication implements CommandLineRunner { + + @Autowired + private YAMLConfig myConfig; + + public static void main(String[] args) { + SpringApplication app = new SpringApplication(MyApplication.class); + app.run(); + } + + public void run(String... args) throws Exception { + System.out.println("using environment:" + myConfig.getEnvironment()); + System.out.println("name:" + myConfig.getName()); + System.out.println("servers:" + myConfig.getServers()); + } + +} diff --git a/spring-boot-properties/src/main/java/com/baeldung/yaml/YAMLConfig.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/yaml/YAMLConfig.java similarity index 95% rename from spring-boot-properties/src/main/java/com/baeldung/yaml/YAMLConfig.java rename to spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/yaml/YAMLConfig.java index 313b920502..ad633c4b56 100644 --- a/spring-boot-properties/src/main/java/com/baeldung/yaml/YAMLConfig.java +++ b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/yaml/YAMLConfig.java @@ -1,41 +1,41 @@ -package com.baeldung.yaml; - -import java.util.ArrayList; -import java.util.List; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.context.annotation.Configuration; - -@Configuration -@EnableConfigurationProperties -@ConfigurationProperties -public class YAMLConfig { - private String name; - private String environment; - private List servers = new ArrayList(); - - public List getServers() { - return servers; - } - - public void setServers(List servers) { - this.servers = servers; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getEnvironment() { - return environment; - } - - public void setEnvironment(String environment) { - this.environment = environment; - } - -} +package com.baeldung.yaml; + +import java.util.ArrayList; +import java.util.List; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +@Configuration +@EnableConfigurationProperties +@ConfigurationProperties +public class YAMLConfig { + private String name; + private String environment; + private List servers = new ArrayList(); + + public List getServers() { + return servers; + } + + public void setServers(List servers) { + this.servers = servers; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getEnvironment() { + return environment; + } + + public void setEnvironment(String environment) { + this.environment = environment; + } + +} diff --git a/spring-boot-properties/src/main/resources/application.properties b/spring-boot-modules/spring-boot-properties/src/main/resources/application.properties similarity index 100% rename from spring-boot-properties/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-properties/src/main/resources/application.properties diff --git a/spring-boot-properties/src/main/resources/application.yml b/spring-boot-modules/spring-boot-properties/src/main/resources/application.yml similarity index 100% rename from spring-boot-properties/src/main/resources/application.yml rename to spring-boot-modules/spring-boot-properties/src/main/resources/application.yml diff --git a/spring-boot-properties/src/main/resources/bar.properties b/spring-boot-modules/spring-boot-properties/src/main/resources/bar.properties similarity index 100% rename from spring-boot-properties/src/main/resources/bar.properties rename to spring-boot-modules/spring-boot-properties/src/main/resources/bar.properties diff --git a/spring-boot-properties/src/main/resources/basicConfigForProperties.xml b/spring-boot-modules/spring-boot-properties/src/main/resources/basicConfigForProperties.xml similarity index 100% rename from spring-boot-properties/src/main/resources/basicConfigForProperties.xml rename to spring-boot-modules/spring-boot-properties/src/main/resources/basicConfigForProperties.xml diff --git a/spring-boot-properties/src/main/resources/basicConfigForPropertiesOne.xml b/spring-boot-modules/spring-boot-properties/src/main/resources/basicConfigForPropertiesOne.xml similarity index 100% rename from spring-boot-properties/src/main/resources/basicConfigForPropertiesOne.xml rename to spring-boot-modules/spring-boot-properties/src/main/resources/basicConfigForPropertiesOne.xml diff --git a/spring-boot-properties/src/main/resources/basicConfigForPropertiesTwo.xml b/spring-boot-modules/spring-boot-properties/src/main/resources/basicConfigForPropertiesTwo.xml similarity index 100% rename from spring-boot-properties/src/main/resources/basicConfigForPropertiesTwo.xml rename to spring-boot-modules/spring-boot-properties/src/main/resources/basicConfigForPropertiesTwo.xml diff --git a/spring-boot-properties/src/main/resources/child.properties b/spring-boot-modules/spring-boot-properties/src/main/resources/child.properties similarity index 100% rename from spring-boot-properties/src/main/resources/child.properties rename to spring-boot-modules/spring-boot-properties/src/main/resources/child.properties diff --git a/spring-boot-properties/src/main/resources/configForProperties.xml b/spring-boot-modules/spring-boot-properties/src/main/resources/configForProperties.xml similarity index 100% rename from spring-boot-properties/src/main/resources/configForProperties.xml rename to spring-boot-modules/spring-boot-properties/src/main/resources/configForProperties.xml diff --git a/spring-boot-properties/src/main/resources/configForPropertiesOne.xml b/spring-boot-modules/spring-boot-properties/src/main/resources/configForPropertiesOne.xml similarity index 100% rename from spring-boot-properties/src/main/resources/configForPropertiesOne.xml rename to spring-boot-modules/spring-boot-properties/src/main/resources/configForPropertiesOne.xml diff --git a/spring-boot-properties/src/main/resources/configprops.json b/spring-boot-modules/spring-boot-properties/src/main/resources/configprops.json similarity index 100% rename from spring-boot-properties/src/main/resources/configprops.json rename to spring-boot-modules/spring-boot-properties/src/main/resources/configprops.json diff --git a/spring-boot-properties/src/main/resources/configprops.properties b/spring-boot-modules/spring-boot-properties/src/main/resources/configprops.properties similarity index 100% rename from spring-boot-properties/src/main/resources/configprops.properties rename to spring-boot-modules/spring-boot-properties/src/main/resources/configprops.properties diff --git a/spring-boot-properties/src/main/resources/conversion.properties b/spring-boot-modules/spring-boot-properties/src/main/resources/conversion.properties similarity index 100% rename from spring-boot-properties/src/main/resources/conversion.properties rename to spring-boot-modules/spring-boot-properties/src/main/resources/conversion.properties diff --git a/spring-boot-properties/src/main/resources/foo.properties b/spring-boot-modules/spring-boot-properties/src/main/resources/foo.properties similarity index 100% rename from spring-boot-properties/src/main/resources/foo.properties rename to spring-boot-modules/spring-boot-properties/src/main/resources/foo.properties diff --git a/spring-boot-properties/src/main/resources/parent.properties b/spring-boot-modules/spring-boot-properties/src/main/resources/parent.properties similarity index 100% rename from spring-boot-properties/src/main/resources/parent.properties rename to spring-boot-modules/spring-boot-properties/src/main/resources/parent.properties diff --git a/spring-boot-properties/src/main/resources/values.properties b/spring-boot-modules/spring-boot-properties/src/main/resources/values.properties similarity index 100% rename from spring-boot-properties/src/main/resources/values.properties rename to spring-boot-modules/spring-boot-properties/src/main/resources/values.properties diff --git a/spring-boot-properties/src/main/resources/valueswithdefaults.properties b/spring-boot-modules/spring-boot-properties/src/main/resources/valueswithdefaults.properties similarity index 100% rename from spring-boot-properties/src/main/resources/valueswithdefaults.properties rename to spring-boot-modules/spring-boot-properties/src/main/resources/valueswithdefaults.properties diff --git a/spring-boot-properties/src/test/java/com/baeldung/configurationproperties/ConfigPropertiesIntegrationTest.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/configurationproperties/ConfigPropertiesIntegrationTest.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/configurationproperties/ConfigPropertiesIntegrationTest.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/configurationproperties/ConfigPropertiesIntegrationTest.java diff --git a/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/configurationproperties/ImmutableConfigurationPropertiesIntegrationTest.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/configurationproperties/ImmutableConfigurationPropertiesIntegrationTest.java new file mode 100644 index 0000000000..a45932f7be --- /dev/null +++ b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/configurationproperties/ImmutableConfigurationPropertiesIntegrationTest.java @@ -0,0 +1,26 @@ +package com.baeldung.configurationproperties; + +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.test.context.TestPropertySource; +import org.springframework.test.context.junit4.SpringRunner; + +import static org.assertj.core.api.Assertions.assertThat; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = ImmutableConfigPropertiesApp.class) +@TestPropertySource("classpath:configprops-test.properties") +public class ImmutableConfigurationPropertiesIntegrationTest { + + @Autowired + private ImmutableCredentials immutableCredentials; + + @Test + public void whenConstructorBindingUsed_thenPropertiesCorrectlyBound() { + assertThat(immutableCredentials.getAuthMethod()).isEqualTo("SHA1"); + assertThat(immutableCredentials.getUsername()).isEqualTo("john"); + assertThat(immutableCredentials.getPassword()).isEqualTo("password"); + } +} diff --git a/spring-boot-properties/src/test/java/com/baeldung/configurationproperties/PropertiesConversionIntegrationTest.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/configurationproperties/PropertiesConversionIntegrationTest.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/configurationproperties/PropertiesConversionIntegrationTest.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/configurationproperties/PropertiesConversionIntegrationTest.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/JsonPropertiesIntegrationTest.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/JsonPropertiesIntegrationTest.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/JsonPropertiesIntegrationTest.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/JsonPropertiesIntegrationTest.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/basic/BasicPropertiesWithJavaIntegrationTest.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/basic/BasicPropertiesWithJavaIntegrationTest.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/basic/BasicPropertiesWithJavaIntegrationTest.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/basic/BasicPropertiesWithJavaIntegrationTest.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/basic/ExtendedPropertiesWithJavaIntegrationTest.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/basic/ExtendedPropertiesWithJavaIntegrationTest.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/basic/ExtendedPropertiesWithJavaIntegrationTest.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/basic/ExtendedPropertiesWithJavaIntegrationTest.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/basic/PropertiesWithJavaIntegrationTest.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/basic/PropertiesWithJavaIntegrationTest.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/basic/PropertiesWithJavaIntegrationTest.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/basic/PropertiesWithJavaIntegrationTest.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/basic/PropertiesWithMultipleXmlsIntegrationTest.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/basic/PropertiesWithMultipleXmlsIntegrationTest.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/basic/PropertiesWithMultipleXmlsIntegrationTest.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/basic/PropertiesWithMultipleXmlsIntegrationTest.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/basic/PropertiesWithXmlIntegrationTest.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/basic/PropertiesWithXmlIntegrationTest.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/basic/PropertiesWithXmlIntegrationTest.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/basic/PropertiesWithXmlIntegrationTest.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/external/ExternalPropertiesWithJavaIntegrationTest.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/external/ExternalPropertiesWithJavaIntegrationTest.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/external/ExternalPropertiesWithJavaIntegrationTest.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/external/ExternalPropertiesWithJavaIntegrationTest.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/external/ExternalPropertiesWithMultipleXmlsIntegrationTest.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/external/ExternalPropertiesWithMultipleXmlsIntegrationTest.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/external/ExternalPropertiesWithMultipleXmlsIntegrationTest.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/external/ExternalPropertiesWithMultipleXmlsIntegrationTest.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/external/ExternalPropertiesWithXmlManualTest.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/external/ExternalPropertiesWithXmlManualTest.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/external/ExternalPropertiesWithXmlManualTest.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/external/ExternalPropertiesWithXmlManualTest.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/multiple/MultiplePropertiesJavaConfigIntegrationTest.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/multiple/MultiplePropertiesJavaConfigIntegrationTest.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/multiple/MultiplePropertiesJavaConfigIntegrationTest.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/multiple/MultiplePropertiesJavaConfigIntegrationTest.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/multiple/MultiplePropertiesXmlConfigIntegrationTest.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/multiple/MultiplePropertiesXmlConfigIntegrationTest.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/multiple/MultiplePropertiesXmlConfigIntegrationTest.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/multiple/MultiplePropertiesXmlConfigIntegrationTest.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ChildValueHolder.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ChildValueHolder.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ChildValueHolder.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ChildValueHolder.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ParentChildPropertyPlaceHolderPropertiesIntegrationTest.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ParentChildPropertyPlaceHolderPropertiesIntegrationTest.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ParentChildPropertyPlaceHolderPropertiesIntegrationTest.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ParentChildPropertyPlaceHolderPropertiesIntegrationTest.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ParentChildPropertySourcePropertiesIntegrationTest.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ParentChildPropertySourcePropertiesIntegrationTest.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ParentChildPropertySourcePropertiesIntegrationTest.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ParentChildPropertySourcePropertiesIntegrationTest.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ParentValueHolder.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ParentValueHolder.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ParentValueHolder.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ParentValueHolder.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ChildConfig.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ChildConfig.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ChildConfig.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ChildConfig.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ChildConfig2.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ChildConfig2.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ChildConfig2.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ChildConfig2.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ParentConfig.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ParentConfig.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ParentConfig.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ParentConfig.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ParentConfig2.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ParentConfig2.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ParentConfig2.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ParentConfig2.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/reloading/PropertiesReloadIntegrationTest.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/reloading/PropertiesReloadIntegrationTest.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/reloading/PropertiesReloadIntegrationTest.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/reloading/PropertiesReloadIntegrationTest.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/reloading/SpringBootPropertiesTestApplication.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/reloading/SpringBootPropertiesTestApplication.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/reloading/SpringBootPropertiesTestApplication.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/reloading/SpringBootPropertiesTestApplication.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/reloading/beans/ConfigurationPropertiesRefreshConfigBean.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/reloading/beans/ConfigurationPropertiesRefreshConfigBean.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/reloading/beans/ConfigurationPropertiesRefreshConfigBean.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/reloading/beans/ConfigurationPropertiesRefreshConfigBean.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/reloading/beans/EnvironmentConfigBean.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/reloading/beans/EnvironmentConfigBean.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/reloading/beans/EnvironmentConfigBean.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/reloading/beans/EnvironmentConfigBean.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/reloading/beans/PropertiesConfigBean.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/reloading/beans/PropertiesConfigBean.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/reloading/beans/PropertiesConfigBean.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/reloading/beans/PropertiesConfigBean.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/reloading/beans/ValueRefreshConfigBean.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/reloading/beans/ValueRefreshConfigBean.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/reloading/beans/ValueRefreshConfigBean.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/reloading/beans/ValueRefreshConfigBean.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/testproperty/FilePropertyInjectionUnitTest.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/testproperty/FilePropertyInjectionUnitTest.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/testproperty/FilePropertyInjectionUnitTest.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/testproperty/FilePropertyInjectionUnitTest.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/testproperty/PropertyInjectionUnitTest.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/testproperty/PropertyInjectionUnitTest.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/testproperty/PropertyInjectionUnitTest.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/testproperty/PropertyInjectionUnitTest.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/properties/testproperty/SpringBootPropertyInjectionIntegrationTest.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/testproperty/SpringBootPropertyInjectionIntegrationTest.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/properties/testproperty/SpringBootPropertyInjectionIntegrationTest.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/testproperty/SpringBootPropertyInjectionIntegrationTest.java diff --git a/spring-boot-properties/src/test/java/com/baeldung/test/IntegrationTestSuite.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/test/IntegrationTestSuite.java similarity index 97% rename from spring-boot-properties/src/test/java/com/baeldung/test/IntegrationTestSuite.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/test/IntegrationTestSuite.java index 722c4fd1c4..d41d328867 100644 --- a/spring-boot-properties/src/test/java/com/baeldung/test/IntegrationTestSuite.java +++ b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/test/IntegrationTestSuite.java @@ -1,25 +1,25 @@ -package com.baeldung.test; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import com.baeldung.properties.basic.ExtendedPropertiesWithJavaIntegrationTest; -import com.baeldung.properties.basic.PropertiesWithMultipleXmlsIntegrationTest; -import com.baeldung.properties.basic.PropertiesWithXmlIntegrationTest; -import com.baeldung.properties.external.ExternalPropertiesWithJavaIntegrationTest; -import com.baeldung.properties.external.ExternalPropertiesWithMultipleXmlsIntegrationTest; -import com.baeldung.properties.external.ExternalPropertiesWithXmlManualTest; - -@RunWith(Suite.class) -@SuiteClasses({ //@formatter:off - PropertiesWithXmlIntegrationTest.class, - ExternalPropertiesWithJavaIntegrationTest.class, - ExternalPropertiesWithMultipleXmlsIntegrationTest.class, - ExternalPropertiesWithXmlManualTest.class, - ExtendedPropertiesWithJavaIntegrationTest.class, - PropertiesWithMultipleXmlsIntegrationTest.class, -})// @formatter:on -public final class IntegrationTestSuite { - // -} +package com.baeldung.test; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; +import org.junit.runners.Suite.SuiteClasses; + +import com.baeldung.properties.basic.ExtendedPropertiesWithJavaIntegrationTest; +import com.baeldung.properties.basic.PropertiesWithMultipleXmlsIntegrationTest; +import com.baeldung.properties.basic.PropertiesWithXmlIntegrationTest; +import com.baeldung.properties.external.ExternalPropertiesWithJavaIntegrationTest; +import com.baeldung.properties.external.ExternalPropertiesWithMultipleXmlsIntegrationTest; +import com.baeldung.properties.external.ExternalPropertiesWithXmlManualTest; + +@RunWith(Suite.class) +@SuiteClasses({ //@formatter:off + PropertiesWithXmlIntegrationTest.class, + ExternalPropertiesWithJavaIntegrationTest.class, + ExternalPropertiesWithMultipleXmlsIntegrationTest.class, + ExternalPropertiesWithXmlManualTest.class, + ExtendedPropertiesWithJavaIntegrationTest.class, + PropertiesWithMultipleXmlsIntegrationTest.class, +})// @formatter:on +public final class IntegrationTestSuite { + // +} diff --git a/spring-boot-properties/src/test/java/com/baeldung/value/ClassNotManagedBySpringIntegrationTest.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/value/ClassNotManagedBySpringIntegrationTest.java similarity index 100% rename from spring-boot-properties/src/test/java/com/baeldung/value/ClassNotManagedBySpringIntegrationTest.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/value/ClassNotManagedBySpringIntegrationTest.java diff --git a/spring-boot-properties/src/test/resources/application.properties b/spring-boot-modules/spring-boot-properties/src/test/resources/application.properties similarity index 100% rename from spring-boot-properties/src/test/resources/application.properties rename to spring-boot-modules/spring-boot-properties/src/test/resources/application.properties diff --git a/spring-boot-properties/src/test/resources/configprops-test.properties b/spring-boot-modules/spring-boot-properties/src/test/resources/configprops-test.properties similarity index 100% rename from spring-boot-properties/src/test/resources/configprops-test.properties rename to spring-boot-modules/spring-boot-properties/src/test/resources/configprops-test.properties diff --git a/spring-boot-properties/src/test/resources/conversion.properties b/spring-boot-modules/spring-boot-properties/src/test/resources/conversion.properties similarity index 100% rename from spring-boot-properties/src/test/resources/conversion.properties rename to spring-boot-modules/spring-boot-properties/src/test/resources/conversion.properties diff --git a/spring-boot-properties/src/test/resources/foo.properties b/spring-boot-modules/spring-boot-properties/src/test/resources/foo.properties similarity index 100% rename from spring-boot-properties/src/test/resources/foo.properties rename to spring-boot-modules/spring-boot-properties/src/test/resources/foo.properties diff --git a/spring-boot-property-exp/README.md b/spring-boot-modules/spring-boot-property-exp/README.md similarity index 100% rename from spring-boot-property-exp/README.md rename to spring-boot-modules/spring-boot-property-exp/README.md diff --git a/spring-boot-property-exp/pom.xml b/spring-boot-modules/spring-boot-property-exp/pom.xml similarity index 85% rename from spring-boot-property-exp/pom.xml rename to spring-boot-modules/spring-boot-property-exp/pom.xml index b16fcd1c22..2da25fca31 100644 --- a/spring-boot-property-exp/pom.xml +++ b/spring-boot-modules/spring-boot-property-exp/pom.xml @@ -8,8 +8,8 @@ pom - com.baeldung - parent-modules + com.baeldung.spring-boot-modules + spring-boot-modules 1.0.0-SNAPSHOT diff --git a/spring-boot-property-exp/property-exp-custom-config/pom.xml b/spring-boot-modules/spring-boot-property-exp/property-exp-custom-config/pom.xml similarity index 98% rename from spring-boot-property-exp/property-exp-custom-config/pom.xml rename to spring-boot-modules/spring-boot-property-exp/property-exp-custom-config/pom.xml index 0118de7396..8ea9c8366d 100644 --- a/spring-boot-property-exp/property-exp-custom-config/pom.xml +++ b/spring-boot-modules/spring-boot-property-exp/property-exp-custom-config/pom.xml @@ -8,7 +8,7 @@ jar - com.baeldung + com.baeldung.spring-boot-modules spring-boot-property-exp 0.0.1-SNAPSHOT diff --git a/spring-boot-property-exp/property-exp-custom-config/src/main/java/com/baeldung/propertyexpansion/SpringBootPropertyExpansionApp.java b/spring-boot-modules/spring-boot-property-exp/property-exp-custom-config/src/main/java/com/baeldung/propertyexpansion/SpringBootPropertyExpansionApp.java similarity index 100% rename from spring-boot-property-exp/property-exp-custom-config/src/main/java/com/baeldung/propertyexpansion/SpringBootPropertyExpansionApp.java rename to spring-boot-modules/spring-boot-property-exp/property-exp-custom-config/src/main/java/com/baeldung/propertyexpansion/SpringBootPropertyExpansionApp.java diff --git a/spring-boot-property-exp/property-exp-custom-config/src/main/java/com/baeldung/propertyexpansion/components/PropertyLoggerBean.java b/spring-boot-modules/spring-boot-property-exp/property-exp-custom-config/src/main/java/com/baeldung/propertyexpansion/components/PropertyLoggerBean.java similarity index 100% rename from spring-boot-property-exp/property-exp-custom-config/src/main/java/com/baeldung/propertyexpansion/components/PropertyLoggerBean.java rename to spring-boot-modules/spring-boot-property-exp/property-exp-custom-config/src/main/java/com/baeldung/propertyexpansion/components/PropertyLoggerBean.java diff --git a/spring-boot-property-exp/property-exp-custom-config/src/main/resources/application.properties b/spring-boot-modules/spring-boot-property-exp/property-exp-custom-config/src/main/resources/application.properties similarity index 100% rename from spring-boot-property-exp/property-exp-custom-config/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-property-exp/property-exp-custom-config/src/main/resources/application.properties diff --git a/spring-boot-property-exp/property-exp-custom-config/src/main/resources/banner.txt b/spring-boot-modules/spring-boot-property-exp/property-exp-custom-config/src/main/resources/banner.txt similarity index 100% rename from spring-boot-property-exp/property-exp-custom-config/src/main/resources/banner.txt rename to spring-boot-modules/spring-boot-property-exp/property-exp-custom-config/src/main/resources/banner.txt diff --git a/spring-boot-mvc-2/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-property-exp/property-exp-custom-config/src/main/resources/logback.xml similarity index 100% rename from spring-boot-mvc-2/src/main/resources/logback.xml rename to spring-boot-modules/spring-boot-property-exp/property-exp-custom-config/src/main/resources/logback.xml diff --git a/spring-boot-property-exp/property-exp-custom-config/src/test/java/org/baeldung/SpringContextTest.java b/spring-boot-modules/spring-boot-property-exp/property-exp-custom-config/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-boot-property-exp/property-exp-custom-config/src/test/java/org/baeldung/SpringContextTest.java rename to spring-boot-modules/spring-boot-property-exp/property-exp-custom-config/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-boot-property-exp/property-exp-default-config/build.gradle b/spring-boot-modules/spring-boot-property-exp/property-exp-default-config/build.gradle similarity index 100% rename from spring-boot-property-exp/property-exp-default-config/build.gradle rename to spring-boot-modules/spring-boot-property-exp/property-exp-default-config/build.gradle diff --git a/spring-boot-property-exp/property-exp-default-config/gradle.properties b/spring-boot-modules/spring-boot-property-exp/property-exp-default-config/gradle.properties similarity index 100% rename from spring-boot-property-exp/property-exp-default-config/gradle.properties rename to spring-boot-modules/spring-boot-property-exp/property-exp-default-config/gradle.properties diff --git a/spring-boot-property-exp/property-exp-default-config/pom.xml b/spring-boot-modules/spring-boot-property-exp/property-exp-default-config/pom.xml similarity index 95% rename from spring-boot-property-exp/property-exp-default-config/pom.xml rename to spring-boot-modules/spring-boot-property-exp/property-exp-default-config/pom.xml index 9cb1de33f6..aa5b8ef34a 100644 --- a/spring-boot-property-exp/property-exp-default-config/pom.xml +++ b/spring-boot-modules/spring-boot-property-exp/property-exp-default-config/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-boot-property-exp/property-exp-default-config/settings.gradle b/spring-boot-modules/spring-boot-property-exp/property-exp-default-config/settings.gradle similarity index 100% rename from spring-boot-property-exp/property-exp-default-config/settings.gradle rename to spring-boot-modules/spring-boot-property-exp/property-exp-default-config/settings.gradle diff --git a/spring-boot-property-exp/property-exp-default-config/src/main/java/com/baeldung/propertyexpansion/SpringBootPropertyExpansionApp.java b/spring-boot-modules/spring-boot-property-exp/property-exp-default-config/src/main/java/com/baeldung/propertyexpansion/SpringBootPropertyExpansionApp.java similarity index 100% rename from spring-boot-property-exp/property-exp-default-config/src/main/java/com/baeldung/propertyexpansion/SpringBootPropertyExpansionApp.java rename to spring-boot-modules/spring-boot-property-exp/property-exp-default-config/src/main/java/com/baeldung/propertyexpansion/SpringBootPropertyExpansionApp.java diff --git a/spring-boot-property-exp/property-exp-default-config/src/main/java/com/baeldung/propertyexpansion/components/PropertyLoggerBean.java b/spring-boot-modules/spring-boot-property-exp/property-exp-default-config/src/main/java/com/baeldung/propertyexpansion/components/PropertyLoggerBean.java similarity index 100% rename from spring-boot-property-exp/property-exp-default-config/src/main/java/com/baeldung/propertyexpansion/components/PropertyLoggerBean.java rename to spring-boot-modules/spring-boot-property-exp/property-exp-default-config/src/main/java/com/baeldung/propertyexpansion/components/PropertyLoggerBean.java diff --git a/spring-boot-property-exp/property-exp-default-config/src/main/resources/application.properties b/spring-boot-modules/spring-boot-property-exp/property-exp-default-config/src/main/resources/application.properties similarity index 100% rename from spring-boot-property-exp/property-exp-default-config/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-property-exp/property-exp-default-config/src/main/resources/application.properties diff --git a/spring-boot-property-exp/property-exp-default-config/src/main/resources/banner.txt b/spring-boot-modules/spring-boot-property-exp/property-exp-default-config/src/main/resources/banner.txt similarity index 100% rename from spring-boot-property-exp/property-exp-default-config/src/main/resources/banner.txt rename to spring-boot-modules/spring-boot-property-exp/property-exp-default-config/src/main/resources/banner.txt diff --git a/spring-boot-mvc/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-property-exp/property-exp-default-config/src/main/resources/logback.xml similarity index 100% rename from spring-boot-mvc/src/main/resources/logback.xml rename to spring-boot-modules/spring-boot-property-exp/property-exp-default-config/src/main/resources/logback.xml diff --git a/spring-boot-property-exp/property-exp-default-config/src/test/java/org/baeldung/SpringContextTest.java b/spring-boot-modules/spring-boot-property-exp/property-exp-default-config/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-boot-property-exp/property-exp-default-config/src/test/java/org/baeldung/SpringContextTest.java rename to spring-boot-modules/spring-boot-property-exp/property-exp-default-config/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-boot-runtime/README.md b/spring-boot-modules/spring-boot-runtime/README.md similarity index 100% rename from spring-boot-runtime/README.md rename to spring-boot-modules/spring-boot-runtime/README.md diff --git a/spring-boot-runtime/disabling-console-jul/.gitignore b/spring-boot-modules/spring-boot-runtime/disabling-console-jul/.gitignore similarity index 100% rename from spring-boot-runtime/disabling-console-jul/.gitignore rename to spring-boot-modules/spring-boot-runtime/disabling-console-jul/.gitignore diff --git a/spring-boot-runtime/disabling-console-jul/README.md b/spring-boot-modules/spring-boot-runtime/disabling-console-jul/README.md similarity index 100% rename from spring-boot-runtime/disabling-console-jul/README.md rename to spring-boot-modules/spring-boot-runtime/disabling-console-jul/README.md diff --git a/spring-boot-runtime/disabling-console-jul/pom.xml b/spring-boot-modules/spring-boot-runtime/disabling-console-jul/pom.xml similarity index 91% rename from spring-boot-runtime/disabling-console-jul/pom.xml rename to spring-boot-modules/spring-boot-runtime/disabling-console-jul/pom.xml index 2dc1a834b6..2f1c9c2add 100644 --- a/spring-boot-runtime/disabling-console-jul/pom.xml +++ b/spring-boot-modules/spring-boot-runtime/disabling-console-jul/pom.xml @@ -7,9 +7,9 @@ - org.springframework.boot - spring-boot-starter-parent - 2.1.1.RELEASE + com.baeldung + spring-boot-runtime + 0.0.1-SNAPSHOT diff --git a/spring-boot-runtime/disabling-console-jul/src/main/java/com/baeldung/springbootlogging/disablingconsole/jul/properties/DisablingConsoleJulApp.java b/spring-boot-modules/spring-boot-runtime/disabling-console-jul/src/main/java/com/baeldung/springbootlogging/disablingconsole/jul/properties/DisablingConsoleJulApp.java similarity index 100% rename from spring-boot-runtime/disabling-console-jul/src/main/java/com/baeldung/springbootlogging/disablingconsole/jul/properties/DisablingConsoleJulApp.java rename to spring-boot-modules/spring-boot-runtime/disabling-console-jul/src/main/java/com/baeldung/springbootlogging/disablingconsole/jul/properties/DisablingConsoleJulApp.java diff --git a/spring-boot-runtime/disabling-console-jul/src/main/java/com/baeldung/springbootlogging/disablingconsole/jul/properties/controllers/DisabledConsoleRestController.java b/spring-boot-modules/spring-boot-runtime/disabling-console-jul/src/main/java/com/baeldung/springbootlogging/disablingconsole/jul/properties/controllers/DisabledConsoleRestController.java similarity index 100% rename from spring-boot-runtime/disabling-console-jul/src/main/java/com/baeldung/springbootlogging/disablingconsole/jul/properties/controllers/DisabledConsoleRestController.java rename to spring-boot-modules/spring-boot-runtime/disabling-console-jul/src/main/java/com/baeldung/springbootlogging/disablingconsole/jul/properties/controllers/DisabledConsoleRestController.java diff --git a/spring-boot-runtime/disabling-console-jul/src/main/resources/application.properties b/spring-boot-modules/spring-boot-runtime/disabling-console-jul/src/main/resources/application.properties similarity index 100% rename from spring-boot-runtime/disabling-console-jul/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-runtime/disabling-console-jul/src/main/resources/application.properties diff --git a/spring-boot-runtime/disabling-console-jul/src/main/resources/logging.properties b/spring-boot-modules/spring-boot-runtime/disabling-console-jul/src/main/resources/logging.properties similarity index 100% rename from spring-boot-runtime/disabling-console-jul/src/main/resources/logging.properties rename to spring-boot-modules/spring-boot-runtime/disabling-console-jul/src/main/resources/logging.properties diff --git a/spring-boot-runtime/disabling-console-log4j2/.gitignore b/spring-boot-modules/spring-boot-runtime/disabling-console-log4j2/.gitignore similarity index 100% rename from spring-boot-runtime/disabling-console-log4j2/.gitignore rename to spring-boot-modules/spring-boot-runtime/disabling-console-log4j2/.gitignore diff --git a/spring-boot-runtime/disabling-console-log4j2/README.md b/spring-boot-modules/spring-boot-runtime/disabling-console-log4j2/README.md similarity index 100% rename from spring-boot-runtime/disabling-console-log4j2/README.md rename to spring-boot-modules/spring-boot-runtime/disabling-console-log4j2/README.md diff --git a/spring-boot-runtime/disabling-console-log4j2/pom.xml b/spring-boot-modules/spring-boot-runtime/disabling-console-log4j2/pom.xml similarity index 90% rename from spring-boot-runtime/disabling-console-log4j2/pom.xml rename to spring-boot-modules/spring-boot-runtime/disabling-console-log4j2/pom.xml index b743c4bdac..35f54999ec 100644 --- a/spring-boot-runtime/disabling-console-log4j2/pom.xml +++ b/spring-boot-modules/spring-boot-runtime/disabling-console-log4j2/pom.xml @@ -7,9 +7,9 @@ - org.springframework.boot - spring-boot-starter-parent - 2.1.1.RELEASE + com.baeldung + spring-boot-runtime + 0.0.1-SNAPSHOT diff --git a/spring-boot-runtime/disabling-console-log4j2/src/main/java/com/baeldung/springbootlogging/disablingconsole/log4j2/xml/DisablingConsoleLog4j2App.java b/spring-boot-modules/spring-boot-runtime/disabling-console-log4j2/src/main/java/com/baeldung/springbootlogging/disablingconsole/log4j2/xml/DisablingConsoleLog4j2App.java similarity index 100% rename from spring-boot-runtime/disabling-console-log4j2/src/main/java/com/baeldung/springbootlogging/disablingconsole/log4j2/xml/DisablingConsoleLog4j2App.java rename to spring-boot-modules/spring-boot-runtime/disabling-console-log4j2/src/main/java/com/baeldung/springbootlogging/disablingconsole/log4j2/xml/DisablingConsoleLog4j2App.java diff --git a/spring-boot-runtime/disabling-console-log4j2/src/main/java/com/baeldung/springbootlogging/disablingconsole/log4j2/xml/controllers/DisabledConsoleRestController.java b/spring-boot-modules/spring-boot-runtime/disabling-console-log4j2/src/main/java/com/baeldung/springbootlogging/disablingconsole/log4j2/xml/controllers/DisabledConsoleRestController.java similarity index 100% rename from spring-boot-runtime/disabling-console-log4j2/src/main/java/com/baeldung/springbootlogging/disablingconsole/log4j2/xml/controllers/DisabledConsoleRestController.java rename to spring-boot-modules/spring-boot-runtime/disabling-console-log4j2/src/main/java/com/baeldung/springbootlogging/disablingconsole/log4j2/xml/controllers/DisabledConsoleRestController.java diff --git a/spring-boot-runtime/disabling-console-log4j2/src/main/resources/log4j2.xml b/spring-boot-modules/spring-boot-runtime/disabling-console-log4j2/src/main/resources/log4j2.xml similarity index 100% rename from spring-boot-runtime/disabling-console-log4j2/src/main/resources/log4j2.xml rename to spring-boot-modules/spring-boot-runtime/disabling-console-log4j2/src/main/resources/log4j2.xml diff --git a/spring-boot-runtime/disabling-console-logback/.gitignore b/spring-boot-modules/spring-boot-runtime/disabling-console-logback/.gitignore similarity index 100% rename from spring-boot-runtime/disabling-console-logback/.gitignore rename to spring-boot-modules/spring-boot-runtime/disabling-console-logback/.gitignore diff --git a/spring-boot-runtime/disabling-console-logback/README.md b/spring-boot-modules/spring-boot-runtime/disabling-console-logback/README.md similarity index 100% rename from spring-boot-runtime/disabling-console-logback/README.md rename to spring-boot-modules/spring-boot-runtime/disabling-console-logback/README.md diff --git a/spring-boot-runtime/disabling-console-logback/pom.xml b/spring-boot-modules/spring-boot-runtime/disabling-console-logback/pom.xml similarity index 86% rename from spring-boot-runtime/disabling-console-logback/pom.xml rename to spring-boot-modules/spring-boot-runtime/disabling-console-logback/pom.xml index 1a415328b6..c96dfb6a2f 100644 --- a/spring-boot-runtime/disabling-console-logback/pom.xml +++ b/spring-boot-modules/spring-boot-runtime/disabling-console-logback/pom.xml @@ -8,9 +8,8 @@ com.baeldung - spring-boot-disable-console-logging + spring-boot-runtime 0.0.1-SNAPSHOT - ../ diff --git a/spring-boot-runtime/disabling-console-logback/src/main/java/com/baeldung/springbootlogging/disablingconsole/logback/xml/DisablingConsoleLogbackApp.java b/spring-boot-modules/spring-boot-runtime/disabling-console-logback/src/main/java/com/baeldung/springbootlogging/disablingconsole/logback/xml/DisablingConsoleLogbackApp.java similarity index 100% rename from spring-boot-runtime/disabling-console-logback/src/main/java/com/baeldung/springbootlogging/disablingconsole/logback/xml/DisablingConsoleLogbackApp.java rename to spring-boot-modules/spring-boot-runtime/disabling-console-logback/src/main/java/com/baeldung/springbootlogging/disablingconsole/logback/xml/DisablingConsoleLogbackApp.java diff --git a/spring-boot-runtime/disabling-console-logback/src/main/java/com/baeldung/springbootlogging/disablingconsole/logback/xml/controllers/DisabledConsoleRestController.java b/spring-boot-modules/spring-boot-runtime/disabling-console-logback/src/main/java/com/baeldung/springbootlogging/disablingconsole/logback/xml/controllers/DisabledConsoleRestController.java similarity index 100% rename from spring-boot-runtime/disabling-console-logback/src/main/java/com/baeldung/springbootlogging/disablingconsole/logback/xml/controllers/DisabledConsoleRestController.java rename to spring-boot-modules/spring-boot-runtime/disabling-console-logback/src/main/java/com/baeldung/springbootlogging/disablingconsole/logback/xml/controllers/DisabledConsoleRestController.java diff --git a/spring-boot-runtime/disabling-console-logback/src/main/resources/application.properties b/spring-boot-modules/spring-boot-runtime/disabling-console-logback/src/main/resources/application.properties similarity index 100% rename from spring-boot-runtime/disabling-console-logback/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-runtime/disabling-console-logback/src/main/resources/application.properties diff --git a/spring-boot-runtime/disabling-console-logback/src/main/resources/logback-spring.xml b/spring-boot-modules/spring-boot-runtime/disabling-console-logback/src/main/resources/logback-spring.xml similarity index 100% rename from spring-boot-runtime/disabling-console-logback/src/main/resources/logback-spring.xml rename to spring-boot-modules/spring-boot-runtime/disabling-console-logback/src/main/resources/logback-spring.xml diff --git a/spring-boot-runtime/docker/Dockerfile b/spring-boot-modules/spring-boot-runtime/docker/Dockerfile similarity index 100% rename from spring-boot-runtime/docker/Dockerfile rename to spring-boot-modules/spring-boot-runtime/docker/Dockerfile diff --git a/spring-boot-runtime/docker/logback.xml b/spring-boot-modules/spring-boot-runtime/docker/logback.xml similarity index 100% rename from spring-boot-runtime/docker/logback.xml rename to spring-boot-modules/spring-boot-runtime/docker/logback.xml diff --git a/spring-boot-runtime/docker/run.sh b/spring-boot-modules/spring-boot-runtime/docker/run.sh similarity index 100% rename from spring-boot-runtime/docker/run.sh rename to spring-boot-modules/spring-boot-runtime/docker/run.sh diff --git a/spring-boot-runtime/pom.xml b/spring-boot-modules/spring-boot-runtime/pom.xml similarity index 95% rename from spring-boot-runtime/pom.xml rename to spring-boot-modules/spring-boot-runtime/pom.xml index baa7faebf8..df45537940 100644 --- a/spring-boot-runtime/pom.xml +++ b/spring-boot-modules/spring-boot-runtime/pom.xml @@ -4,16 +4,22 @@ 4.0.0 spring-boot-runtime spring-boot-runtime - war + pom Demo project for Spring Boot com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 + + disabling-console-jul + disabling-console-log4j2 + disabling-console-logback + + diff --git a/spring-boot-runtime/src/main/java/com/baeldung/changeport/CustomApplication.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/changeport/CustomApplication.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/changeport/CustomApplication.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/changeport/CustomApplication.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/changeport/ServerPortCustomizer.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/changeport/ServerPortCustomizer.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/changeport/ServerPortCustomizer.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/changeport/ServerPortCustomizer.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/cors/Account.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/cors/Account.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/cors/Account.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/cors/Account.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/cors/AccountController.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/cors/AccountController.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/cors/AccountController.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/cors/AccountController.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/restart/Application.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/restart/Application.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/restart/Application.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/restart/Application.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/restart/RestartController.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/restart/RestartController.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/restart/RestartController.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/restart/RestartController.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/restart/RestartService.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/restart/RestartService.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/restart/RestartService.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/restart/RestartService.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/config/MainApplication.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/config/MainApplication.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/sampleapp/config/MainApplication.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/config/MainApplication.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/config/RestClientConfig.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/config/RestClientConfig.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/sampleapp/config/RestClientConfig.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/config/RestClientConfig.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/config/WebConfig.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/config/WebConfig.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/sampleapp/config/WebConfig.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/config/WebConfig.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/interceptors/RestTemplateHeaderModifierInterceptor.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/interceptors/RestTemplateHeaderModifierInterceptor.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/sampleapp/interceptors/RestTemplateHeaderModifierInterceptor.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/interceptors/RestTemplateHeaderModifierInterceptor.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/repository/HeavyResourceRepository.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/repository/HeavyResourceRepository.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/sampleapp/repository/HeavyResourceRepository.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/repository/HeavyResourceRepository.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/BarMappingExamplesController.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/BarMappingExamplesController.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/BarMappingExamplesController.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/BarMappingExamplesController.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/CompanyController.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/CompanyController.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/CompanyController.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/CompanyController.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/DeferredResultController.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/DeferredResultController.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/DeferredResultController.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/DeferredResultController.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/HeavyResourceController.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/HeavyResourceController.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/HeavyResourceController.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/HeavyResourceController.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/ItemController.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/ItemController.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/ItemController.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/ItemController.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/MyFooController.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/MyFooController.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/MyFooController.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/MyFooController.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/PactController.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/PactController.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/PactController.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/PactController.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/SimplePostController.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/SimplePostController.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/SimplePostController.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/SimplePostController.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/mediatypes/CustomMediaTypeController.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/mediatypes/CustomMediaTypeController.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/mediatypes/CustomMediaTypeController.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/mediatypes/CustomMediaTypeController.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/redirect/RedirectController.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/redirect/RedirectController.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/redirect/RedirectController.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/controller/redirect/RedirectController.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/BaeldungItem.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/BaeldungItem.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/BaeldungItem.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/BaeldungItem.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/BaeldungItemV2.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/BaeldungItemV2.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/BaeldungItemV2.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/BaeldungItemV2.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/Company.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/Company.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/Company.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/Company.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/Foo.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/Foo.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/Foo.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/Foo.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/HeavyResource.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/HeavyResource.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/HeavyResource.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/HeavyResource.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/HeavyResourceAddressOnly.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/HeavyResourceAddressOnly.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/HeavyResourceAddressOnly.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/HeavyResourceAddressOnly.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/HeavyResourceAddressPartialUpdate.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/HeavyResourceAddressPartialUpdate.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/HeavyResourceAddressPartialUpdate.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/HeavyResourceAddressPartialUpdate.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/Item.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/Item.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/Item.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/Item.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/ItemManager.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/ItemManager.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/ItemManager.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/ItemManager.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/PactDto.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/PactDto.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/PactDto.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/PactDto.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/Views.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/Views.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/Views.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/dto/Views.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/exception/ResourceNotFoundException.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/exception/ResourceNotFoundException.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/exception/ResourceNotFoundException.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/sampleapp/web/exception/ResourceNotFoundException.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/shutdown/Application.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/shutdown/Application.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/shutdown/Application.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/shutdown/Application.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/shutdown/ShutdownConfig.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/shutdown/ShutdownConfig.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/shutdown/ShutdownConfig.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/shutdown/ShutdownConfig.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/shutdown/TerminateBean.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/shutdown/TerminateBean.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/shutdown/TerminateBean.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/shutdown/TerminateBean.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/shutdown/shutdown/ShutdownController.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/shutdown/shutdown/ShutdownController.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/shutdown/shutdown/ShutdownController.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/shutdown/shutdown/ShutdownController.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/logging/LoggingApplication.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/logging/LoggingApplication.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/logging/LoggingApplication.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/logging/LoggingApplication.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/logging/LoggingController.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/logging/LoggingController.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/logging/LoggingController.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/logging/LoggingController.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/logging/SecurityConfig.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/logging/SecurityConfig.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/logging/SecurityConfig.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/logging/SecurityConfig.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/trace/App.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/trace/App.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/trace/App.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/trace/App.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/trace/CustomTraceRepository.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/trace/CustomTraceRepository.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/trace/CustomTraceRepository.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/trace/CustomTraceRepository.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/trace/EchoController.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/trace/EchoController.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/trace/EchoController.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/trace/EchoController.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/trace/TraceRequestFilter.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/trace/TraceRequestFilter.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/trace/TraceRequestFilter.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/spring/boot/management/trace/TraceRequestFilter.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/web/log/app/Application.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/web/log/app/Application.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/web/log/app/Application.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/web/log/app/Application.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/web/log/app/TaxiFareRequestInterceptor.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/web/log/app/TaxiFareRequestInterceptor.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/web/log/app/TaxiFareRequestInterceptor.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/web/log/app/TaxiFareRequestInterceptor.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/web/log/config/CustomeRequestLoggingFilter.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/web/log/config/CustomeRequestLoggingFilter.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/web/log/config/CustomeRequestLoggingFilter.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/web/log/config/CustomeRequestLoggingFilter.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/web/log/config/RequestLoggingFilterConfig.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/web/log/config/RequestLoggingFilterConfig.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/web/log/config/RequestLoggingFilterConfig.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/web/log/config/RequestLoggingFilterConfig.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/web/log/config/TaxiFareMVCConfig.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/web/log/config/TaxiFareMVCConfig.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/web/log/config/TaxiFareMVCConfig.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/web/log/config/TaxiFareMVCConfig.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/web/log/controller/TaxiFareController.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/web/log/controller/TaxiFareController.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/web/log/controller/TaxiFareController.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/web/log/controller/TaxiFareController.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/web/log/data/RateCard.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/web/log/data/RateCard.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/web/log/data/RateCard.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/web/log/data/RateCard.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/web/log/data/TaxiRide.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/web/log/data/TaxiRide.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/web/log/data/TaxiRide.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/web/log/data/TaxiRide.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/web/log/service/TaxiFareCalculatorService.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/web/log/service/TaxiFareCalculatorService.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/web/log/service/TaxiFareCalculatorService.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/web/log/service/TaxiFareCalculatorService.java diff --git a/spring-boot-runtime/src/main/java/com/baeldung/web/log/util/RequestLoggingUtil.java b/spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/web/log/util/RequestLoggingUtil.java similarity index 100% rename from spring-boot-runtime/src/main/java/com/baeldung/web/log/util/RequestLoggingUtil.java rename to spring-boot-modules/spring-boot-runtime/src/main/java/com/baeldung/web/log/util/RequestLoggingUtil.java diff --git a/spring-boot-runtime/src/main/resources/application-log.properties b/spring-boot-modules/spring-boot-runtime/src/main/resources/application-log.properties similarity index 100% rename from spring-boot-runtime/src/main/resources/application-log.properties rename to spring-boot-modules/spring-boot-runtime/src/main/resources/application-log.properties diff --git a/spring-boot-runtime/src/main/resources/application-logging.properties b/spring-boot-modules/spring-boot-runtime/src/main/resources/application-logging.properties similarity index 100% rename from spring-boot-runtime/src/main/resources/application-logging.properties rename to spring-boot-modules/spring-boot-runtime/src/main/resources/application-logging.properties diff --git a/spring-boot-runtime/src/main/resources/application-tomcat.properties b/spring-boot-modules/spring-boot-runtime/src/main/resources/application-tomcat.properties similarity index 100% rename from spring-boot-runtime/src/main/resources/application-tomcat.properties rename to spring-boot-modules/spring-boot-runtime/src/main/resources/application-tomcat.properties diff --git a/spring-boot-runtime/src/main/resources/application.properties b/spring-boot-modules/spring-boot-runtime/src/main/resources/application.properties similarity index 100% rename from spring-boot-runtime/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-runtime/src/main/resources/application.properties diff --git a/spring-boot-property-exp/property-exp-custom-config/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-runtime/src/main/resources/logback.xml similarity index 100% rename from spring-boot-property-exp/property-exp-custom-config/src/main/resources/logback.xml rename to spring-boot-modules/spring-boot-runtime/src/main/resources/logback.xml diff --git a/spring-boot-runtime/src/main/webapp/WEB-INF/api-servlet.xml b/spring-boot-modules/spring-boot-runtime/src/main/webapp/WEB-INF/api-servlet.xml similarity index 100% rename from spring-boot-runtime/src/main/webapp/WEB-INF/api-servlet.xml rename to spring-boot-modules/spring-boot-runtime/src/main/webapp/WEB-INF/api-servlet.xml diff --git a/spring-boot-runtime/src/main/webapp/WEB-INF/company.html b/spring-boot-modules/spring-boot-runtime/src/main/webapp/WEB-INF/company.html similarity index 100% rename from spring-boot-runtime/src/main/webapp/WEB-INF/company.html rename to spring-boot-modules/spring-boot-runtime/src/main/webapp/WEB-INF/company.html diff --git a/spring-boot-runtime/src/main/webapp/WEB-INF/spring-views.xml b/spring-boot-modules/spring-boot-runtime/src/main/webapp/WEB-INF/spring-views.xml similarity index 100% rename from spring-boot-runtime/src/main/webapp/WEB-INF/spring-views.xml rename to spring-boot-modules/spring-boot-runtime/src/main/webapp/WEB-INF/spring-views.xml diff --git a/spring-boot-runtime/src/main/webapp/WEB-INF/web.xml b/spring-boot-modules/spring-boot-runtime/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from spring-boot-runtime/src/main/webapp/WEB-INF/web.xml rename to spring-boot-modules/spring-boot-runtime/src/main/webapp/WEB-INF/web.xml diff --git a/spring-boot-runtime/src/test/java/com/baeldung/restart/RestartApplicationManualTest.java b/spring-boot-modules/spring-boot-runtime/src/test/java/com/baeldung/restart/RestartApplicationManualTest.java similarity index 100% rename from spring-boot-runtime/src/test/java/com/baeldung/restart/RestartApplicationManualTest.java rename to spring-boot-modules/spring-boot-runtime/src/test/java/com/baeldung/restart/RestartApplicationManualTest.java diff --git a/spring-boot-runtime/src/test/java/com/baeldung/shutdown/ShutdownApplicationIntegrationTest.java b/spring-boot-modules/spring-boot-runtime/src/test/java/com/baeldung/shutdown/ShutdownApplicationIntegrationTest.java similarity index 100% rename from spring-boot-runtime/src/test/java/com/baeldung/shutdown/ShutdownApplicationIntegrationTest.java rename to spring-boot-modules/spring-boot-runtime/src/test/java/com/baeldung/shutdown/ShutdownApplicationIntegrationTest.java diff --git a/spring-boot-runtime/src/test/java/com/baeldung/web/controller/HeavyResourceControllerIntegrationTest.java b/spring-boot-modules/spring-boot-runtime/src/test/java/com/baeldung/web/controller/HeavyResourceControllerIntegrationTest.java similarity index 100% rename from spring-boot-runtime/src/test/java/com/baeldung/web/controller/HeavyResourceControllerIntegrationTest.java rename to spring-boot-modules/spring-boot-runtime/src/test/java/com/baeldung/web/controller/HeavyResourceControllerIntegrationTest.java diff --git a/spring-boot-runtime/src/test/java/com/baeldung/web/controller/TaxiFareControllerIntegrationTest.java b/spring-boot-modules/spring-boot-runtime/src/test/java/com/baeldung/web/controller/TaxiFareControllerIntegrationTest.java similarity index 100% rename from spring-boot-runtime/src/test/java/com/baeldung/web/controller/TaxiFareControllerIntegrationTest.java rename to spring-boot-modules/spring-boot-runtime/src/test/java/com/baeldung/web/controller/TaxiFareControllerIntegrationTest.java diff --git a/spring-boot-runtime/src/test/resources/application-integrationtest.properties b/spring-boot-modules/spring-boot-runtime/src/test/resources/application-integrationtest.properties similarity index 100% rename from spring-boot-runtime/src/test/resources/application-integrationtest.properties rename to spring-boot-modules/spring-boot-runtime/src/test/resources/application-integrationtest.properties diff --git a/spring-boot-runtime/src/test/resources/application.properties b/spring-boot-modules/spring-boot-runtime/src/test/resources/application.properties similarity index 100% rename from spring-boot-runtime/src/test/resources/application.properties rename to spring-boot-modules/spring-boot-runtime/src/test/resources/application.properties diff --git a/spring-boot-springdoc/README.md b/spring-boot-modules/spring-boot-springdoc/README.md similarity index 100% rename from spring-boot-springdoc/README.md rename to spring-boot-modules/spring-boot-springdoc/README.md diff --git a/spring-boot-springdoc/pom.xml b/spring-boot-modules/spring-boot-springdoc/pom.xml similarity index 84% rename from spring-boot-springdoc/pom.xml rename to spring-boot-modules/spring-boot-springdoc/pom.xml index 8c35e38ae6..9212e56c5a 100644 --- a/spring-boot-springdoc/pom.xml +++ b/spring-boot-modules/spring-boot-springdoc/pom.xml @@ -13,10 +13,11 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 + 1.8 @@ -36,12 +37,23 @@ org.springdoc springdoc-openapi-core - 1.1.45 + 1.1.49 + + + io.github.classgraph + classgraph + + org.springdoc springdoc-openapi-ui - 1.1.45 + 1.1.49 + + + io.github.classgraph + classgraph + 4.8.44 @@ -62,7 +74,7 @@ org.springframework.boot spring-boot-maven-plugin - 2.1.8.RELEASE + 2.2.2.RELEASE pre-integration-test diff --git a/spring-boot-springdoc/src/main/java/com/baeldung/springdoc/SpringdocApplication.java b/spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/springdoc/SpringdocApplication.java similarity index 100% rename from spring-boot-springdoc/src/main/java/com/baeldung/springdoc/SpringdocApplication.java rename to spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/springdoc/SpringdocApplication.java diff --git a/spring-boot-springdoc/src/main/java/com/baeldung/springdoc/controller/BookController.java b/spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/springdoc/controller/BookController.java similarity index 100% rename from spring-boot-springdoc/src/main/java/com/baeldung/springdoc/controller/BookController.java rename to spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/springdoc/controller/BookController.java diff --git a/spring-boot-springdoc/src/main/java/com/baeldung/springdoc/exception/BookNotFoundException.java b/spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/springdoc/exception/BookNotFoundException.java similarity index 100% rename from spring-boot-springdoc/src/main/java/com/baeldung/springdoc/exception/BookNotFoundException.java rename to spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/springdoc/exception/BookNotFoundException.java diff --git a/spring-boot-springdoc/src/main/java/com/baeldung/springdoc/exception/GlobalControllerExceptionHandler.java b/spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/springdoc/exception/GlobalControllerExceptionHandler.java similarity index 100% rename from spring-boot-springdoc/src/main/java/com/baeldung/springdoc/exception/GlobalControllerExceptionHandler.java rename to spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/springdoc/exception/GlobalControllerExceptionHandler.java diff --git a/spring-boot-springdoc/src/main/java/com/baeldung/springdoc/model/Book.java b/spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/springdoc/model/Book.java similarity index 100% rename from spring-boot-springdoc/src/main/java/com/baeldung/springdoc/model/Book.java rename to spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/springdoc/model/Book.java diff --git a/spring-boot-springdoc/src/main/java/com/baeldung/springdoc/repository/BookRepository.java b/spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/springdoc/repository/BookRepository.java similarity index 100% rename from spring-boot-springdoc/src/main/java/com/baeldung/springdoc/repository/BookRepository.java rename to spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/springdoc/repository/BookRepository.java diff --git a/spring-boot-springdoc/src/main/resources/application.properties b/spring-boot-modules/spring-boot-springdoc/src/main/resources/application.properties similarity index 100% rename from spring-boot-springdoc/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-springdoc/src/main/resources/application.properties diff --git a/spring-boot-springdoc/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-springdoc/src/main/resources/logback.xml similarity index 100% rename from spring-boot-springdoc/src/main/resources/logback.xml rename to spring-boot-modules/spring-boot-springdoc/src/main/resources/logback.xml diff --git a/spring-boot-springdoc/src/test/java/com/baeldung/springdoc/SpringContextTest.java b/spring-boot-modules/spring-boot-springdoc/src/test/java/com/baeldung/springdoc/SpringContextTest.java similarity index 100% rename from spring-boot-springdoc/src/test/java/com/baeldung/springdoc/SpringContextTest.java rename to spring-boot-modules/spring-boot-springdoc/src/test/java/com/baeldung/springdoc/SpringContextTest.java diff --git a/spring-boot-testing/.gitignore b/spring-boot-modules/spring-boot-testing/.gitignore similarity index 100% rename from spring-boot-testing/.gitignore rename to spring-boot-modules/spring-boot-testing/.gitignore diff --git a/spring-boot-testing/.mvn/wrapper/maven-wrapper.properties b/spring-boot-modules/spring-boot-testing/.mvn/wrapper/maven-wrapper.properties similarity index 100% rename from spring-boot-testing/.mvn/wrapper/maven-wrapper.properties rename to spring-boot-modules/spring-boot-testing/.mvn/wrapper/maven-wrapper.properties diff --git a/spring-boot-testing/README.md b/spring-boot-modules/spring-boot-testing/README.md similarity index 100% rename from spring-boot-testing/README.md rename to spring-boot-modules/spring-boot-testing/README.md diff --git a/spring-boot-testing/mvnw b/spring-boot-modules/spring-boot-testing/mvnw similarity index 100% rename from spring-boot-testing/mvnw rename to spring-boot-modules/spring-boot-testing/mvnw diff --git a/spring-boot-testing/mvnw.cmd b/spring-boot-modules/spring-boot-testing/mvnw.cmd similarity index 100% rename from spring-boot-testing/mvnw.cmd rename to spring-boot-modules/spring-boot-testing/mvnw.cmd diff --git a/spring-boot-testing/pom.xml b/spring-boot-modules/spring-boot-testing/pom.xml similarity index 97% rename from spring-boot-testing/pom.xml rename to spring-boot-modules/spring-boot-testing/pom.xml index 5f358072d3..8b16b13733 100644 --- a/spring-boot-testing/pom.xml +++ b/spring-boot-modules/spring-boot-testing/pom.xml @@ -12,7 +12,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 @@ -132,6 +132,7 @@ 1.2-groovy-2.4 1.6 0.7.2 + 2.1.9.RELEASE diff --git a/spring-boot-testing/src/main/java/com/baeldung/boot/Application.java b/spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/Application.java similarity index 100% rename from spring-boot-testing/src/main/java/com/baeldung/boot/Application.java rename to spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/Application.java diff --git a/spring-boot-testing/src/main/java/com/baeldung/boot/controller/rest/HomeController.java b/spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/controller/rest/HomeController.java similarity index 100% rename from spring-boot-testing/src/main/java/com/baeldung/boot/controller/rest/HomeController.java rename to spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/controller/rest/HomeController.java diff --git a/spring-boot-testing/src/main/java/com/baeldung/boot/controller/rest/WebController.java b/spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/controller/rest/WebController.java similarity index 100% rename from spring-boot-testing/src/main/java/com/baeldung/boot/controller/rest/WebController.java rename to spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/controller/rest/WebController.java diff --git a/spring-boot-testing/src/main/java/com/baeldung/boot/embeddedRedis/configuration/RedisConfiguration.java b/spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/embeddedRedis/configuration/RedisConfiguration.java similarity index 100% rename from spring-boot-testing/src/main/java/com/baeldung/boot/embeddedRedis/configuration/RedisConfiguration.java rename to spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/embeddedRedis/configuration/RedisConfiguration.java diff --git a/spring-boot-testing/src/main/java/com/baeldung/boot/embeddedRedis/configuration/RedisProperties.java b/spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/embeddedRedis/configuration/RedisProperties.java similarity index 100% rename from spring-boot-testing/src/main/java/com/baeldung/boot/embeddedRedis/configuration/RedisProperties.java rename to spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/embeddedRedis/configuration/RedisProperties.java diff --git a/spring-boot-testing/src/main/java/com/baeldung/boot/embeddedRedis/domain/User.java b/spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/embeddedRedis/domain/User.java similarity index 100% rename from spring-boot-testing/src/main/java/com/baeldung/boot/embeddedRedis/domain/User.java rename to spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/embeddedRedis/domain/User.java diff --git a/spring-boot-testing/src/main/java/com/baeldung/boot/embeddedRedis/domain/repository/UserRepository.java b/spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/embeddedRedis/domain/repository/UserRepository.java similarity index 100% rename from spring-boot-testing/src/main/java/com/baeldung/boot/embeddedRedis/domain/repository/UserRepository.java rename to spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/boot/embeddedRedis/domain/repository/UserRepository.java diff --git a/spring-boot-testing/src/main/java/com/baeldung/component/OtherComponent.java b/spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/component/OtherComponent.java similarity index 100% rename from spring-boot-testing/src/main/java/com/baeldung/component/OtherComponent.java rename to spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/component/OtherComponent.java diff --git a/spring-boot-testing/src/main/java/com/baeldung/testloglevel/TestLogLevelApplication.java b/spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/testloglevel/TestLogLevelApplication.java similarity index 100% rename from spring-boot-testing/src/main/java/com/baeldung/testloglevel/TestLogLevelApplication.java rename to spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/testloglevel/TestLogLevelApplication.java diff --git a/spring-boot-testing/src/main/java/com/baeldung/testloglevel/TestLogLevelController.java b/spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/testloglevel/TestLogLevelController.java similarity index 100% rename from spring-boot-testing/src/main/java/com/baeldung/testloglevel/TestLogLevelController.java rename to spring-boot-modules/spring-boot-testing/src/main/java/com/baeldung/testloglevel/TestLogLevelController.java diff --git a/spring-boot-testing/src/main/resources/application-test.properties b/spring-boot-modules/spring-boot-testing/src/main/resources/application-test.properties similarity index 100% rename from spring-boot-testing/src/main/resources/application-test.properties rename to spring-boot-modules/spring-boot-testing/src/main/resources/application-test.properties diff --git a/spring-boot-testing/src/main/resources/application.properties b/spring-boot-modules/spring-boot-testing/src/main/resources/application.properties similarity index 100% rename from spring-boot-testing/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-testing/src/main/resources/application.properties diff --git a/spring-boot-testing/src/test/groovy/com/baeldung/boot/LoadContextTest.groovy b/spring-boot-modules/spring-boot-testing/src/test/groovy/com/baeldung/boot/LoadContextTest.groovy similarity index 100% rename from spring-boot-testing/src/test/groovy/com/baeldung/boot/LoadContextTest.groovy rename to spring-boot-modules/spring-boot-testing/src/test/groovy/com/baeldung/boot/LoadContextTest.groovy diff --git a/spring-boot-testing/src/test/groovy/com/baeldung/boot/WebControllerTest.groovy b/spring-boot-modules/spring-boot-testing/src/test/groovy/com/baeldung/boot/WebControllerTest.groovy similarity index 100% rename from spring-boot-testing/src/test/groovy/com/baeldung/boot/WebControllerTest.groovy rename to spring-boot-modules/spring-boot-testing/src/test/groovy/com/baeldung/boot/WebControllerTest.groovy diff --git a/spring-boot-testing/src/test/groovy/com/baeldung/boot/WebControllerTest.groovy alias b/spring-boot-modules/spring-boot-testing/src/test/groovy/com/baeldung/boot/WebControllerTest.groovy alias similarity index 100% rename from spring-boot-testing/src/test/groovy/com/baeldung/boot/WebControllerTest.groovy alias rename to spring-boot-modules/spring-boot-testing/src/test/groovy/com/baeldung/boot/WebControllerTest.groovy alias diff --git a/spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/ExcludeAutoConfig1IntegrationTest.java b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/ExcludeAutoConfig1IntegrationTest.java similarity index 76% rename from spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/ExcludeAutoConfig1IntegrationTest.java rename to spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/ExcludeAutoConfig1IntegrationTest.java index a4a29cddf3..2ca0c74901 100644 --- a/spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/ExcludeAutoConfig1IntegrationTest.java +++ b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/ExcludeAutoConfig1IntegrationTest.java @@ -1,26 +1,32 @@ package com.baeldung.autoconfig.exclude; -import static org.junit.Assert.assertEquals; +import com.baeldung.boot.Application; import io.restassured.RestAssured; - import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; +import org.springframework.boot.web.server.LocalServerPort; import org.springframework.http.HttpStatus; import org.springframework.test.context.TestPropertySource; import org.springframework.test.context.junit4.SpringRunner; -import com.baeldung.boot.Application; +import static org.junit.Assert.assertEquals; @RunWith(SpringRunner.class) -@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.DEFINED_PORT) +@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.RANDOM_PORT) @TestPropertySource(properties = "spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration") public class ExcludeAutoConfig1IntegrationTest { + /** + * Encapsulates the random port the test server is listening on. + */ + @LocalServerPort + private int port; + @Test public void givenSecurityConfigExcluded_whenAccessHome_thenNoAuthenticationRequired() { - int statusCode = RestAssured.get("http://localhost:8080/").statusCode(); + int statusCode = RestAssured.get("http://localhost:" + port).statusCode(); assertEquals(HttpStatus.OK.value(), statusCode); } } diff --git a/spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/ExcludeAutoConfig2IntegrationTest.java b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/ExcludeAutoConfig2IntegrationTest.java similarity index 74% rename from spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/ExcludeAutoConfig2IntegrationTest.java rename to spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/ExcludeAutoConfig2IntegrationTest.java index cdf79b159c..c0bd6570a1 100644 --- a/spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/ExcludeAutoConfig2IntegrationTest.java +++ b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/ExcludeAutoConfig2IntegrationTest.java @@ -1,26 +1,32 @@ package com.baeldung.autoconfig.exclude; -import static org.junit.Assert.assertEquals; +import com.baeldung.boot.Application; import io.restassured.RestAssured; - import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; +import org.springframework.boot.web.server.LocalServerPort; import org.springframework.http.HttpStatus; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; -import com.baeldung.boot.Application; +import static org.junit.Assert.assertEquals; @RunWith(SpringRunner.class) -@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.DEFINED_PORT) +@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.RANDOM_PORT) @ActiveProfiles("test") public class ExcludeAutoConfig2IntegrationTest { + /** + * Encapsulates the random port the test server is listening on. + */ + @LocalServerPort + private int port; + @Test public void givenSecurityConfigExcluded_whenAccessHome_thenNoAuthenticationRequired() { - int statusCode = RestAssured.get("http://localhost:8080/").statusCode(); + int statusCode = RestAssured.get("http://localhost:" + port).statusCode(); assertEquals(HttpStatus.OK.value(), statusCode); } } diff --git a/spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/ExcludeAutoConfig3IntegrationTest.java b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/ExcludeAutoConfig3IntegrationTest.java similarity index 77% rename from spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/ExcludeAutoConfig3IntegrationTest.java rename to spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/ExcludeAutoConfig3IntegrationTest.java index 0e45d1e9e5..1642d4b932 100644 --- a/spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/ExcludeAutoConfig3IntegrationTest.java +++ b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/ExcludeAutoConfig3IntegrationTest.java @@ -1,27 +1,33 @@ package com.baeldung.autoconfig.exclude; -import static org.junit.Assert.assertEquals; +import com.baeldung.boot.Application; import io.restassured.RestAssured; - import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; +import org.springframework.boot.web.server.LocalServerPort; import org.springframework.http.HttpStatus; import org.springframework.test.context.junit4.SpringRunner; -import com.baeldung.boot.Application; +import static org.junit.Assert.assertEquals; @RunWith(SpringRunner.class) -@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.DEFINED_PORT) +@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.RANDOM_PORT) @EnableAutoConfiguration(exclude=SecurityAutoConfiguration.class) public class ExcludeAutoConfig3IntegrationTest { + /** + * Encapsulates the random port the test server is listening on. + */ + @LocalServerPort + private int port; + @Test public void givenSecurityConfigExcluded_whenAccessHome_thenNoAuthenticationRequired() { - int statusCode = RestAssured.get("http://localhost:8080/").statusCode(); + int statusCode = RestAssured.get("http://localhost:" + port).statusCode(); assertEquals(HttpStatus.OK.value(), statusCode); } } diff --git a/spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/ExcludeAutoConfig4IntegrationTest.java b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/ExcludeAutoConfig4IntegrationTest.java similarity index 70% rename from spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/ExcludeAutoConfig4IntegrationTest.java rename to spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/ExcludeAutoConfig4IntegrationTest.java index 8429aed6cd..1aa453348b 100644 --- a/spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/ExcludeAutoConfig4IntegrationTest.java +++ b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/ExcludeAutoConfig4IntegrationTest.java @@ -1,22 +1,29 @@ package com.baeldung.autoconfig.exclude; -import static org.junit.Assert.assertEquals; import io.restassured.RestAssured; - import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; +import org.springframework.boot.web.server.LocalServerPort; import org.springframework.http.HttpStatus; import org.springframework.test.context.junit4.SpringRunner; +import static org.junit.Assert.assertEquals; + @RunWith(SpringRunner.class) -@SpringBootTest(classes = TestApplication.class, webEnvironment = WebEnvironment.DEFINED_PORT) +@SpringBootTest(classes = TestApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT) public class ExcludeAutoConfig4IntegrationTest { + /** + * Encapsulates the random port the test server is listening on. + */ + @LocalServerPort + private int port; + @Test public void givenSecurityConfigExcluded_whenAccessHome_thenNoAuthenticationRequired() { - int statusCode = RestAssured.get("http://localhost:8080/").statusCode(); + int statusCode = RestAssured.get("http://localhost:" + port).statusCode(); assertEquals(HttpStatus.OK.value(), statusCode); } } diff --git a/spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/TestApplication.java b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/TestApplication.java similarity index 100% rename from spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/TestApplication.java rename to spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/autoconfig/exclude/TestApplication.java diff --git a/spring-boot-testing/src/test/java/com/baeldung/boot/SpringContextTest.java b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/SpringContextTest.java similarity index 100% rename from spring-boot-testing/src/test/java/com/baeldung/boot/SpringContextTest.java rename to spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/SpringContextTest.java diff --git a/spring-boot-testing/src/test/java/com/baeldung/boot/autoconfig/AutoConfigIntegrationTest.java b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/autoconfig/AutoConfigIntegrationTest.java similarity index 73% rename from spring-boot-testing/src/test/java/com/baeldung/boot/autoconfig/AutoConfigIntegrationTest.java rename to spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/autoconfig/AutoConfigIntegrationTest.java index fe71f44ddf..44a02c0c80 100644 --- a/spring-boot-testing/src/test/java/com/baeldung/boot/autoconfig/AutoConfigIntegrationTest.java +++ b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/autoconfig/AutoConfigIntegrationTest.java @@ -1,30 +1,36 @@ package com.baeldung.boot.autoconfig; -import static org.junit.Assert.assertEquals; +import com.baeldung.boot.Application; import io.restassured.RestAssured; - import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; +import org.springframework.boot.web.server.LocalServerPort; import org.springframework.http.HttpStatus; import org.springframework.test.context.junit4.SpringRunner; -import com.baeldung.boot.Application; +import static org.junit.Assert.assertEquals; @RunWith(SpringRunner.class) -@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.DEFINED_PORT) +@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.RANDOM_PORT) public class AutoConfigIntegrationTest { + /** + * Encapsulates the random port the test server is listening on. + */ + @LocalServerPort + private int port; + @Test public void givenNoAuthentication_whenAccessHome_thenUnauthorized() { - int statusCode = RestAssured.get("http://localhost:8080/").statusCode(); + int statusCode = RestAssured.get("http://localhost:" + port).statusCode(); assertEquals(HttpStatus.UNAUTHORIZED.value(), statusCode); } @Test public void givenAuthentication_whenAccessHome_thenOK() { - int statusCode = RestAssured.given().auth().basic("john", "123").get("http://localhost:8080/").statusCode(); + int statusCode = RestAssured.given().auth().basic("john", "123").get("http://localhost:" + port).statusCode(); assertEquals(HttpStatus.OK.value(), statusCode); } } diff --git a/spring-boot-testing/src/test/java/com/baeldung/boot/embeddedRedis/TestRedisConfiguration.java b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/embeddedRedis/TestRedisConfiguration.java similarity index 100% rename from spring-boot-testing/src/test/java/com/baeldung/boot/embeddedRedis/TestRedisConfiguration.java rename to spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/embeddedRedis/TestRedisConfiguration.java diff --git a/spring-boot-testing/src/test/java/com/baeldung/boot/embeddedRedis/domain/repository/UserRepositoryIntegrationTest.java b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/embeddedRedis/domain/repository/UserRepositoryIntegrationTest.java similarity index 100% rename from spring-boot-testing/src/test/java/com/baeldung/boot/embeddedRedis/domain/repository/UserRepositoryIntegrationTest.java rename to spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/embeddedRedis/domain/repository/UserRepositoryIntegrationTest.java diff --git a/spring-boot-testing/src/test/java/com/baeldung/testloglevel/LogbackMultiProfileTestLogLevelIntegrationTest.java b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/testloglevel/LogbackMultiProfileTestLogLevelIntegrationTest.java similarity index 94% rename from spring-boot-testing/src/test/java/com/baeldung/testloglevel/LogbackMultiProfileTestLogLevelIntegrationTest.java rename to spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/testloglevel/LogbackMultiProfileTestLogLevelIntegrationTest.java index 7a1eb4adbe..f8bd61e5c7 100644 --- a/spring-boot-testing/src/test/java/com/baeldung/testloglevel/LogbackMultiProfileTestLogLevelIntegrationTest.java +++ b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/testloglevel/LogbackMultiProfileTestLogLevelIntegrationTest.java @@ -1,7 +1,5 @@ package com.baeldung.testloglevel; -import static org.assertj.core.api.Assertions.assertThat; - import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @@ -13,9 +11,14 @@ import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.rule.OutputCapture; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.http.ResponseEntity; +import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; +import static org.assertj.core.api.Assertions.assertThat; +import static org.springframework.test.annotation.DirtiesContext.ClassMode.AFTER_CLASS; + +@DirtiesContext(classMode = AFTER_CLASS) @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, classes = TestLogLevelApplication.class) @EnableAutoConfiguration(exclude = SecurityAutoConfiguration.class) diff --git a/spring-boot-testing/src/test/java/com/baeldung/testloglevel/LogbackTestLogLevelIntegrationTest.java b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/testloglevel/LogbackTestLogLevelIntegrationTest.java similarity index 94% rename from spring-boot-testing/src/test/java/com/baeldung/testloglevel/LogbackTestLogLevelIntegrationTest.java rename to spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/testloglevel/LogbackTestLogLevelIntegrationTest.java index af3bafdc2e..ffe9d400ed 100644 --- a/spring-boot-testing/src/test/java/com/baeldung/testloglevel/LogbackTestLogLevelIntegrationTest.java +++ b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/testloglevel/LogbackTestLogLevelIntegrationTest.java @@ -1,7 +1,5 @@ package com.baeldung.testloglevel; -import static org.assertj.core.api.Assertions.assertThat; - import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @@ -13,9 +11,14 @@ import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.rule.OutputCapture; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.http.ResponseEntity; +import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; +import static org.assertj.core.api.Assertions.assertThat; +import static org.springframework.test.annotation.DirtiesContext.ClassMode.AFTER_CLASS; + +@DirtiesContext(classMode = AFTER_CLASS) @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, classes = TestLogLevelApplication.class) @EnableAutoConfiguration(exclude = SecurityAutoConfiguration.class) diff --git a/spring-boot-testing/src/test/java/com/baeldung/testloglevel/TestLogLevelWithProfileIntegrationTest.java b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/testloglevel/TestLogLevelWithProfileIntegrationTest.java similarity index 94% rename from spring-boot-testing/src/test/java/com/baeldung/testloglevel/TestLogLevelWithProfileIntegrationTest.java rename to spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/testloglevel/TestLogLevelWithProfileIntegrationTest.java index 5609ce6c01..6e80f50c00 100644 --- a/spring-boot-testing/src/test/java/com/baeldung/testloglevel/TestLogLevelWithProfileIntegrationTest.java +++ b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/testloglevel/TestLogLevelWithProfileIntegrationTest.java @@ -11,12 +11,15 @@ import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.rule.OutputCapture; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.http.ResponseEntity; +import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; import static org.assertj.core.api.Assertions.assertThat; +import static org.springframework.test.annotation.DirtiesContext.ClassMode.AFTER_CLASS; @RunWith(SpringRunner.class) +@DirtiesContext(classMode = AFTER_CLASS) @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, classes = TestLogLevelApplication.class) @EnableAutoConfiguration(exclude = SecurityAutoConfiguration.class) @ActiveProfiles("logging-test") diff --git a/spring-boot-testing/src/test/resources/application-logback-test.properties b/spring-boot-modules/spring-boot-testing/src/test/resources/application-logback-test.properties similarity index 100% rename from spring-boot-testing/src/test/resources/application-logback-test.properties rename to spring-boot-modules/spring-boot-testing/src/test/resources/application-logback-test.properties diff --git a/spring-boot-testing/src/test/resources/application-logback-test2.properties b/spring-boot-modules/spring-boot-testing/src/test/resources/application-logback-test2.properties similarity index 100% rename from spring-boot-testing/src/test/resources/application-logback-test2.properties rename to spring-boot-modules/spring-boot-testing/src/test/resources/application-logback-test2.properties diff --git a/spring-boot-testing/src/test/resources/application-logging-test.properties b/spring-boot-modules/spring-boot-testing/src/test/resources/application-logging-test.properties similarity index 100% rename from spring-boot-testing/src/test/resources/application-logging-test.properties rename to spring-boot-modules/spring-boot-testing/src/test/resources/application-logging-test.properties diff --git a/spring-boot-testing/src/test/resources/application-test.properties b/spring-boot-modules/spring-boot-testing/src/test/resources/application-test.properties similarity index 100% rename from spring-boot-testing/src/test/resources/application-test.properties rename to spring-boot-modules/spring-boot-testing/src/test/resources/application-test.properties diff --git a/spring-boot-testing/src/test/resources/application.properties b/spring-boot-modules/spring-boot-testing/src/test/resources/application.properties similarity index 100% rename from spring-boot-testing/src/test/resources/application.properties rename to spring-boot-modules/spring-boot-testing/src/test/resources/application.properties diff --git a/spring-boot-testing/src/test/resources/logback-multiprofile.xml b/spring-boot-modules/spring-boot-testing/src/test/resources/logback-multiprofile.xml similarity index 100% rename from spring-boot-testing/src/test/resources/logback-multiprofile.xml rename to spring-boot-modules/spring-boot-testing/src/test/resources/logback-multiprofile.xml diff --git a/spring-boot-testing/src/test/resources/logback-test.xml b/spring-boot-modules/spring-boot-testing/src/test/resources/logback-test.xml similarity index 100% rename from spring-boot-testing/src/test/resources/logback-test.xml rename to spring-boot-modules/spring-boot-testing/src/test/resources/logback-test.xml diff --git a/spring-boot-vue/.gitignore b/spring-boot-modules/spring-boot-vue/.gitignore similarity index 100% rename from spring-boot-vue/.gitignore rename to spring-boot-modules/spring-boot-vue/.gitignore diff --git a/spring-boot-vue/README.md b/spring-boot-modules/spring-boot-vue/README.md similarity index 100% rename from spring-boot-vue/README.md rename to spring-boot-modules/spring-boot-vue/README.md diff --git a/spring-boot-vue/pom.xml b/spring-boot-modules/spring-boot-vue/pom.xml similarity index 96% rename from spring-boot-vue/pom.xml rename to spring-boot-modules/spring-boot-vue/pom.xml index 98bba784d2..0a6307e46b 100644 --- a/spring-boot-vue/pom.xml +++ b/spring-boot-modules/spring-boot-vue/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-boot-vue/src/main/java/com/baeldung/springbootmvc/SpringBootMvcApplication.java b/spring-boot-modules/spring-boot-vue/src/main/java/com/baeldung/springbootmvc/SpringBootMvcApplication.java similarity index 100% rename from spring-boot-vue/src/main/java/com/baeldung/springbootmvc/SpringBootMvcApplication.java rename to spring-boot-modules/spring-boot-vue/src/main/java/com/baeldung/springbootmvc/SpringBootMvcApplication.java diff --git a/spring-boot-vue/src/main/java/com/baeldung/springbootmvc/controllers/MainController.java b/spring-boot-modules/spring-boot-vue/src/main/java/com/baeldung/springbootmvc/controllers/MainController.java similarity index 100% rename from spring-boot-vue/src/main/java/com/baeldung/springbootmvc/controllers/MainController.java rename to spring-boot-modules/spring-boot-vue/src/main/java/com/baeldung/springbootmvc/controllers/MainController.java diff --git a/spring-boot-vue/src/main/resources/application.properties b/spring-boot-modules/spring-boot-vue/src/main/resources/application.properties similarity index 100% rename from spring-boot-vue/src/main/resources/application.properties rename to spring-boot-modules/spring-boot-vue/src/main/resources/application.properties diff --git a/spring-boot-property-exp/property-exp-default-config/src/main/resources/logback.xml b/spring-boot-modules/spring-boot-vue/src/main/resources/logback.xml similarity index 100% rename from spring-boot-property-exp/property-exp-default-config/src/main/resources/logback.xml rename to spring-boot-modules/spring-boot-vue/src/main/resources/logback.xml diff --git a/spring-boot-vue/src/main/resources/static/favicon.ico b/spring-boot-modules/spring-boot-vue/src/main/resources/static/favicon.ico similarity index 100% rename from spring-boot-vue/src/main/resources/static/favicon.ico rename to spring-boot-modules/spring-boot-vue/src/main/resources/static/favicon.ico diff --git a/spring-boot-vue/src/main/resources/templates/index.html b/spring-boot-modules/spring-boot-vue/src/main/resources/templates/index.html similarity index 100% rename from spring-boot-vue/src/main/resources/templates/index.html rename to spring-boot-modules/spring-boot-vue/src/main/resources/templates/index.html diff --git a/spring-boot-vue/src/test/java/com/baeldung/springbootmvc/SpringBootMvcApplicationIntegrationTest.java b/spring-boot-modules/spring-boot-vue/src/test/java/com/baeldung/springbootmvc/SpringBootMvcApplicationIntegrationTest.java similarity index 100% rename from spring-boot-vue/src/test/java/com/baeldung/springbootmvc/SpringBootMvcApplicationIntegrationTest.java rename to spring-boot-modules/spring-boot-vue/src/test/java/com/baeldung/springbootmvc/SpringBootMvcApplicationIntegrationTest.java diff --git a/spring-boot-vue/src/test/java/org/baeldung/SpringContextTest.java b/spring-boot-modules/spring-boot-vue/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-boot-vue/src/test/java/org/baeldung/SpringContextTest.java rename to spring-boot-modules/spring-boot-vue/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-boot/.gitignore b/spring-boot-modules/spring-boot/.gitignore similarity index 89% rename from spring-boot/.gitignore rename to spring-boot-modules/spring-boot/.gitignore index 88e3308e9d..da7c2c5c0a 100644 --- a/spring-boot/.gitignore +++ b/spring-boot-modules/spring-boot/.gitignore @@ -1,5 +1,5 @@ -/target/ -.settings/ -.classpath -.project - +/target/ +.settings/ +.classpath +.project + diff --git a/spring-boot/.mvn/wrapper/maven-wrapper.properties b/spring-boot-modules/spring-boot/.mvn/wrapper/maven-wrapper.properties similarity index 100% rename from spring-boot/.mvn/wrapper/maven-wrapper.properties rename to spring-boot-modules/spring-boot/.mvn/wrapper/maven-wrapper.properties diff --git a/spring-boot/README.MD b/spring-boot-modules/spring-boot/README.MD similarity index 100% rename from spring-boot/README.MD rename to spring-boot-modules/spring-boot/README.MD diff --git a/spring-boot/mvnw b/spring-boot-modules/spring-boot/mvnw similarity index 100% rename from spring-boot/mvnw rename to spring-boot-modules/spring-boot/mvnw diff --git a/spring-boot/mvnw.cmd b/spring-boot-modules/spring-boot/mvnw.cmd similarity index 97% rename from spring-boot/mvnw.cmd rename to spring-boot-modules/spring-boot/mvnw.cmd index 4f0b068a03..6a6eec39ba 100755 --- a/spring-boot/mvnw.cmd +++ b/spring-boot-modules/spring-boot/mvnw.cmd @@ -1,145 +1,145 @@ -@REM ---------------------------------------------------------------------------- -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. -@REM ---------------------------------------------------------------------------- - -@REM ---------------------------------------------------------------------------- -@REM Maven2 Start Up Batch script -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir -@REM -@REM Optional ENV vars -@REM M2_HOME - location of maven2's installed home dir -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files -@REM ---------------------------------------------------------------------------- - -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM set title of command window -title %0 -@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% - -@REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") - -@REM Execute a user defined script before this one -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre -@REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" -if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" -:skipRcPre - -@setlocal - -set ERROR_CODE=0 - -@REM To isolate internal variables from possible post scripts, we use another setlocal -@setlocal - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo Error: JAVA_HOME not found in your environment. >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -echo Error: JAVA_HOME is set to an invalid directory. >&2 -echo JAVA_HOME = "%JAVA_HOME%" >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -@REM ==== END VALIDATION ==== - -:init - -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". -@REM Fallback to current working directory if not found. - -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir - -set EXEC_DIR=%CD% -set WDIR=%EXEC_DIR% -:findBaseDir -IF EXIST "%WDIR%"\.mvn goto baseDirFound -cd .. -IF "%WDIR%"=="%CD%" goto baseDirNotFound -set WDIR=%CD% -goto findBaseDir - -:baseDirFound -set MAVEN_PROJECTBASEDIR=%WDIR% -cd "%EXEC_DIR%" -goto endDetectBaseDir - -:baseDirNotFound -set MAVEN_PROJECTBASEDIR=%EXEC_DIR% -cd "%EXEC_DIR%" - -:endDetectBaseDir - -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% - -:endReadAdditionalConfig - -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" - -set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* -if ERRORLEVEL 1 goto error -goto end - -:error -set ERROR_CODE=1 - -:end -@endlocal & set ERROR_CODE=%ERROR_CODE% - -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost -@REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" -if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" -:skipRcPost - -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%" == "on" pause - -if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% - -exit /B %ERROR_CODE% +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven2 Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" + +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/spring-boot/pom.xml b/spring-boot-modules/spring-boot/pom.xml similarity index 96% rename from spring-boot/pom.xml rename to spring-boot-modules/spring-boot/pom.xml index b8ebd27e13..3fb1ec9acc 100644 --- a/spring-boot/pom.xml +++ b/spring-boot-modules/spring-boot/pom.xml @@ -1,268 +1,268 @@ - - - 4.0.0 - spring-boot - spring-boot - war - This is simple boot application for Spring boot actuator test - 0.0.1-SNAPSHOT - - - parent-boot-2 - com.baeldung - 0.0.1-SNAPSHOT - ../parent-boot-2 - - - - - - - org.junit.jupiter - junit-jupiter-api - test - - - org.junit.jupiter - junit-jupiter-engine - test - - - - - org.junit.platform - junit-platform-launcher - ${junit-platform.version} - test - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.ehcache - ehcache - - - org.hibernate - hibernate-ehcache - - - org.springframework.boot - spring-boot-starter-actuator - - - - com.graphql-java - graphql-spring-boot-starter - ${graphql-spring-boot-starter.version} - - - com.graphql-java - graphql-java-tools - ${graphql-java-tools.version} - - - com.graphql-java - graphiql-spring-boot-starter - ${graphiql-spring-boot-starter.version} - - - - org.springframework.boot - spring-boot-starter-tomcat - - - - org.springframework.boot - spring-boot-starter-test - test - - - - io.dropwizard.metrics - metrics-core - - - - com.h2database - h2 - - - - org.springframework.boot - spring-boot-starter - - - com.jayway.jsonpath - json-path - test - - - - com.google.guava - guava - ${guava.version} - - - - org.apache.tomcat - tomcat-servlet-api - ${tomee-servlet-api.version} - provided - - - - org.togglz - togglz-spring-boot-starter - ${togglz.version} - - - - org.togglz - togglz-spring-security - ${togglz.version} - - - - org.apache.activemq - artemis-server - - - - com.rometools - rome - ${rome.version} - - - - de.codecentric - chaos-monkey-spring-boot - ${chaos.monkey.version} - - - - javax.validation - validation-api - - - - - spring-boot - - - src/main/resources - true - - - - - - - org.apache.maven.plugins - maven-war-plugin - - - - pl.project13.maven - git-commit-id-plugin - ${git-commit-id-plugin.version} - - - get-the-git-infos - - revision - - initialize - - - validate-the-git-infos - - validateRevision - - package - - - - true - ${project.build.outputDirectory}/git.properties - - - - - org.apache.maven.plugins - maven-resources-plugin - - - @ - - false - - - - - - - - - autoconfiguration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - **/*IntegrationTest.java - **/*IntTest.java - - - **/AutoconfigurationTest.java - - - - - - - json - - - - - - - - - - - com.baeldung.intro.App - 8.5.11 - 2.4.1.Final - 1.9.0 - 2.0.0 - 5.0.2 - 5.0.2 - 5.2.4 - 18.0 - 2.2.4 - @ - - - + + + 4.0.0 + spring-boot + spring-boot + war + This is simple boot application for Spring boot actuator test + 0.0.1-SNAPSHOT + + + parent-boot-2 + com.baeldung + 0.0.1-SNAPSHOT + ../../parent-boot-2 + + + + + + + org.junit.jupiter + junit-jupiter-api + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + + + org.junit.platform + junit-platform-launcher + ${junit-platform.version} + test + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.ehcache + ehcache + + + org.hibernate + hibernate-ehcache + + + org.springframework.boot + spring-boot-starter-actuator + + + + com.graphql-java + graphql-spring-boot-starter + ${graphql-spring-boot-starter.version} + + + com.graphql-java + graphql-java-tools + ${graphql-java-tools.version} + + + com.graphql-java + graphiql-spring-boot-starter + ${graphiql-spring-boot-starter.version} + + + + org.springframework.boot + spring-boot-starter-tomcat + + + + org.springframework.boot + spring-boot-starter-test + test + + + + io.dropwizard.metrics + metrics-core + + + + com.h2database + h2 + + + + org.springframework.boot + spring-boot-starter + + + com.jayway.jsonpath + json-path + test + + + + com.google.guava + guava + ${guava.version} + + + + org.apache.tomcat + tomcat-servlet-api + ${tomee-servlet-api.version} + provided + + + + org.togglz + togglz-spring-boot-starter + ${togglz.version} + + + + org.togglz + togglz-spring-security + ${togglz.version} + + + + org.apache.activemq + artemis-server + + + + com.rometools + rome + ${rome.version} + + + + de.codecentric + chaos-monkey-spring-boot + ${chaos.monkey.version} + + + + javax.validation + validation-api + + + + + spring-boot + + + src/main/resources + true + + + + + + + org.apache.maven.plugins + maven-war-plugin + + + + pl.project13.maven + git-commit-id-plugin + ${git-commit-id-plugin.version} + + + get-the-git-infos + + revision + + initialize + + + validate-the-git-infos + + validateRevision + + package + + + + true + ${project.build.outputDirectory}/git.properties + + + + + org.apache.maven.plugins + maven-resources-plugin + + + @ + + false + + + + + + + + + autoconfiguration + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration-test + + test + + + + **/*LiveTest.java + **/*IntegrationTest.java + **/*IntTest.java + + + **/AutoconfigurationTest.java + + + + + + + json + + + + + + + + + + + com.baeldung.intro.App + 8.5.11 + 2.4.1.Final + 1.9.0 + 2.0.0 + 5.0.2 + 5.0.2 + 5.2.4 + 18.0 + 2.2.4 + @ + + + diff --git a/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/SpringBootAnnotatedApp.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/SpringBootAnnotatedApp.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/SpringBootAnnotatedApp.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/SpringBootAnnotatedApp.java diff --git a/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/SpringBootPlainApp.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/SpringBootPlainApp.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/SpringBootPlainApp.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/SpringBootPlainApp.java diff --git a/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/components/AttrListener.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/components/AttrListener.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/components/AttrListener.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/components/AttrListener.java diff --git a/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/components/EchoServlet.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/components/EchoServlet.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/components/EchoServlet.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/components/EchoServlet.java diff --git a/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/components/HelloFilter.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/components/HelloFilter.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/components/HelloFilter.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/components/HelloFilter.java diff --git a/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/components/HelloServlet.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/components/HelloServlet.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/components/HelloServlet.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/annotation/servletcomponentscan/components/HelloServlet.java diff --git a/spring-boot/src/main/java/com/baeldung/beanvalidation/application/Application.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/beanvalidation/application/Application.java similarity index 97% rename from spring-boot/src/main/java/com/baeldung/beanvalidation/application/Application.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/beanvalidation/application/Application.java index b37eec9da0..e2b933a67e 100644 --- a/spring-boot/src/main/java/com/baeldung/beanvalidation/application/Application.java +++ b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/beanvalidation/application/Application.java @@ -1,28 +1,28 @@ -package com.baeldung.beanvalidation.application; - -import com.baeldung.beanvalidation.application.entities.User; -import com.baeldung.beanvalidation.application.repositories.UserRepository; - -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; - -@SpringBootApplication -public class Application { - - public static void main(String[] args) { - SpringApplication.run(Application.class, args); - } - - @Bean - public CommandLineRunner run(UserRepository userRepository) throws Exception { - return (String[] args) -> { - User user1 = new User("Bob", "bob@domain.com"); - User user2 = new User("Jenny", "jenny@domain.com"); - userRepository.save(user1); - userRepository.save(user2); - userRepository.findAll().forEach(System.out::println); - }; - } -} +package com.baeldung.beanvalidation.application; + +import com.baeldung.beanvalidation.application.entities.User; +import com.baeldung.beanvalidation.application.repositories.UserRepository; + +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +@SpringBootApplication +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } + + @Bean + public CommandLineRunner run(UserRepository userRepository) throws Exception { + return (String[] args) -> { + User user1 = new User("Bob", "bob@domain.com"); + User user2 = new User("Jenny", "jenny@domain.com"); + userRepository.save(user1); + userRepository.save(user2); + userRepository.findAll().forEach(System.out::println); + }; + } +} diff --git a/spring-boot/src/main/java/com/baeldung/beanvalidation/application/controllers/UserController.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/beanvalidation/application/controllers/UserController.java similarity index 97% rename from spring-boot/src/main/java/com/baeldung/beanvalidation/application/controllers/UserController.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/beanvalidation/application/controllers/UserController.java index 0c47e27e25..abda9a9449 100644 --- a/spring-boot/src/main/java/com/baeldung/beanvalidation/application/controllers/UserController.java +++ b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/beanvalidation/application/controllers/UserController.java @@ -1,53 +1,53 @@ -package com.baeldung.beanvalidation.application.controllers; - -import com.baeldung.beanvalidation.application.entities.User; -import com.baeldung.beanvalidation.application.repositories.UserRepository; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.validation.Valid; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.FieldError; -import org.springframework.web.bind.MethodArgumentNotValidException; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class UserController { - - private final UserRepository userRepository; - - @Autowired - public UserController(UserRepository userRepository) { - this.userRepository = userRepository; - } - - @GetMapping("/users") - public List getUsers() { - return (List) userRepository.findAll(); - } - - @PostMapping("/users") - ResponseEntity addUser(@Valid @RequestBody User user) { - return ResponseEntity.ok("User is valid"); - } - - @ResponseStatus(HttpStatus.BAD_REQUEST) - @ExceptionHandler(MethodArgumentNotValidException.class) - public Map handleValidationExceptions(MethodArgumentNotValidException ex) { - Map errors = new HashMap<>(); - ex.getBindingResult().getAllErrors().forEach((error) -> { - String fieldName = ((FieldError) error).getField(); - String errorMessage = error.getDefaultMessage(); - errors.put(fieldName, errorMessage); - }); - return errors; - } -} +package com.baeldung.beanvalidation.application.controllers; + +import com.baeldung.beanvalidation.application.entities.User; +import com.baeldung.beanvalidation.application.repositories.UserRepository; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.validation.Valid; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.FieldError; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class UserController { + + private final UserRepository userRepository; + + @Autowired + public UserController(UserRepository userRepository) { + this.userRepository = userRepository; + } + + @GetMapping("/users") + public List getUsers() { + return (List) userRepository.findAll(); + } + + @PostMapping("/users") + ResponseEntity addUser(@Valid @RequestBody User user) { + return ResponseEntity.ok("User is valid"); + } + + @ResponseStatus(HttpStatus.BAD_REQUEST) + @ExceptionHandler(MethodArgumentNotValidException.class) + public Map handleValidationExceptions(MethodArgumentNotValidException ex) { + Map errors = new HashMap<>(); + ex.getBindingResult().getAllErrors().forEach((error) -> { + String fieldName = ((FieldError) error).getField(); + String errorMessage = error.getDefaultMessage(); + errors.put(fieldName, errorMessage); + }); + return errors; + } +} diff --git a/spring-boot/src/main/java/com/baeldung/beanvalidation/application/entities/User.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/beanvalidation/application/entities/User.java similarity index 95% rename from spring-boot/src/main/java/com/baeldung/beanvalidation/application/entities/User.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/beanvalidation/application/entities/User.java index 8233d08f4e..511ce47775 100644 --- a/spring-boot/src/main/java/com/baeldung/beanvalidation/application/entities/User.java +++ b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/beanvalidation/application/entities/User.java @@ -1,50 +1,50 @@ -package com.baeldung.beanvalidation.application.entities; - -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Table; -import javax.validation.constraints.NotBlank; - -@Entity -public class User { - - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private long id; - - @NotBlank(message = "Name is mandatory") - private String name; - - @NotBlank(message = "Email is mandatory") - private String email; - - public User(){} - - public User(String name, String email) { - this.name = name; - this.email = email; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - @Override - public String toString() { - return "User{" + "id=" + id + ", name=" + name + ", email=" + email + '}'; - } -} +package com.baeldung.beanvalidation.application.entities; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.validation.constraints.NotBlank; + +@Entity +public class User { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + + @NotBlank(message = "Name is mandatory") + private String name; + + @NotBlank(message = "Email is mandatory") + private String email; + + public User(){} + + public User(String name, String email) { + this.name = name; + this.email = email; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + @Override + public String toString() { + return "User{" + "id=" + id + ", name=" + name + ", email=" + email + '}'; + } +} diff --git a/spring-boot/src/main/java/com/baeldung/beanvalidation/application/repositories/UserRepository.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/beanvalidation/application/repositories/UserRepository.java similarity index 97% rename from spring-boot/src/main/java/com/baeldung/beanvalidation/application/repositories/UserRepository.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/beanvalidation/application/repositories/UserRepository.java index 8bf7a9f8b2..7b55d15a01 100644 --- a/spring-boot/src/main/java/com/baeldung/beanvalidation/application/repositories/UserRepository.java +++ b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/beanvalidation/application/repositories/UserRepository.java @@ -1,9 +1,9 @@ -package com.baeldung.beanvalidation.application.repositories; - -import org.springframework.data.repository.CrudRepository; -import org.springframework.stereotype.Repository; - -import com.baeldung.beanvalidation.application.entities.User; - -@Repository -public interface UserRepository extends CrudRepository {} +package com.baeldung.beanvalidation.application.repositories; + +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; + +import com.baeldung.beanvalidation.application.entities.User; + +@Repository +public interface UserRepository extends CrudRepository {} diff --git a/spring-boot/src/main/java/com/baeldung/bootcustomfilters/FilterConfig.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/bootcustomfilters/FilterConfig.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/bootcustomfilters/FilterConfig.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/bootcustomfilters/FilterConfig.java diff --git a/spring-boot/src/main/java/com/baeldung/bootcustomfilters/SpringBootFiltersApplication.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/bootcustomfilters/SpringBootFiltersApplication.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/bootcustomfilters/SpringBootFiltersApplication.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/bootcustomfilters/SpringBootFiltersApplication.java diff --git a/spring-boot/src/main/java/com/baeldung/bootcustomfilters/controller/UserController.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/bootcustomfilters/controller/UserController.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/bootcustomfilters/controller/UserController.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/bootcustomfilters/controller/UserController.java diff --git a/spring-boot/src/main/java/com/baeldung/bootcustomfilters/filters/RequestResponseLoggingFilter.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/bootcustomfilters/filters/RequestResponseLoggingFilter.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/bootcustomfilters/filters/RequestResponseLoggingFilter.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/bootcustomfilters/filters/RequestResponseLoggingFilter.java diff --git a/spring-boot/src/main/java/com/baeldung/bootcustomfilters/filters/TransactionFilter.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/bootcustomfilters/filters/TransactionFilter.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/bootcustomfilters/filters/TransactionFilter.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/bootcustomfilters/filters/TransactionFilter.java diff --git a/spring-boot/src/main/java/com/baeldung/bootcustomfilters/model/User.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/bootcustomfilters/model/User.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/bootcustomfilters/model/User.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/bootcustomfilters/model/User.java diff --git a/spring-boot/src/main/java/com/baeldung/buildproperties/Application.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/buildproperties/Application.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/buildproperties/Application.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/buildproperties/Application.java diff --git a/spring-boot/src/main/java/com/baeldung/buildproperties/BuildInfoService.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/buildproperties/BuildInfoService.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/buildproperties/BuildInfoService.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/buildproperties/BuildInfoService.java diff --git a/spring-boot/src/main/java/com/baeldung/chaosmonkey/SpringBootChaosMonkeyApp.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/chaosmonkey/SpringBootChaosMonkeyApp.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/chaosmonkey/SpringBootChaosMonkeyApp.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/chaosmonkey/SpringBootChaosMonkeyApp.java diff --git a/spring-boot/src/main/java/com/baeldung/chaosmonkey/controller/PermissionsController.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/chaosmonkey/controller/PermissionsController.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/chaosmonkey/controller/PermissionsController.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/chaosmonkey/controller/PermissionsController.java diff --git a/spring-boot/src/main/java/com/baeldung/chaosmonkey/service/PermissionsService.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/chaosmonkey/service/PermissionsService.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/chaosmonkey/service/PermissionsService.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/chaosmonkey/service/PermissionsService.java diff --git a/spring-boot/src/main/java/com/baeldung/displayallbeans/Application.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/displayallbeans/Application.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/displayallbeans/Application.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/displayallbeans/Application.java diff --git a/spring-boot/src/main/java/com/baeldung/displayallbeans/controller/FooController.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/displayallbeans/controller/FooController.java similarity index 96% rename from spring-boot/src/main/java/com/baeldung/displayallbeans/controller/FooController.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/displayallbeans/controller/FooController.java index 630820ff9f..5b5b4ae834 100644 --- a/spring-boot/src/main/java/com/baeldung/displayallbeans/controller/FooController.java +++ b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/displayallbeans/controller/FooController.java @@ -1,23 +1,23 @@ -package com.baeldung.displayallbeans.controller; - -import java.util.Map; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; - -import com.baeldung.displayallbeans.service.FooService; - -@Controller -public class FooController { - @Autowired - private FooService fooService; - - @GetMapping(value = "/displayallbeans") - public ResponseEntity getHeaderAndBody(Map model) { - model.put("header", fooService.getHeader()); - model.put("message", fooService.getBody()); - return ResponseEntity.ok("displayallbeans"); - } -} +package com.baeldung.displayallbeans.controller; + +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; + +import com.baeldung.displayallbeans.service.FooService; + +@Controller +public class FooController { + @Autowired + private FooService fooService; + + @GetMapping(value = "/displayallbeans") + public ResponseEntity getHeaderAndBody(Map model) { + model.put("header", fooService.getHeader()); + model.put("message", fooService.getBody()); + return ResponseEntity.ok("displayallbeans"); + } +} diff --git a/spring-boot/src/main/java/com/baeldung/displayallbeans/service/FooService.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/displayallbeans/service/FooService.java similarity index 96% rename from spring-boot/src/main/java/com/baeldung/displayallbeans/service/FooService.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/displayallbeans/service/FooService.java index 1f3c15ee0e..d3f1ea294e 100644 --- a/spring-boot/src/main/java/com/baeldung/displayallbeans/service/FooService.java +++ b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/displayallbeans/service/FooService.java @@ -1,16 +1,16 @@ -package com.baeldung.displayallbeans.service; - -import org.springframework.stereotype.Service; - -@Service -public class FooService { - - public String getHeader() { - return "Display All Beans"; - } - - public String getBody() { - return "This is a sample application that displays all beans " + "in Spring IoC container using ListableBeanFactory interface " + "and Spring Boot Actuators."; - } - -} +package com.baeldung.displayallbeans.service; + +import org.springframework.stereotype.Service; + +@Service +public class FooService { + + public String getHeader() { + return "Display All Beans"; + } + + public String getBody() { + return "This is a sample application that displays all beans " + "in Spring IoC container using ListableBeanFactory interface " + "and Spring Boot Actuators."; + } + +} diff --git a/spring-boot/src/main/java/com/baeldung/dynamicvalidation/ContactInfo.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/dynamicvalidation/ContactInfo.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/dynamicvalidation/ContactInfo.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/dynamicvalidation/ContactInfo.java diff --git a/spring-boot/src/main/java/com/baeldung/dynamicvalidation/ContactInfoValidator.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/dynamicvalidation/ContactInfoValidator.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/dynamicvalidation/ContactInfoValidator.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/dynamicvalidation/ContactInfoValidator.java diff --git a/spring-boot/src/main/java/com/baeldung/dynamicvalidation/DynamicValidationApp.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/dynamicvalidation/DynamicValidationApp.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/dynamicvalidation/DynamicValidationApp.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/dynamicvalidation/DynamicValidationApp.java diff --git a/spring-boot/src/main/java/com/baeldung/dynamicvalidation/config/CustomerController.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/dynamicvalidation/config/CustomerController.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/dynamicvalidation/config/CustomerController.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/dynamicvalidation/config/CustomerController.java diff --git a/spring-boot/src/main/java/com/baeldung/dynamicvalidation/config/PersistenceConfig.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/dynamicvalidation/config/PersistenceConfig.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/dynamicvalidation/config/PersistenceConfig.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/dynamicvalidation/config/PersistenceConfig.java diff --git a/spring-boot/src/main/java/com/baeldung/dynamicvalidation/dao/ContactInfoExpressionRepository.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/dynamicvalidation/dao/ContactInfoExpressionRepository.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/dynamicvalidation/dao/ContactInfoExpressionRepository.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/dynamicvalidation/dao/ContactInfoExpressionRepository.java diff --git a/spring-boot/src/main/java/com/baeldung/dynamicvalidation/model/ContactInfoExpression.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/dynamicvalidation/model/ContactInfoExpression.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/dynamicvalidation/model/ContactInfoExpression.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/dynamicvalidation/model/ContactInfoExpression.java diff --git a/spring-boot/src/main/java/com/baeldung/dynamicvalidation/model/Customer.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/dynamicvalidation/model/Customer.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/dynamicvalidation/model/Customer.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/dynamicvalidation/model/Customer.java diff --git a/spring-boot/src/main/java/com/baeldung/errorhandling/ErrorHandlingApplication.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/errorhandling/ErrorHandlingApplication.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/errorhandling/ErrorHandlingApplication.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/errorhandling/ErrorHandlingApplication.java diff --git a/spring-boot/src/main/java/com/baeldung/errorhandling/controllers/IndexController.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/errorhandling/controllers/IndexController.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/errorhandling/controllers/IndexController.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/errorhandling/controllers/IndexController.java diff --git a/spring-boot/src/main/java/com/baeldung/errorhandling/controllers/MyErrorController.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/errorhandling/controllers/MyErrorController.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/errorhandling/controllers/MyErrorController.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/errorhandling/controllers/MyErrorController.java diff --git a/spring-boot/src/main/java/com/baeldung/failureanalyzer/FailureAnalyzerApplication.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/failureanalyzer/FailureAnalyzerApplication.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/failureanalyzer/FailureAnalyzerApplication.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/failureanalyzer/FailureAnalyzerApplication.java diff --git a/spring-boot/src/main/java/com/baeldung/failureanalyzer/MyBeanNotOfRequiredTypeFailureAnalyzer.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/failureanalyzer/MyBeanNotOfRequiredTypeFailureAnalyzer.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/failureanalyzer/MyBeanNotOfRequiredTypeFailureAnalyzer.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/failureanalyzer/MyBeanNotOfRequiredTypeFailureAnalyzer.java diff --git a/spring-boot/src/main/java/com/baeldung/failureanalyzer/MyDAO.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/failureanalyzer/MyDAO.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/failureanalyzer/MyDAO.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/failureanalyzer/MyDAO.java diff --git a/spring-boot/src/main/java/com/baeldung/failureanalyzer/MySecondDAO.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/failureanalyzer/MySecondDAO.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/failureanalyzer/MySecondDAO.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/failureanalyzer/MySecondDAO.java diff --git a/spring-boot/src/main/java/com/baeldung/failureanalyzer/MyService.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/failureanalyzer/MyService.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/failureanalyzer/MyService.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/failureanalyzer/MyService.java diff --git a/spring-boot/src/main/java/com/baeldung/git/CommitIdApplication.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/git/CommitIdApplication.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/git/CommitIdApplication.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/git/CommitIdApplication.java diff --git a/spring-boot/src/main/java/com/baeldung/git/CommitInfoController.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/git/CommitInfoController.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/git/CommitInfoController.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/git/CommitInfoController.java diff --git a/spring-boot/src/main/java/com/baeldung/git/README.md b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/git/README.md similarity index 100% rename from spring-boot/src/main/java/com/baeldung/git/README.md rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/git/README.md diff --git a/spring-boot/src/main/java/com/baeldung/graphql/Author.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/Author.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/graphql/Author.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/Author.java diff --git a/spring-boot/src/main/java/com/baeldung/graphql/AuthorDao.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/AuthorDao.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/graphql/AuthorDao.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/AuthorDao.java diff --git a/spring-boot/src/main/java/com/baeldung/graphql/AuthorResolver.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/AuthorResolver.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/graphql/AuthorResolver.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/AuthorResolver.java diff --git a/spring-boot/src/main/java/com/baeldung/graphql/GraphqlConfiguration.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/GraphqlConfiguration.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/graphql/GraphqlConfiguration.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/GraphqlConfiguration.java diff --git a/spring-boot/src/main/java/com/baeldung/graphql/Mutation.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/Mutation.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/graphql/Mutation.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/Mutation.java diff --git a/spring-boot/src/main/java/com/baeldung/graphql/Post.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/Post.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/graphql/Post.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/Post.java diff --git a/spring-boot/src/main/java/com/baeldung/graphql/PostDao.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/PostDao.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/graphql/PostDao.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/PostDao.java diff --git a/spring-boot/src/main/java/com/baeldung/graphql/PostResolver.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/PostResolver.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/graphql/PostResolver.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/PostResolver.java diff --git a/spring-boot/src/main/java/com/baeldung/graphql/Query.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/Query.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/graphql/Query.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/graphql/Query.java diff --git a/spring-boot/src/main/java/com/baeldung/internationalization/InternationalizationApp.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/internationalization/InternationalizationApp.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/internationalization/InternationalizationApp.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/internationalization/InternationalizationApp.java diff --git a/spring-boot/src/main/java/com/baeldung/internationalization/config/MvcConfig.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/internationalization/config/MvcConfig.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/internationalization/config/MvcConfig.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/internationalization/config/MvcConfig.java diff --git a/spring-boot/src/main/java/com/baeldung/internationalization/config/PageController.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/internationalization/config/PageController.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/internationalization/config/PageController.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/internationalization/config/PageController.java diff --git a/spring-boot/src/main/java/com/baeldung/intro/App.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/intro/App.java similarity index 96% rename from spring-boot/src/main/java/com/baeldung/intro/App.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/intro/App.java index b5d53f0da3..77cdf4ddb9 100644 --- a/spring-boot/src/main/java/com/baeldung/intro/App.java +++ b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/intro/App.java @@ -1,11 +1,11 @@ -package com.baeldung.intro; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class App { - public static void main(String[] args) { - SpringApplication.run(App.class, args); - } -} +package com.baeldung.intro; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class App { + public static void main(String[] args) { + SpringApplication.run(App.class, args); + } +} diff --git a/spring-boot/src/main/java/com/baeldung/intro/controller/HomeController.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/intro/controller/HomeController.java similarity index 95% rename from spring-boot/src/main/java/com/baeldung/intro/controller/HomeController.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/intro/controller/HomeController.java index 32f22f2cae..4797d6e593 100644 --- a/spring-boot/src/main/java/com/baeldung/intro/controller/HomeController.java +++ b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/intro/controller/HomeController.java @@ -1,18 +1,18 @@ -package com.baeldung.intro.controller; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class HomeController { - - @GetMapping("/") - public String root() { - return "Index Page"; - } - - @GetMapping("/local") - public String local() { - return "/local"; - } -} +package com.baeldung.intro.controller; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HomeController { + + @GetMapping("/") + public String root() { + return "Index Page"; + } + + @GetMapping("/local") + public String local() { + return "/local"; + } +} diff --git a/spring-boot/src/main/java/com/baeldung/jsondateformat/Contact.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/jsondateformat/Contact.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/jsondateformat/Contact.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/jsondateformat/Contact.java diff --git a/spring-boot/src/main/java/com/baeldung/jsondateformat/ContactApp.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/jsondateformat/ContactApp.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/jsondateformat/ContactApp.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/jsondateformat/ContactApp.java diff --git a/spring-boot/src/main/java/com/baeldung/jsondateformat/ContactAppConfig.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/jsondateformat/ContactAppConfig.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/jsondateformat/ContactAppConfig.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/jsondateformat/ContactAppConfig.java diff --git a/spring-boot/src/main/java/com/baeldung/jsondateformat/ContactController.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/jsondateformat/ContactController.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/jsondateformat/ContactController.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/jsondateformat/ContactController.java diff --git a/spring-boot/src/main/java/com/baeldung/jsondateformat/ContactWithJavaUtilDate.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/jsondateformat/ContactWithJavaUtilDate.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/jsondateformat/ContactWithJavaUtilDate.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/jsondateformat/ContactWithJavaUtilDate.java diff --git a/spring-boot/src/main/java/com/baeldung/jsondateformat/PlainContact.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/jsondateformat/PlainContact.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/jsondateformat/PlainContact.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/jsondateformat/PlainContact.java diff --git a/spring-boot/src/main/java/com/baeldung/jsondateformat/PlainContactWithJavaUtilDate.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/jsondateformat/PlainContactWithJavaUtilDate.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/jsondateformat/PlainContactWithJavaUtilDate.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/jsondateformat/PlainContactWithJavaUtilDate.java diff --git a/spring-boot/src/main/java/com/baeldung/kong/QueryController.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/kong/QueryController.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/kong/QueryController.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/kong/QueryController.java diff --git a/spring-boot/src/main/java/com/baeldung/kong/StockApp.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/kong/StockApp.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/kong/StockApp.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/kong/StockApp.java diff --git a/spring-boot/src/main/java/com/baeldung/rss/ArticleFeedView.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/rss/ArticleFeedView.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/rss/ArticleFeedView.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/rss/ArticleFeedView.java diff --git a/spring-boot/src/main/java/com/baeldung/rss/ArticleRssController.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/rss/ArticleRssController.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/rss/ArticleRssController.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/rss/ArticleRssController.java diff --git a/spring-boot/src/main/java/com/baeldung/rss/CustomContainer.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/rss/CustomContainer.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/rss/CustomContainer.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/rss/CustomContainer.java diff --git a/spring-boot/src/main/java/com/baeldung/rss/RssApp.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/rss/RssApp.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/rss/RssApp.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/rss/RssApp.java diff --git a/spring-boot/src/main/java/com/baeldung/servletinitializer/WarInitializerApplication.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/servletinitializer/WarInitializerApplication.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/servletinitializer/WarInitializerApplication.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/servletinitializer/WarInitializerApplication.java diff --git a/spring-boot/src/main/java/com/baeldung/servlets/ApplicationMain.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/servlets/ApplicationMain.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/servlets/ApplicationMain.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/servlets/ApplicationMain.java diff --git a/spring-boot/src/main/java/com/baeldung/servlets/configuration/WebAppInitializer.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/servlets/configuration/WebAppInitializer.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/servlets/configuration/WebAppInitializer.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/servlets/configuration/WebAppInitializer.java diff --git a/spring-boot/src/main/java/com/baeldung/servlets/configuration/WebMvcConfigure.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/servlets/configuration/WebMvcConfigure.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/servlets/configuration/WebMvcConfigure.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/servlets/configuration/WebMvcConfigure.java diff --git a/spring-boot/src/main/java/com/baeldung/servlets/props/Constants.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/servlets/props/Constants.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/servlets/props/Constants.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/servlets/props/Constants.java diff --git a/spring-boot/src/main/java/com/baeldung/servlets/props/PropertyLoader.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/servlets/props/PropertyLoader.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/servlets/props/PropertyLoader.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/servlets/props/PropertyLoader.java diff --git a/spring-boot/src/main/java/com/baeldung/servlets/props/PropertySourcesLoader.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/servlets/props/PropertySourcesLoader.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/servlets/props/PropertySourcesLoader.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/servlets/props/PropertySourcesLoader.java diff --git a/spring-boot/src/main/java/com/baeldung/servlets/servlets/GenericCustomServlet.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/servlets/servlets/GenericCustomServlet.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/servlets/servlets/GenericCustomServlet.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/servlets/servlets/GenericCustomServlet.java diff --git a/spring-boot/src/main/java/com/baeldung/servlets/servlets/javaee/AnnotationServlet.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/servlets/servlets/javaee/AnnotationServlet.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/servlets/servlets/javaee/AnnotationServlet.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/servlets/servlets/javaee/AnnotationServlet.java diff --git a/spring-boot/src/main/java/com/baeldung/servlets/servlets/javaee/EEWebXmlServlet.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/servlets/servlets/javaee/EEWebXmlServlet.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/servlets/servlets/javaee/EEWebXmlServlet.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/servlets/servlets/javaee/EEWebXmlServlet.java diff --git a/spring-boot/src/main/java/com/baeldung/servlets/servlets/springboot/SpringRegistrationBeanServlet.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/servlets/servlets/springboot/SpringRegistrationBeanServlet.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/servlets/servlets/springboot/SpringRegistrationBeanServlet.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/servlets/servlets/springboot/SpringRegistrationBeanServlet.java diff --git a/spring-boot/src/main/java/com/baeldung/servlets/servlets/springboot/embedded/EmbeddedTomcatExample.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/servlets/servlets/springboot/embedded/EmbeddedTomcatExample.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/servlets/servlets/springboot/embedded/EmbeddedTomcatExample.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/servlets/servlets/springboot/embedded/EmbeddedTomcatExample.java diff --git a/spring-boot/src/main/java/com/baeldung/shutdownhooks/ShutdownHookApplication.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/shutdownhooks/ShutdownHookApplication.java similarity index 96% rename from spring-boot/src/main/java/com/baeldung/shutdownhooks/ShutdownHookApplication.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/shutdownhooks/ShutdownHookApplication.java index 7cce34a06c..44ec9e25ab 100644 --- a/spring-boot/src/main/java/com/baeldung/shutdownhooks/ShutdownHookApplication.java +++ b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/shutdownhooks/ShutdownHookApplication.java @@ -1,14 +1,14 @@ -package com.baeldung.shutdownhooks; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -@EnableAutoConfiguration -public class ShutdownHookApplication { - - public static void main(String args[]) { - SpringApplication.run(ShutdownHookApplication.class, args); - } -} +package com.baeldung.shutdownhooks; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +@EnableAutoConfiguration +public class ShutdownHookApplication { + + public static void main(String args[]) { + SpringApplication.run(ShutdownHookApplication.class, args); + } +} diff --git a/spring-boot/src/main/java/com/baeldung/shutdownhooks/beans/Bean1.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/shutdownhooks/beans/Bean1.java similarity index 95% rename from spring-boot/src/main/java/com/baeldung/shutdownhooks/beans/Bean1.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/shutdownhooks/beans/Bean1.java index e85b9395d3..545599ce25 100644 --- a/spring-boot/src/main/java/com/baeldung/shutdownhooks/beans/Bean1.java +++ b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/shutdownhooks/beans/Bean1.java @@ -1,14 +1,14 @@ -package com.baeldung.shutdownhooks.beans; - -import javax.annotation.PreDestroy; - -import org.springframework.stereotype.Component; - -@Component -public class Bean1 { - - @PreDestroy - public void destroy() { - System.out.println("Shutdown triggered using @PreDestroy."); - } -} +package com.baeldung.shutdownhooks.beans; + +import javax.annotation.PreDestroy; + +import org.springframework.stereotype.Component; + +@Component +public class Bean1 { + + @PreDestroy + public void destroy() { + System.out.println("Shutdown triggered using @PreDestroy."); + } +} diff --git a/spring-boot/src/main/java/com/baeldung/shutdownhooks/beans/Bean2.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/shutdownhooks/beans/Bean2.java similarity index 96% rename from spring-boot/src/main/java/com/baeldung/shutdownhooks/beans/Bean2.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/shutdownhooks/beans/Bean2.java index e85d12e791..b586c1430a 100644 --- a/spring-boot/src/main/java/com/baeldung/shutdownhooks/beans/Bean2.java +++ b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/shutdownhooks/beans/Bean2.java @@ -1,14 +1,14 @@ -package com.baeldung.shutdownhooks.beans; - -import org.springframework.beans.factory.DisposableBean; -import org.springframework.stereotype.Component; - -@Component -public class Bean2 implements DisposableBean { - - @Override - public void destroy() throws Exception { - System.out.println("Shutdown triggered using DisposableBean."); - } - -} +package com.baeldung.shutdownhooks.beans; + +import org.springframework.beans.factory.DisposableBean; +import org.springframework.stereotype.Component; + +@Component +public class Bean2 implements DisposableBean { + + @Override + public void destroy() throws Exception { + System.out.println("Shutdown triggered using DisposableBean."); + } + +} diff --git a/spring-boot/src/main/java/com/baeldung/shutdownhooks/beans/Bean3.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/shutdownhooks/beans/Bean3.java similarity index 95% rename from spring-boot/src/main/java/com/baeldung/shutdownhooks/beans/Bean3.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/shutdownhooks/beans/Bean3.java index bed1d50ee7..25a56e2859 100644 --- a/spring-boot/src/main/java/com/baeldung/shutdownhooks/beans/Bean3.java +++ b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/shutdownhooks/beans/Bean3.java @@ -1,8 +1,8 @@ -package com.baeldung.shutdownhooks.beans; - -public class Bean3 { - - public void destroy() { - System.out.println("Shutdown triggered using bean destroy method."); - } -} +package com.baeldung.shutdownhooks.beans; + +public class Bean3 { + + public void destroy() { + System.out.println("Shutdown triggered using bean destroy method."); + } +} diff --git a/spring-boot/src/main/java/com/baeldung/shutdownhooks/config/ExampleServletContextListener.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/shutdownhooks/config/ExampleServletContextListener.java similarity index 96% rename from spring-boot/src/main/java/com/baeldung/shutdownhooks/config/ExampleServletContextListener.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/shutdownhooks/config/ExampleServletContextListener.java index 07d729cb83..03ad5524b6 100644 --- a/spring-boot/src/main/java/com/baeldung/shutdownhooks/config/ExampleServletContextListener.java +++ b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/shutdownhooks/config/ExampleServletContextListener.java @@ -1,18 +1,18 @@ -package com.baeldung.shutdownhooks.config; - -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; - -public class ExampleServletContextListener implements ServletContextListener { - - @Override - public void contextDestroyed(ServletContextEvent event) { - System.out.println("Shutdown triggered using ServletContextListener."); - } - - @Override - public void contextInitialized(ServletContextEvent event) { - // Triggers when context initializes - } - -} +package com.baeldung.shutdownhooks.config; + +import javax.servlet.ServletContextEvent; +import javax.servlet.ServletContextListener; + +public class ExampleServletContextListener implements ServletContextListener { + + @Override + public void contextDestroyed(ServletContextEvent event) { + System.out.println("Shutdown triggered using ServletContextListener."); + } + + @Override + public void contextInitialized(ServletContextEvent event) { + // Triggers when context initializes + } + +} diff --git a/spring-boot/src/main/java/com/baeldung/shutdownhooks/config/ShutdownHookConfiguration.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/shutdownhooks/config/ShutdownHookConfiguration.java similarity index 96% rename from spring-boot/src/main/java/com/baeldung/shutdownhooks/config/ShutdownHookConfiguration.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/shutdownhooks/config/ShutdownHookConfiguration.java index 2d0712e19b..7d487dfc21 100644 --- a/spring-boot/src/main/java/com/baeldung/shutdownhooks/config/ShutdownHookConfiguration.java +++ b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/shutdownhooks/config/ShutdownHookConfiguration.java @@ -1,25 +1,25 @@ -package com.baeldung.shutdownhooks.config; - -import javax.servlet.ServletContextListener; - -import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import com.baeldung.shutdownhooks.beans.Bean3; - -@Configuration -public class ShutdownHookConfiguration { - - @Bean(destroyMethod = "destroy") - public Bean3 initializeBean3() { - return new Bean3(); - } - - @Bean - ServletListenerRegistrationBean servletListener() { - ServletListenerRegistrationBean srb = new ServletListenerRegistrationBean<>(); - srb.setListener(new ExampleServletContextListener()); - return srb; - } -} +package com.baeldung.shutdownhooks.config; + +import javax.servlet.ServletContextListener; + +import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import com.baeldung.shutdownhooks.beans.Bean3; + +@Configuration +public class ShutdownHookConfiguration { + + @Bean(destroyMethod = "destroy") + public Bean3 initializeBean3() { + return new Bean3(); + } + + @Bean + ServletListenerRegistrationBean servletListener() { + ServletListenerRegistrationBean srb = new ServletListenerRegistrationBean<>(); + srb.setListener(new ExampleServletContextListener()); + return srb; + } +} diff --git a/spring-boot/src/main/java/com/baeldung/toggle/Employee.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/Employee.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/toggle/Employee.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/Employee.java diff --git a/spring-boot/src/main/java/com/baeldung/toggle/EmployeeRepository.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/EmployeeRepository.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/toggle/EmployeeRepository.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/EmployeeRepository.java diff --git a/spring-boot/src/main/java/com/baeldung/toggle/FeatureAssociation.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/FeatureAssociation.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/toggle/FeatureAssociation.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/FeatureAssociation.java diff --git a/spring-boot/src/main/java/com/baeldung/toggle/FeaturesAspect.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/FeaturesAspect.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/toggle/FeaturesAspect.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/FeaturesAspect.java diff --git a/spring-boot/src/main/java/com/baeldung/toggle/MyFeatures.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/MyFeatures.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/toggle/MyFeatures.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/MyFeatures.java diff --git a/spring-boot/src/main/java/com/baeldung/toggle/SalaryController.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/SalaryController.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/toggle/SalaryController.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/SalaryController.java diff --git a/spring-boot/src/main/java/com/baeldung/toggle/SalaryService.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/SalaryService.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/toggle/SalaryService.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/SalaryService.java diff --git a/spring-boot/src/main/java/com/baeldung/toggle/ToggleApplication.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/ToggleApplication.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/toggle/ToggleApplication.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/ToggleApplication.java diff --git a/spring-boot/src/main/java/com/baeldung/toggle/ToggleConfiguration.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/ToggleConfiguration.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/toggle/ToggleConfiguration.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/toggle/ToggleConfiguration.java diff --git a/spring-boot/src/main/java/com/baeldung/utils/UtilsApplication.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/utils/UtilsApplication.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/utils/UtilsApplication.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/utils/UtilsApplication.java diff --git a/spring-boot/src/main/java/com/baeldung/utils/controller/UtilsController.java b/spring-boot-modules/spring-boot/src/main/java/com/baeldung/utils/controller/UtilsController.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/utils/controller/UtilsController.java rename to spring-boot-modules/spring-boot/src/main/java/com/baeldung/utils/controller/UtilsController.java diff --git a/spring-boot/src/main/java/org/baeldung/boot/Application.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/Application.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/boot/Application.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/Application.java diff --git a/spring-boot/src/main/java/org/baeldung/boot/config/H2JpaConfig.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/config/H2JpaConfig.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/boot/config/H2JpaConfig.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/config/H2JpaConfig.java diff --git a/spring-boot/src/main/java/org/baeldung/boot/config/WebConfig.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/config/WebConfig.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/boot/config/WebConfig.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/config/WebConfig.java diff --git a/spring-boot/src/main/java/org/baeldung/boot/controller/servlet/HelloWorldServlet.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/controller/servlet/HelloWorldServlet.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/boot/controller/servlet/HelloWorldServlet.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/controller/servlet/HelloWorldServlet.java diff --git a/spring-boot/src/main/java/org/baeldung/boot/controller/servlet/SpringHelloWorldServlet.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/controller/servlet/SpringHelloWorldServlet.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/boot/controller/servlet/SpringHelloWorldServlet.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/controller/servlet/SpringHelloWorldServlet.java diff --git a/spring-boot/src/main/java/org/baeldung/boot/converter/GenericBigDecimalConverter.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/converter/GenericBigDecimalConverter.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/boot/converter/GenericBigDecimalConverter.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/converter/GenericBigDecimalConverter.java diff --git a/spring-boot/src/main/java/org/baeldung/boot/converter/StringToEmployeeConverter.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/converter/StringToEmployeeConverter.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/boot/converter/StringToEmployeeConverter.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/converter/StringToEmployeeConverter.java diff --git a/spring-boot/src/main/java/org/baeldung/boot/converter/StringToEnumConverterFactory.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/converter/StringToEnumConverterFactory.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/boot/converter/StringToEnumConverterFactory.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/converter/StringToEnumConverterFactory.java diff --git a/spring-boot/src/main/java/org/baeldung/boot/converter/controller/StringToEmployeeConverterController.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/converter/controller/StringToEmployeeConverterController.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/boot/converter/controller/StringToEmployeeConverterController.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/converter/controller/StringToEmployeeConverterController.java diff --git a/spring-boot/src/main/java/org/baeldung/boot/domain/Modes.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/domain/Modes.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/boot/domain/Modes.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/domain/Modes.java diff --git a/spring-boot/src/main/java/org/baeldung/boot/jsoncomponent/User.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/jsoncomponent/User.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/boot/jsoncomponent/User.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/jsoncomponent/User.java diff --git a/spring-boot/src/main/java/org/baeldung/boot/jsoncomponent/UserCombinedSerializer.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/jsoncomponent/UserCombinedSerializer.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/boot/jsoncomponent/UserCombinedSerializer.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/jsoncomponent/UserCombinedSerializer.java diff --git a/spring-boot/src/main/java/org/baeldung/boot/jsoncomponent/UserJsonDeserializer.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/jsoncomponent/UserJsonDeserializer.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/boot/jsoncomponent/UserJsonDeserializer.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/jsoncomponent/UserJsonDeserializer.java diff --git a/spring-boot/src/main/java/org/baeldung/boot/jsoncomponent/UserJsonSerializer.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/jsoncomponent/UserJsonSerializer.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/boot/jsoncomponent/UserJsonSerializer.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/boot/jsoncomponent/UserJsonSerializer.java diff --git a/spring-boot/src/main/java/org/baeldung/common/error/MyCustomErrorController.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/common/error/MyCustomErrorController.java similarity index 95% rename from spring-boot/src/main/java/org/baeldung/common/error/MyCustomErrorController.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/common/error/MyCustomErrorController.java index 6b342a1bfb..df0e3ec0b2 100644 --- a/spring-boot/src/main/java/org/baeldung/common/error/MyCustomErrorController.java +++ b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/common/error/MyCustomErrorController.java @@ -1,24 +1,24 @@ -package org.baeldung.common.error; - -import org.springframework.boot.web.servlet.error.ErrorController; -import org.springframework.web.bind.annotation.GetMapping; - -public class MyCustomErrorController implements ErrorController { - - private static final String PATH = "/error"; - - public MyCustomErrorController() { - // TODO Auto-generated constructor stub - } - - @GetMapping(value = PATH) - public String error() { - return "Error haven"; - } - - @Override - public String getErrorPath() { - return PATH; - } - -} +package org.baeldung.common.error; + +import org.springframework.boot.web.servlet.error.ErrorController; +import org.springframework.web.bind.annotation.GetMapping; + +public class MyCustomErrorController implements ErrorController { + + private static final String PATH = "/error"; + + public MyCustomErrorController() { + // TODO Auto-generated constructor stub + } + + @GetMapping(value = PATH) + public String error() { + return "Error haven"; + } + + @Override + public String getErrorPath() { + return PATH; + } + +} diff --git a/spring-boot/src/main/java/org/baeldung/common/error/SpringHelloServletRegistrationBean.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/common/error/SpringHelloServletRegistrationBean.java similarity index 96% rename from spring-boot/src/main/java/org/baeldung/common/error/SpringHelloServletRegistrationBean.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/common/error/SpringHelloServletRegistrationBean.java index 723afddd06..774cf1b970 100644 --- a/spring-boot/src/main/java/org/baeldung/common/error/SpringHelloServletRegistrationBean.java +++ b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/common/error/SpringHelloServletRegistrationBean.java @@ -1,15 +1,15 @@ -package org.baeldung.common.error; - -import org.springframework.boot.web.servlet.ServletRegistrationBean; - -import javax.servlet.Servlet; - -public class SpringHelloServletRegistrationBean extends ServletRegistrationBean { - - public SpringHelloServletRegistrationBean() { - } - - public SpringHelloServletRegistrationBean(Servlet servlet, String... urlMappings) { - super(servlet, urlMappings); - } -} +package org.baeldung.common.error; + +import org.springframework.boot.web.servlet.ServletRegistrationBean; + +import javax.servlet.Servlet; + +public class SpringHelloServletRegistrationBean extends ServletRegistrationBean { + + public SpringHelloServletRegistrationBean() { + } + + public SpringHelloServletRegistrationBean(Servlet servlet, String... urlMappings) { + super(servlet, urlMappings); + } +} diff --git a/spring-boot/src/main/java/org/baeldung/common/error/controller/ErrorController.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/common/error/controller/ErrorController.java similarity index 95% rename from spring-boot/src/main/java/org/baeldung/common/error/controller/ErrorController.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/common/error/controller/ErrorController.java index 3e26f8c9d8..ac5f92e9c9 100644 --- a/spring-boot/src/main/java/org/baeldung/common/error/controller/ErrorController.java +++ b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/common/error/controller/ErrorController.java @@ -1,22 +1,22 @@ -package org.baeldung.common.error.controller; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class ErrorController { - - public ErrorController() { - } - - @GetMapping("/400") - String error400() { - return "Error Code: 400 occured."; - } - - @GetMapping("/errorHaven") - String errorHeaven() { - return "You have reached the haven of errors!!!"; - } - -} +package org.baeldung.common.error.controller; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class ErrorController { + + public ErrorController() { + } + + @GetMapping("/400") + String error400() { + return "Error Code: 400 occured."; + } + + @GetMapping("/errorHaven") + String errorHeaven() { + return "You have reached the haven of errors!!!"; + } + +} diff --git a/spring-boot/src/main/java/org/baeldung/common/properties/MyServletContainerCustomizationBean.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/common/properties/MyServletContainerCustomizationBean.java similarity index 97% rename from spring-boot/src/main/java/org/baeldung/common/properties/MyServletContainerCustomizationBean.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/common/properties/MyServletContainerCustomizationBean.java index f6ab017298..d553d44769 100644 --- a/spring-boot/src/main/java/org/baeldung/common/properties/MyServletContainerCustomizationBean.java +++ b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/common/properties/MyServletContainerCustomizationBean.java @@ -1,25 +1,25 @@ -package org.baeldung.common.properties; - -import org.springframework.boot.web.server.ErrorPage; -import org.springframework.boot.web.server.WebServerFactoryCustomizer; -import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory; -import org.springframework.http.HttpStatus; -import org.springframework.stereotype.Component; - -@Component -public class MyServletContainerCustomizationBean implements WebServerFactoryCustomizer { - - public MyServletContainerCustomizationBean() { - - } - - @Override - public void customize(ConfigurableServletWebServerFactory container) { - container.setPort(8084); - container.setContextPath("/springbootapp"); - - container.addErrorPages(new ErrorPage(HttpStatus.BAD_REQUEST, "/400")); - container.addErrorPages(new ErrorPage("/errorHaven")); - } - -} +package org.baeldung.common.properties; + +import org.springframework.boot.web.server.ErrorPage; +import org.springframework.boot.web.server.WebServerFactoryCustomizer; +import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Component; + +@Component +public class MyServletContainerCustomizationBean implements WebServerFactoryCustomizer { + + public MyServletContainerCustomizationBean() { + + } + + @Override + public void customize(ConfigurableServletWebServerFactory container) { + container.setPort(8084); + container.setContextPath("/springbootapp"); + + container.addErrorPages(new ErrorPage(HttpStatus.BAD_REQUEST, "/400")); + container.addErrorPages(new ErrorPage("/errorHaven")); + } + +} diff --git a/spring-boot/src/main/java/org/baeldung/common/resources/ExecutorServiceExitCodeGenerator.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/common/resources/ExecutorServiceExitCodeGenerator.java similarity index 96% rename from spring-boot/src/main/java/org/baeldung/common/resources/ExecutorServiceExitCodeGenerator.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/common/resources/ExecutorServiceExitCodeGenerator.java index be33d64c5d..64853a9941 100644 --- a/spring-boot/src/main/java/org/baeldung/common/resources/ExecutorServiceExitCodeGenerator.java +++ b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/common/resources/ExecutorServiceExitCodeGenerator.java @@ -1,28 +1,28 @@ -package org.baeldung.common.resources; - -import org.springframework.boot.ExitCodeGenerator; - -import java.util.Objects; -import java.util.concurrent.ExecutorService; - -public class ExecutorServiceExitCodeGenerator implements ExitCodeGenerator { - - private ExecutorService executorService; - - public ExecutorServiceExitCodeGenerator(ExecutorService executorService) { - } - - @Override - public int getExitCode() { - try { - if (!Objects.isNull(executorService)) { - executorService.shutdownNow(); - return 1; - } - - return 0; - } catch (SecurityException ex) { - return 0; - } - } -} +package org.baeldung.common.resources; + +import org.springframework.boot.ExitCodeGenerator; + +import java.util.Objects; +import java.util.concurrent.ExecutorService; + +public class ExecutorServiceExitCodeGenerator implements ExitCodeGenerator { + + private ExecutorService executorService; + + public ExecutorServiceExitCodeGenerator(ExecutorService executorService) { + } + + @Override + public int getExitCode() { + try { + if (!Objects.isNull(executorService)) { + executorService.shutdownNow(); + return 1; + } + + return 0; + } catch (SecurityException ex) { + return 0; + } + } +} diff --git a/spring-boot/src/main/java/org/baeldung/demo/DemoApplication.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/demo/DemoApplication.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/demo/DemoApplication.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/demo/DemoApplication.java diff --git a/spring-boot/src/main/java/org/baeldung/demo/boottest/Employee.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/demo/boottest/Employee.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/demo/boottest/Employee.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/demo/boottest/Employee.java diff --git a/spring-boot/src/main/java/org/baeldung/demo/boottest/EmployeeRepository.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/demo/boottest/EmployeeRepository.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/demo/boottest/EmployeeRepository.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/demo/boottest/EmployeeRepository.java diff --git a/spring-boot/src/main/java/org/baeldung/demo/boottest/EmployeeRestController.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/demo/boottest/EmployeeRestController.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/demo/boottest/EmployeeRestController.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/demo/boottest/EmployeeRestController.java diff --git a/spring-boot/src/main/java/org/baeldung/demo/boottest/EmployeeService.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/demo/boottest/EmployeeService.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/demo/boottest/EmployeeService.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/demo/boottest/EmployeeService.java diff --git a/spring-boot/src/main/java/org/baeldung/demo/boottest/EmployeeServiceImpl.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/demo/boottest/EmployeeServiceImpl.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/demo/boottest/EmployeeServiceImpl.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/demo/boottest/EmployeeServiceImpl.java diff --git a/spring-boot/src/main/java/org/baeldung/demo/components/FooService.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/demo/components/FooService.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/demo/components/FooService.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/demo/components/FooService.java diff --git a/spring-boot/src/main/java/org/baeldung/demo/exceptions/CommonException.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/demo/exceptions/CommonException.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/demo/exceptions/CommonException.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/demo/exceptions/CommonException.java diff --git a/spring-boot/src/main/java/org/baeldung/demo/exceptions/FooNotFoundException.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/demo/exceptions/FooNotFoundException.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/demo/exceptions/FooNotFoundException.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/demo/exceptions/FooNotFoundException.java diff --git a/spring-boot/src/main/java/org/baeldung/demo/model/Foo.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/demo/model/Foo.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/demo/model/Foo.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/demo/model/Foo.java diff --git a/spring-boot/src/main/java/org/baeldung/demo/repository/FooRepository.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/demo/repository/FooRepository.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/demo/repository/FooRepository.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/demo/repository/FooRepository.java diff --git a/spring-boot/src/main/java/org/baeldung/demo/service/FooController.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/demo/service/FooController.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/demo/service/FooController.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/demo/service/FooController.java diff --git a/spring-boot/src/main/java/org/baeldung/endpoints/info/TotalUsersInfoContributor.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/endpoints/info/TotalUsersInfoContributor.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/endpoints/info/TotalUsersInfoContributor.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/endpoints/info/TotalUsersInfoContributor.java diff --git a/spring-boot/src/main/java/org/baeldung/main/SpringBootApplication.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/main/SpringBootApplication.java similarity index 97% rename from spring-boot/src/main/java/org/baeldung/main/SpringBootApplication.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/main/SpringBootApplication.java index 30ac94221b..a203659d63 100644 --- a/spring-boot/src/main/java/org/baeldung/main/SpringBootApplication.java +++ b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/main/SpringBootApplication.java @@ -1,63 +1,63 @@ -package org.baeldung.main; - -import org.baeldung.boot.controller.servlet.HelloWorldServlet; -import org.baeldung.boot.controller.servlet.SpringHelloWorldServlet; -import org.baeldung.common.error.SpringHelloServletRegistrationBean; -import org.baeldung.common.resources.ExecutorServiceExitCodeGenerator; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -@RestController -@EnableAutoConfiguration -@ComponentScan({ "org.baeldung.common.error", "org.baeldung.common.error.controller", "org.baeldung.common.properties", "org.baeldung.common.resources", "org.baeldung.endpoints", "org.baeldung.service", "org.baeldung.monitor.jmx", "org.baeldung.boot.config" }) -public class SpringBootApplication { - - private static ApplicationContext applicationContext; - - @GetMapping("/") - String home() { - return "TADA!!! You are in Spring Boot Actuator test application."; - } - - public static void main(String[] args) { - applicationContext = SpringApplication.run(SpringBootApplication.class, args); - } - - @Bean - public ExecutorService executorService() { - return Executors.newFixedThreadPool(10); - } - - @Bean - public HelloWorldServlet helloWorldServlet() { - return new HelloWorldServlet(); - } - - @Bean - public SpringHelloServletRegistrationBean servletRegistrationBean() { - SpringHelloServletRegistrationBean bean = new SpringHelloServletRegistrationBean(new SpringHelloWorldServlet(), "/springHelloWorld/*"); - bean.setLoadOnStartup(1); - bean.addInitParameter("message", "SpringHelloWorldServlet special message"); - return bean; - } - - @Bean - @Autowired - public ExecutorServiceExitCodeGenerator executorServiceExitCodeGenerator(ExecutorService executorService) { - return new ExecutorServiceExitCodeGenerator(executorService); - } - - public void shutDown(ExecutorServiceExitCodeGenerator executorServiceExitCodeGenerator) { - SpringApplication.exit(applicationContext, executorServiceExitCodeGenerator); - } - -} +package org.baeldung.main; + +import org.baeldung.boot.controller.servlet.HelloWorldServlet; +import org.baeldung.boot.controller.servlet.SpringHelloWorldServlet; +import org.baeldung.common.error.SpringHelloServletRegistrationBean; +import org.baeldung.common.resources.ExecutorServiceExitCodeGenerator; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +@RestController +@EnableAutoConfiguration +@ComponentScan({ "org.baeldung.common.error", "org.baeldung.common.error.controller", "org.baeldung.common.properties", "org.baeldung.common.resources", "org.baeldung.endpoints", "org.baeldung.service", "org.baeldung.monitor.jmx", "org.baeldung.boot.config" }) +public class SpringBootApplication { + + private static ApplicationContext applicationContext; + + @GetMapping("/") + String home() { + return "TADA!!! You are in Spring Boot Actuator test application."; + } + + public static void main(String[] args) { + applicationContext = SpringApplication.run(SpringBootApplication.class, args); + } + + @Bean + public ExecutorService executorService() { + return Executors.newFixedThreadPool(10); + } + + @Bean + public HelloWorldServlet helloWorldServlet() { + return new HelloWorldServlet(); + } + + @Bean + public SpringHelloServletRegistrationBean servletRegistrationBean() { + SpringHelloServletRegistrationBean bean = new SpringHelloServletRegistrationBean(new SpringHelloWorldServlet(), "/springHelloWorld/*"); + bean.setLoadOnStartup(1); + bean.addInitParameter("message", "SpringHelloWorldServlet special message"); + return bean; + } + + @Bean + @Autowired + public ExecutorServiceExitCodeGenerator executorServiceExitCodeGenerator(ExecutorService executorService) { + return new ExecutorServiceExitCodeGenerator(executorService); + } + + public void shutDown(ExecutorServiceExitCodeGenerator executorServiceExitCodeGenerator) { + SpringApplication.exit(applicationContext, executorServiceExitCodeGenerator); + } + +} diff --git a/spring-boot/src/main/java/org/baeldung/model/User.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/model/User.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/model/User.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/model/User.java diff --git a/spring-boot/src/main/java/org/baeldung/repository/UserRepository.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/repository/UserRepository.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/repository/UserRepository.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/repository/UserRepository.java diff --git a/spring-boot/src/main/java/org/baeldung/session/exception/Application.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/session/exception/Application.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/session/exception/Application.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/session/exception/Application.java diff --git a/spring-boot/src/main/java/org/baeldung/session/exception/repository/FooRepository.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/session/exception/repository/FooRepository.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/session/exception/repository/FooRepository.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/session/exception/repository/FooRepository.java diff --git a/spring-boot/src/main/java/org/baeldung/session/exception/repository/FooRepositoryImpl.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/session/exception/repository/FooRepositoryImpl.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/session/exception/repository/FooRepositoryImpl.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/session/exception/repository/FooRepositoryImpl.java diff --git a/spring-boot/src/main/java/org/baeldung/startup/AppStartupRunner.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/startup/AppStartupRunner.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/startup/AppStartupRunner.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/startup/AppStartupRunner.java diff --git a/spring-boot/src/main/java/org/baeldung/startup/CommandLineAppStartupRunner.java b/spring-boot-modules/spring-boot/src/main/java/org/baeldung/startup/CommandLineAppStartupRunner.java similarity index 100% rename from spring-boot/src/main/java/org/baeldung/startup/CommandLineAppStartupRunner.java rename to spring-boot-modules/spring-boot/src/main/java/org/baeldung/startup/CommandLineAppStartupRunner.java diff --git a/spring-boot/src/main/resources/META-INF/spring.factories b/spring-boot-modules/spring-boot/src/main/resources/META-INF/spring.factories similarity index 100% rename from spring-boot/src/main/resources/META-INF/spring.factories rename to spring-boot-modules/spring-boot/src/main/resources/META-INF/spring.factories diff --git a/spring-boot/src/main/resources/application-errorhandling.properties b/spring-boot-modules/spring-boot/src/main/resources/application-errorhandling.properties similarity index 100% rename from spring-boot/src/main/resources/application-errorhandling.properties rename to spring-boot-modules/spring-boot/src/main/resources/application-errorhandling.properties diff --git a/spring-boot/src/main/resources/application.properties b/spring-boot-modules/spring-boot/src/main/resources/application.properties similarity index 96% rename from spring-boot/src/main/resources/application.properties rename to spring-boot-modules/spring-boot/src/main/resources/application.properties index 918fe5ea67..c322fb0573 100644 --- a/spring-boot/src/main/resources/application.properties +++ b/spring-boot-modules/spring-boot/src/main/resources/application.properties @@ -1,74 +1,74 @@ -server.port=9090 -server.servlet.contextPath=/springbootapp -management.server.port=8081 -management.server.address=127.0.0.1 -#debug=true -spring.jpa.show-sql=true -spring.jpa.hibernate.ddl-auto = update - -management.endpoints.jmx.domain=Spring Sample Application -spring.jmx.unique-names=true - -management.endpoints.web.exposure.include=* -management.endpoint.shutdown.enabled=true - -##jolokia.config.debug=true -##endpoints.jolokia.enabled=true -##endpoints.jolokia.path=jolokia - -spring.jmx.enabled=true - -## for pretty printing of json when endpoints accessed over HTTP -http.mappers.jsonPrettyPrint=true - -## Configuring info endpoint -info.app.name=Spring Sample Application -info.app.description=This is my first spring boot application G1 -info.app.version=1.0.0 -info.java-vendor = ${java.specification.vendor} - -logging.level.org.springframework=INFO - -#Servlet Configuration -servlet.name=dispatcherExample -servlet.mapping=/dispatcherExampleURL - -#spring.banner.charset=UTF-8 -#spring.banner.location=classpath:banner.txt -#spring.banner.image.location=classpath:banner.gif -#spring.banner.image.width= //TODO -#spring.banner.image.height= //TODO -#spring.banner.image.margin= //TODO -#spring.banner.image.invert= //TODO - -contactInfoType=email - -#chaos monkey for spring boot props -management.endpoint.chaosmonkey.enabled=true -management.endpoint.chaosmonkeyjmx.enabled=true - -spring.profiles.active=chaos-monkey -#Determine whether should execute or not -chaos.monkey.enabled=true -#How many requests are to be attacked. 1: attack each request; 5: each 5th request is attacked -chaos.monkey.assaults.level=1 -#Minimum latency in ms added to the request -chaos.monkey.assaults.latencyRangeStart=3000 -#Maximum latency in ms added to the request -chaos.monkey.assaults.latencyRangeEnd=15000 -#Latency assault active -chaos.monkey.assaults.latencyActive=true -#Exception assault active -chaos.monkey.assaults.exceptionsActive=false -#AppKiller assault active -chaos.monkey.assaults.killApplicationActive=false -#Controller watcher active -chaos.monkey.watcher.controller=false -#RestController watcher active -chaos.monkey.watcher.restController=false -#Service watcher active -chaos.monkey.watcher.service=true -#Repository watcher active -chaos.monkey.watcher.repository=false -#Component watcher active -chaos.monkey.watcher.component=false +server.port=9090 +server.servlet.contextPath=/springbootapp +management.server.port=8081 +management.server.address=127.0.0.1 +#debug=true +spring.jpa.show-sql=true +spring.jpa.hibernate.ddl-auto = update + +management.endpoints.jmx.domain=Spring Sample Application +spring.jmx.unique-names=true + +management.endpoints.web.exposure.include=* +management.endpoint.shutdown.enabled=true + +##jolokia.config.debug=true +##endpoints.jolokia.enabled=true +##endpoints.jolokia.path=jolokia + +spring.jmx.enabled=true + +## for pretty printing of json when endpoints accessed over HTTP +http.mappers.jsonPrettyPrint=true + +## Configuring info endpoint +info.app.name=Spring Sample Application +info.app.description=This is my first spring boot application G1 +info.app.version=1.0.0 +info.java-vendor = ${java.specification.vendor} + +logging.level.org.springframework=INFO + +#Servlet Configuration +servlet.name=dispatcherExample +servlet.mapping=/dispatcherExampleURL + +#spring.banner.charset=UTF-8 +#spring.banner.location=classpath:banner.txt +#spring.banner.image.location=classpath:banner.gif +#spring.banner.image.width= //TODO +#spring.banner.image.height= //TODO +#spring.banner.image.margin= //TODO +#spring.banner.image.invert= //TODO + +contactInfoType=email + +#chaos monkey for spring boot props +management.endpoint.chaosmonkey.enabled=true +management.endpoint.chaosmonkeyjmx.enabled=true + +spring.profiles.active=chaos-monkey +#Determine whether should execute or not +chaos.monkey.enabled=true +#How many requests are to be attacked. 1: attack each request; 5: each 5th request is attacked +chaos.monkey.assaults.level=1 +#Minimum latency in ms added to the request +chaos.monkey.assaults.latencyRangeStart=3000 +#Maximum latency in ms added to the request +chaos.monkey.assaults.latencyRangeEnd=15000 +#Latency assault active +chaos.monkey.assaults.latencyActive=true +#Exception assault active +chaos.monkey.assaults.exceptionsActive=false +#AppKiller assault active +chaos.monkey.assaults.killApplicationActive=false +#Controller watcher active +chaos.monkey.watcher.controller=false +#RestController watcher active +chaos.monkey.watcher.restController=false +#Service watcher active +chaos.monkey.watcher.service=true +#Repository watcher active +chaos.monkey.watcher.repository=false +#Component watcher active +chaos.monkey.watcher.component=false diff --git a/spring-boot/src/main/resources/banner.txt b/spring-boot-modules/spring-boot/src/main/resources/banner.txt similarity index 100% rename from spring-boot/src/main/resources/banner.txt rename to spring-boot-modules/spring-boot/src/main/resources/banner.txt diff --git a/spring-boot/src/main/resources/build.properties b/spring-boot-modules/spring-boot/src/main/resources/build.properties similarity index 100% rename from spring-boot/src/main/resources/build.properties rename to spring-boot-modules/spring-boot/src/main/resources/build.properties diff --git a/spring-boot/src/main/resources/build.yml b/spring-boot-modules/spring-boot/src/main/resources/build.yml similarity index 100% rename from spring-boot/src/main/resources/build.yml rename to spring-boot-modules/spring-boot/src/main/resources/build.yml diff --git a/spring-boot/src/main/resources/custom.properties b/spring-boot-modules/spring-boot/src/main/resources/custom.properties similarity index 100% rename from spring-boot/src/main/resources/custom.properties rename to spring-boot-modules/spring-boot/src/main/resources/custom.properties diff --git a/spring-boot/src/main/resources/data-expressions.sql b/spring-boot-modules/spring-boot/src/main/resources/data-expressions.sql similarity index 100% rename from spring-boot/src/main/resources/data-expressions.sql rename to spring-boot-modules/spring-boot/src/main/resources/data-expressions.sql diff --git a/spring-boot/src/main/resources/data.sql b/spring-boot-modules/spring-boot/src/main/resources/data.sql similarity index 100% rename from spring-boot/src/main/resources/data.sql rename to spring-boot-modules/spring-boot/src/main/resources/data.sql diff --git a/spring-boot/src/main/resources/demo.properties b/spring-boot-modules/spring-boot/src/main/resources/demo.properties similarity index 100% rename from spring-boot/src/main/resources/demo.properties rename to spring-boot-modules/spring-boot/src/main/resources/demo.properties diff --git a/spring-boot/src/main/resources/graphql/blog.graphqls b/spring-boot-modules/spring-boot/src/main/resources/graphql/blog.graphqls similarity index 100% rename from spring-boot/src/main/resources/graphql/blog.graphqls rename to spring-boot-modules/spring-boot/src/main/resources/graphql/blog.graphqls diff --git a/spring-boot/src/main/resources/logback.xml b/spring-boot-modules/spring-boot/src/main/resources/logback.xml similarity index 100% rename from spring-boot/src/main/resources/logback.xml rename to spring-boot-modules/spring-boot/src/main/resources/logback.xml diff --git a/spring-boot/src/main/resources/messages.properties b/spring-boot-modules/spring-boot/src/main/resources/messages.properties similarity index 100% rename from spring-boot/src/main/resources/messages.properties rename to spring-boot-modules/spring-boot/src/main/resources/messages.properties diff --git a/spring-boot/src/main/resources/messages_fr.properties b/spring-boot-modules/spring-boot/src/main/resources/messages_fr.properties similarity index 100% rename from spring-boot/src/main/resources/messages_fr.properties rename to spring-boot-modules/spring-boot/src/main/resources/messages_fr.properties diff --git a/spring-boot/src/main/resources/persistence-generic-entity.properties b/spring-boot-modules/spring-boot/src/main/resources/persistence-generic-entity.properties similarity index 100% rename from spring-boot/src/main/resources/persistence-generic-entity.properties rename to spring-boot-modules/spring-boot/src/main/resources/persistence-generic-entity.properties diff --git a/spring-boot/src/main/resources/templates/error/404.html b/spring-boot-modules/spring-boot/src/main/resources/public/error/404.html similarity index 100% rename from spring-boot/src/main/resources/templates/error/404.html rename to spring-boot-modules/spring-boot/src/main/resources/public/error/404.html diff --git a/spring-boot/src/main/resources/schema-expressions.sql b/spring-boot-modules/spring-boot/src/main/resources/schema-expressions.sql similarity index 100% rename from spring-boot/src/main/resources/schema-expressions.sql rename to spring-boot-modules/spring-boot/src/main/resources/schema-expressions.sql diff --git a/spring-boot/src/main/resources/schema.sql b/spring-boot-modules/spring-boot/src/main/resources/schema.sql similarity index 100% rename from spring-boot/src/main/resources/schema.sql rename to spring-boot-modules/spring-boot/src/main/resources/schema.sql diff --git a/spring-boot/src/main/resources/shutdown/shutdown.bat b/spring-boot-modules/spring-boot/src/main/resources/shutdown/shutdown.bat similarity index 100% rename from spring-boot/src/main/resources/shutdown/shutdown.bat rename to spring-boot-modules/spring-boot/src/main/resources/shutdown/shutdown.bat diff --git a/spring-boot/src/main/resources/static/internationalization.js b/spring-boot-modules/spring-boot/src/main/resources/static/internationalization.js similarity index 100% rename from spring-boot/src/main/resources/static/internationalization.js rename to spring-boot-modules/spring-boot/src/main/resources/static/internationalization.js diff --git a/spring-boot/src/main/resources/templates/customer.html b/spring-boot-modules/spring-boot/src/main/resources/templates/customer.html similarity index 100% rename from spring-boot/src/main/resources/templates/customer.html rename to spring-boot-modules/spring-boot/src/main/resources/templates/customer.html diff --git a/spring-boot/src/main/resources/templates/customers.html b/spring-boot-modules/spring-boot/src/main/resources/templates/customers.html similarity index 100% rename from spring-boot/src/main/resources/templates/customers.html rename to spring-boot-modules/spring-boot/src/main/resources/templates/customers.html diff --git a/spring-boot/src/main/resources/templates/displayallbeans.html b/spring-boot-modules/spring-boot/src/main/resources/templates/displayallbeans.html similarity index 100% rename from spring-boot/src/main/resources/templates/displayallbeans.html rename to spring-boot-modules/spring-boot/src/main/resources/templates/displayallbeans.html diff --git a/spring-boot/src/main/resources/templates/error-404.html b/spring-boot-modules/spring-boot/src/main/resources/templates/error-404.html similarity index 100% rename from spring-boot/src/main/resources/templates/error-404.html rename to spring-boot-modules/spring-boot/src/main/resources/templates/error-404.html diff --git a/spring-boot/src/main/resources/templates/error-500.html b/spring-boot-modules/spring-boot/src/main/resources/templates/error-500.html similarity index 100% rename from spring-boot/src/main/resources/templates/error-500.html rename to spring-boot-modules/spring-boot/src/main/resources/templates/error-500.html diff --git a/spring-boot/src/main/resources/templates/error.html b/spring-boot-modules/spring-boot/src/main/resources/templates/error.html similarity index 100% rename from spring-boot/src/main/resources/templates/error.html rename to spring-boot-modules/spring-boot/src/main/resources/templates/error.html diff --git a/spring-boot/src/main/resources/public/error/404.html b/spring-boot-modules/spring-boot/src/main/resources/templates/error/404.html similarity index 94% rename from spring-boot/src/main/resources/public/error/404.html rename to spring-boot-modules/spring-boot/src/main/resources/templates/error/404.html index 02d6092bee..df83ce219b 100644 --- a/spring-boot/src/main/resources/public/error/404.html +++ b/spring-boot-modules/spring-boot/src/main/resources/templates/error/404.html @@ -1,8 +1,8 @@ - - - RESOURCE NOT FOUND - - -

404 RESOURCE NOT FOUND

- + + + RESOURCE NOT FOUND + + +

404 RESOURCE NOT FOUND

+ \ No newline at end of file diff --git a/spring-boot/src/main/resources/templates/external.html b/spring-boot-modules/spring-boot/src/main/resources/templates/external.html similarity index 100% rename from spring-boot/src/main/resources/templates/external.html rename to spring-boot-modules/spring-boot/src/main/resources/templates/external.html diff --git a/spring-boot/src/main/resources/templates/index.html b/spring-boot-modules/spring-boot/src/main/resources/templates/index.html similarity index 100% rename from spring-boot/src/main/resources/templates/index.html rename to spring-boot-modules/spring-boot/src/main/resources/templates/index.html diff --git a/spring-boot/src/main/resources/templates/international.html b/spring-boot-modules/spring-boot/src/main/resources/templates/international.html similarity index 100% rename from spring-boot/src/main/resources/templates/international.html rename to spring-boot-modules/spring-boot/src/main/resources/templates/international.html diff --git a/spring-boot/src/main/resources/templates/layout.html b/spring-boot-modules/spring-boot/src/main/resources/templates/layout.html similarity index 100% rename from spring-boot/src/main/resources/templates/layout.html rename to spring-boot-modules/spring-boot/src/main/resources/templates/layout.html diff --git a/spring-boot/src/main/resources/templates/other.html b/spring-boot-modules/spring-boot/src/main/resources/templates/other.html similarity index 100% rename from spring-boot/src/main/resources/templates/other.html rename to spring-boot-modules/spring-boot/src/main/resources/templates/other.html diff --git a/spring-boot/src/main/resources/templates/utils.html b/spring-boot-modules/spring-boot/src/main/resources/templates/utils.html similarity index 100% rename from spring-boot/src/main/resources/templates/utils.html rename to spring-boot-modules/spring-boot/src/main/resources/templates/utils.html diff --git a/spring-boot/src/main/webapp/WEB-INF/context.xml b/spring-boot-modules/spring-boot/src/main/webapp/WEB-INF/context.xml similarity index 100% rename from spring-boot/src/main/webapp/WEB-INF/context.xml rename to spring-boot-modules/spring-boot/src/main/webapp/WEB-INF/context.xml diff --git a/spring-boot/src/main/webapp/WEB-INF/dispatcher.xml b/spring-boot-modules/spring-boot/src/main/webapp/WEB-INF/dispatcher.xml similarity index 100% rename from spring-boot/src/main/webapp/WEB-INF/dispatcher.xml rename to spring-boot-modules/spring-boot/src/main/webapp/WEB-INF/dispatcher.xml diff --git a/spring-boot/src/main/webapp/WEB-INF/web.xml b/spring-boot-modules/spring-boot/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from spring-boot/src/main/webapp/WEB-INF/web.xml rename to spring-boot-modules/spring-boot/src/main/webapp/WEB-INF/web.xml diff --git a/spring-boot/src/main/webapp/annotationservlet.jsp b/spring-boot-modules/spring-boot/src/main/webapp/annotationservlet.jsp similarity index 100% rename from spring-boot/src/main/webapp/annotationservlet.jsp rename to spring-boot-modules/spring-boot/src/main/webapp/annotationservlet.jsp diff --git a/spring-boot/src/main/webapp/index.jsp b/spring-boot-modules/spring-boot/src/main/webapp/index.jsp similarity index 100% rename from spring-boot/src/main/webapp/index.jsp rename to spring-boot-modules/spring-boot/src/main/webapp/index.jsp diff --git a/spring-boot/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithServletComponentIntegrationTest.java b/spring-boot-modules/spring-boot/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithServletComponentIntegrationTest.java similarity index 100% rename from spring-boot/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithServletComponentIntegrationTest.java rename to spring-boot-modules/spring-boot/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithServletComponentIntegrationTest.java diff --git a/spring-boot/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithoutServletComponentIntegrationTest.java b/spring-boot-modules/spring-boot/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithoutServletComponentIntegrationTest.java similarity index 100% rename from spring-boot/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithoutServletComponentIntegrationTest.java rename to spring-boot-modules/spring-boot/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithoutServletComponentIntegrationTest.java diff --git a/spring-boot/src/test/java/com/baeldung/beanvalidation/application/UserControllerIntegrationTest.java b/spring-boot-modules/spring-boot/src/test/java/com/baeldung/beanvalidation/application/UserControllerIntegrationTest.java similarity index 88% rename from spring-boot/src/test/java/com/baeldung/beanvalidation/application/UserControllerIntegrationTest.java rename to spring-boot-modules/spring-boot/src/test/java/com/baeldung/beanvalidation/application/UserControllerIntegrationTest.java index 07d9b0807e..21fcaf922c 100644 --- a/spring-boot/src/test/java/com/baeldung/beanvalidation/application/UserControllerIntegrationTest.java +++ b/spring-boot-modules/spring-boot/src/test/java/com/baeldung/beanvalidation/application/UserControllerIntegrationTest.java @@ -1,70 +1,71 @@ -package com.baeldung.beanvalidation.application; - -import com.baeldung.beanvalidation.application.controllers.UserController; -import com.baeldung.beanvalidation.application.repositories.UserRepository; - -import java.nio.charset.Charset; -import static org.assertj.core.api.Assertions.assertThat; -import org.hamcrest.core.Is; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.http.MediaType; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; -import org.springframework.test.web.servlet.result.MockMvcResultMatchers; - -@RunWith(SpringRunner.class) -@WebMvcTest -@AutoConfigureMockMvc -public class UserControllerIntegrationTest { - - @MockBean - private UserRepository userRepository; - - @Autowired - UserController userController; - - @Autowired - private MockMvc mockMvc; - - @Test - public void whenUserControllerInjected_thenNotNull() throws Exception { - assertThat(userController).isNotNull(); - } - - @Test - public void whenGetRequestToUsers_thenCorrectResponse() throws Exception { - mockMvc.perform(MockMvcRequestBuilders.get("/users") - .contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(MockMvcResultMatchers.status().isOk()) - .andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON_UTF8)); - - } - - @Test - public void whenPostRequestToUsersAndValidUser_thenCorrectResponse() throws Exception { - MediaType textPlainUtf8 = new MediaType(MediaType.TEXT_PLAIN, Charset.forName("UTF-8")); - String user = "{\"name\": \"bob\", \"email\" : \"bob@domain.com\"}"; - mockMvc.perform(MockMvcRequestBuilders.post("/users") - .content(user) - .contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(MockMvcResultMatchers.status().isOk()) - .andExpect(MockMvcResultMatchers.content().contentType(textPlainUtf8)); - } - - @Test - public void whenPostRequestToUsersAndInValidUser_thenCorrectReponse() throws Exception { - String user = "{\"name\": \"\", \"email\" : \"bob@domain.com\"}"; - mockMvc.perform(MockMvcRequestBuilders.post("/users") - .content(user) - .contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(MockMvcResultMatchers.status().isBadRequest()) - .andExpect(MockMvcResultMatchers.jsonPath("$.name", Is.is("Name is mandatory"))) - .andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON_UTF8)); - } -} +package com.baeldung.beanvalidation.application; + +import com.baeldung.beanvalidation.application.controllers.UserController; +import com.baeldung.beanvalidation.application.repositories.UserRepository; +import org.hamcrest.core.Is; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.http.MediaType; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; +import org.springframework.test.web.servlet.result.MockMvcResultMatchers; + +import java.nio.charset.Charset; + +import static org.assertj.core.api.Assertions.assertThat; + +@RunWith(SpringRunner.class) +@WebMvcTest +@AutoConfigureMockMvc +public class UserControllerIntegrationTest { + + @MockBean + private UserRepository userRepository; + + @Autowired + UserController userController; + + @Autowired + private MockMvc mockMvc; + + @Test + public void whenUserControllerInjected_thenNotNull() throws Exception { + assertThat(userController).isNotNull(); + } + + @Test + public void whenGetRequestToUsers_thenCorrectResponse() throws Exception { + mockMvc.perform(MockMvcRequestBuilders.get("/users") + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(MockMvcResultMatchers.status().isOk()) + .andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON)); + + } + + @Test + public void whenPostRequestToUsersAndValidUser_thenCorrectResponse() throws Exception { + MediaType textPlainUtf8 = new MediaType(MediaType.TEXT_PLAIN, Charset.forName("UTF-8")); + String user = "{\"name\": \"bob\", \"email\" : \"bob@domain.com\"}"; + mockMvc.perform(MockMvcRequestBuilders.post("/users") + .content(user) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(MockMvcResultMatchers.status().isOk()) + .andExpect(MockMvcResultMatchers.content().contentType(textPlainUtf8)); + } + + @Test + public void whenPostRequestToUsersAndInValidUser_thenCorrectReponse() throws Exception { + String user = "{\"name\": \"\", \"email\" : \"bob@domain.com\"}"; + mockMvc.perform(MockMvcRequestBuilders.post("/users") + .content(user) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(MockMvcResultMatchers.status().isBadRequest()) + .andExpect(MockMvcResultMatchers.jsonPath("$.name", Is.is("Name is mandatory"))) + .andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON)); + } +} diff --git a/spring-boot/src/test/java/com/baeldung/buildproperties/BuildInfoServiceIntegrationTest.java b/spring-boot-modules/spring-boot/src/test/java/com/baeldung/buildproperties/BuildInfoServiceIntegrationTest.java similarity index 100% rename from spring-boot/src/test/java/com/baeldung/buildproperties/BuildInfoServiceIntegrationTest.java rename to spring-boot-modules/spring-boot/src/test/java/com/baeldung/buildproperties/BuildInfoServiceIntegrationTest.java diff --git a/spring-boot/src/test/java/com/baeldung/displayallbeans/DisplayBeanIntegrationTest.java b/spring-boot-modules/spring-boot/src/test/java/com/baeldung/displayallbeans/DisplayBeanIntegrationTest.java similarity index 97% rename from spring-boot/src/test/java/com/baeldung/displayallbeans/DisplayBeanIntegrationTest.java rename to spring-boot-modules/spring-boot/src/test/java/com/baeldung/displayallbeans/DisplayBeanIntegrationTest.java index e933920a96..f08a755fc7 100644 --- a/spring-boot/src/test/java/com/baeldung/displayallbeans/DisplayBeanIntegrationTest.java +++ b/spring-boot-modules/spring-boot/src/test/java/com/baeldung/displayallbeans/DisplayBeanIntegrationTest.java @@ -1,101 +1,101 @@ -package com.baeldung.displayallbeans; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.BDDAssertions.then; - -import java.net.URI; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.Map; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.actuate.beans.BeansEndpoint.ContextBeans; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.boot.web.server.LocalServerPort; -import org.springframework.core.ParameterizedTypeReference; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.RequestEntity; -import org.springframework.http.ResponseEntity; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.web.context.WebApplicationContext; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = Application.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -@TestPropertySource(properties = { "management.port=0", "management.endpoints.web.exposure.include=*" }) -public class DisplayBeanIntegrationTest { - - @LocalServerPort - private int port; - - @Value("${local.management.port}") - private int mgt; - - @Autowired - private TestRestTemplate testRestTemplate; - - @Autowired - private WebApplicationContext context; - - private static final String ACTUATOR_PATH = "/actuator"; - - @Test - public void givenRestTemplate_whenAccessServerUrl_thenHttpStatusOK() throws Exception { - ResponseEntity entity = this.testRestTemplate.getForEntity("http://localhost:" + this.port + "/displayallbeans", String.class); - - then(entity.getStatusCode()).isEqualTo(HttpStatus.OK); - } - - @Test - public void givenRestTemplate_whenAccessEndpointUrl_thenHttpStatusOK() throws Exception { - ParameterizedTypeReference> responseType = new ParameterizedTypeReference>() { - }; - RequestEntity requestEntity = RequestEntity.get(new URI("http://localhost:" + this.mgt + ACTUATOR_PATH + "/beans")) - .accept(MediaType.APPLICATION_JSON) - .build(); - ResponseEntity> entity = this.testRestTemplate.exchange(requestEntity, responseType); - - then(entity.getStatusCode()).isEqualTo(HttpStatus.OK); - } - - @Test - public void givenRestTemplate_whenAccessEndpointUrl_thenReturnsBeanNames() throws Exception { - RequestEntity requestEntity = RequestEntity.get(new URI("http://localhost:" + this.mgt + ACTUATOR_PATH + "/beans")) - .accept(MediaType.APPLICATION_JSON) - .build(); - ResponseEntity entity = this.testRestTemplate.exchange(requestEntity, BeanActuatorResponse.class); - - Collection beanNamesList = entity.getBody() - .getBeans(); - - assertThat(beanNamesList).contains("fooController", "fooService"); - } - - @Test - public void givenWebApplicationContext_whenAccessGetBeanDefinitionNames_thenReturnsBeanNames() throws Exception { - String[] beanNames = context.getBeanDefinitionNames(); - - List beanNamesList = Arrays.asList(beanNames); - assertThat(beanNamesList).contains("fooController", "fooService"); - } - - private static class BeanActuatorResponse { - private Map>>> contexts; - - public Collection getBeans() { - return this.contexts.get("application") - .get("beans") - .keySet(); - } - - public Map>>> getContexts() { - return contexts; - } - } -} +package com.baeldung.displayallbeans; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.BDDAssertions.then; + +import java.net.URI; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Map; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.actuate.beans.BeansEndpoint.ContextBeans; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.web.client.TestRestTemplate; +import org.springframework.boot.web.server.LocalServerPort; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.RequestEntity; +import org.springframework.http.ResponseEntity; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.web.context.WebApplicationContext; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = Application.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@TestPropertySource(properties = { "management.port=0", "management.endpoints.web.exposure.include=*" }) +public class DisplayBeanIntegrationTest { + + @LocalServerPort + private int port; + + @Value("${local.management.port}") + private int mgt; + + @Autowired + private TestRestTemplate testRestTemplate; + + @Autowired + private WebApplicationContext context; + + private static final String ACTUATOR_PATH = "/actuator"; + + @Test + public void givenRestTemplate_whenAccessServerUrl_thenHttpStatusOK() throws Exception { + ResponseEntity entity = this.testRestTemplate.getForEntity("http://localhost:" + this.port + "/displayallbeans", String.class); + + then(entity.getStatusCode()).isEqualTo(HttpStatus.OK); + } + + @Test + public void givenRestTemplate_whenAccessEndpointUrl_thenHttpStatusOK() throws Exception { + ParameterizedTypeReference> responseType = new ParameterizedTypeReference>() { + }; + RequestEntity requestEntity = RequestEntity.get(new URI("http://localhost:" + this.mgt + ACTUATOR_PATH + "/beans")) + .accept(MediaType.APPLICATION_JSON) + .build(); + ResponseEntity> entity = this.testRestTemplate.exchange(requestEntity, responseType); + + then(entity.getStatusCode()).isEqualTo(HttpStatus.OK); + } + + @Test + public void givenRestTemplate_whenAccessEndpointUrl_thenReturnsBeanNames() throws Exception { + RequestEntity requestEntity = RequestEntity.get(new URI("http://localhost:" + this.mgt + ACTUATOR_PATH + "/beans")) + .accept(MediaType.APPLICATION_JSON) + .build(); + ResponseEntity entity = this.testRestTemplate.exchange(requestEntity, BeanActuatorResponse.class); + + Collection beanNamesList = entity.getBody() + .getBeans(); + + assertThat(beanNamesList).contains("fooController", "fooService"); + } + + @Test + public void givenWebApplicationContext_whenAccessGetBeanDefinitionNames_thenReturnsBeanNames() throws Exception { + String[] beanNames = context.getBeanDefinitionNames(); + + List beanNamesList = Arrays.asList(beanNames); + assertThat(beanNamesList).contains("fooController", "fooService"); + } + + private static class BeanActuatorResponse { + private Map>>> contexts; + + public Collection getBeans() { + return this.contexts.get("application") + .get("beans") + .keySet(); + } + + public Map>>> getContexts() { + return contexts; + } + } +} diff --git a/spring-boot/src/test/java/com/baeldung/failureanalyzer/FailureAnalyzerAppIntegrationTest.java b/spring-boot-modules/spring-boot/src/test/java/com/baeldung/failureanalyzer/FailureAnalyzerAppIntegrationTest.java similarity index 100% rename from spring-boot/src/test/java/com/baeldung/failureanalyzer/FailureAnalyzerAppIntegrationTest.java rename to spring-boot-modules/spring-boot/src/test/java/com/baeldung/failureanalyzer/FailureAnalyzerAppIntegrationTest.java diff --git a/spring-boot/src/test/java/com/baeldung/failureanalyzer/utils/ListAppender.java b/spring-boot-modules/spring-boot/src/test/java/com/baeldung/failureanalyzer/utils/ListAppender.java similarity index 100% rename from spring-boot/src/test/java/com/baeldung/failureanalyzer/utils/ListAppender.java rename to spring-boot-modules/spring-boot/src/test/java/com/baeldung/failureanalyzer/utils/ListAppender.java diff --git a/spring-boot/src/test/java/com/baeldung/git/CommitIdIntegrationTest.java b/spring-boot-modules/spring-boot/src/test/java/com/baeldung/git/CommitIdIntegrationTest.java similarity index 100% rename from spring-boot/src/test/java/com/baeldung/git/CommitIdIntegrationTest.java rename to spring-boot-modules/spring-boot/src/test/java/com/baeldung/git/CommitIdIntegrationTest.java diff --git a/spring-boot/src/test/java/com/baeldung/intro/AppLiveTest.java b/spring-boot-modules/spring-boot/src/test/java/com/baeldung/intro/AppLiveTest.java similarity index 100% rename from spring-boot/src/test/java/com/baeldung/intro/AppLiveTest.java rename to spring-boot-modules/spring-boot/src/test/java/com/baeldung/intro/AppLiveTest.java diff --git a/spring-boot/src/test/java/com/baeldung/jsondateformat/ContactAppUnitTest.java b/spring-boot-modules/spring-boot/src/test/java/com/baeldung/jsondateformat/ContactAppUnitTest.java similarity index 100% rename from spring-boot/src/test/java/com/baeldung/jsondateformat/ContactAppUnitTest.java rename to spring-boot-modules/spring-boot/src/test/java/com/baeldung/jsondateformat/ContactAppUnitTest.java diff --git a/spring-boot/src/test/java/com/baeldung/jsondateformat/ContactAppWithObjectMapperCustomizerUnitTest.java b/spring-boot-modules/spring-boot/src/test/java/com/baeldung/jsondateformat/ContactAppWithObjectMapperCustomizerUnitTest.java similarity index 100% rename from spring-boot/src/test/java/com/baeldung/jsondateformat/ContactAppWithObjectMapperCustomizerUnitTest.java rename to spring-boot-modules/spring-boot/src/test/java/com/baeldung/jsondateformat/ContactAppWithObjectMapperCustomizerUnitTest.java diff --git a/spring-boot/src/test/java/com/baeldung/kong/KongAdminAPILiveTest.java b/spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/KongAdminAPILiveTest.java similarity index 100% rename from spring-boot/src/test/java/com/baeldung/kong/KongAdminAPILiveTest.java rename to spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/KongAdminAPILiveTest.java diff --git a/spring-boot/src/test/java/com/baeldung/kong/KongLoadBalanceLiveTest.java b/spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/KongLoadBalanceLiveTest.java similarity index 100% rename from spring-boot/src/test/java/com/baeldung/kong/KongLoadBalanceLiveTest.java rename to spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/KongLoadBalanceLiveTest.java diff --git a/spring-boot/src/test/java/com/baeldung/kong/domain/APIObject.java b/spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/domain/APIObject.java similarity index 100% rename from spring-boot/src/test/java/com/baeldung/kong/domain/APIObject.java rename to spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/domain/APIObject.java diff --git a/spring-boot/src/test/java/com/baeldung/kong/domain/ConsumerObject.java b/spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/domain/ConsumerObject.java similarity index 100% rename from spring-boot/src/test/java/com/baeldung/kong/domain/ConsumerObject.java rename to spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/domain/ConsumerObject.java diff --git a/spring-boot/src/test/java/com/baeldung/kong/domain/KeyAuthObject.java b/spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/domain/KeyAuthObject.java similarity index 100% rename from spring-boot/src/test/java/com/baeldung/kong/domain/KeyAuthObject.java rename to spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/domain/KeyAuthObject.java diff --git a/spring-boot/src/test/java/com/baeldung/kong/domain/PluginObject.java b/spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/domain/PluginObject.java similarity index 100% rename from spring-boot/src/test/java/com/baeldung/kong/domain/PluginObject.java rename to spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/domain/PluginObject.java diff --git a/spring-boot/src/test/java/com/baeldung/kong/domain/TargetObject.java b/spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/domain/TargetObject.java similarity index 100% rename from spring-boot/src/test/java/com/baeldung/kong/domain/TargetObject.java rename to spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/domain/TargetObject.java diff --git a/spring-boot/src/test/java/com/baeldung/kong/domain/UpstreamObject.java b/spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/domain/UpstreamObject.java similarity index 100% rename from spring-boot/src/test/java/com/baeldung/kong/domain/UpstreamObject.java rename to spring-boot-modules/spring-boot/src/test/java/com/baeldung/kong/domain/UpstreamObject.java diff --git a/spring-boot/src/test/java/com/baeldung/servletinitializer/WarInitializerApplicationIntegrationTest.java b/spring-boot-modules/spring-boot/src/test/java/com/baeldung/servletinitializer/WarInitializerApplicationIntegrationTest.java similarity index 100% rename from spring-boot/src/test/java/com/baeldung/servletinitializer/WarInitializerApplicationIntegrationTest.java rename to spring-boot-modules/spring-boot/src/test/java/com/baeldung/servletinitializer/WarInitializerApplicationIntegrationTest.java diff --git a/spring-boot/src/test/java/com/baeldung/toggle/ToggleIntegrationTest.java b/spring-boot-modules/spring-boot/src/test/java/com/baeldung/toggle/ToggleIntegrationTest.java similarity index 100% rename from spring-boot/src/test/java/com/baeldung/toggle/ToggleIntegrationTest.java rename to spring-boot-modules/spring-boot/src/test/java/com/baeldung/toggle/ToggleIntegrationTest.java diff --git a/spring-boot/src/test/java/com/baeldung/utils/UtilsControllerIntegrationTest.java b/spring-boot-modules/spring-boot/src/test/java/com/baeldung/utils/UtilsControllerIntegrationTest.java similarity index 100% rename from spring-boot/src/test/java/com/baeldung/utils/UtilsControllerIntegrationTest.java rename to spring-boot-modules/spring-boot/src/test/java/com/baeldung/utils/UtilsControllerIntegrationTest.java diff --git a/spring-boot/src/test/java/org/baeldung/boot/ApplicationIntegrationTest.java b/spring-boot-modules/spring-boot/src/test/java/org/baeldung/boot/ApplicationIntegrationTest.java similarity index 100% rename from spring-boot/src/test/java/org/baeldung/boot/ApplicationIntegrationTest.java rename to spring-boot-modules/spring-boot/src/test/java/org/baeldung/boot/ApplicationIntegrationTest.java diff --git a/spring-boot/src/test/java/org/baeldung/boot/DemoApplicationIntegrationTest.java b/spring-boot-modules/spring-boot/src/test/java/org/baeldung/boot/DemoApplicationIntegrationTest.java similarity index 100% rename from spring-boot/src/test/java/org/baeldung/boot/DemoApplicationIntegrationTest.java rename to spring-boot-modules/spring-boot/src/test/java/org/baeldung/boot/DemoApplicationIntegrationTest.java diff --git a/spring-boot/src/test/java/org/baeldung/boot/jsoncomponent/UserJsonDeserializerIntegrationTest.java b/spring-boot-modules/spring-boot/src/test/java/org/baeldung/boot/jsoncomponent/UserJsonDeserializerIntegrationTest.java similarity index 100% rename from spring-boot/src/test/java/org/baeldung/boot/jsoncomponent/UserJsonDeserializerIntegrationTest.java rename to spring-boot-modules/spring-boot/src/test/java/org/baeldung/boot/jsoncomponent/UserJsonDeserializerIntegrationTest.java diff --git a/spring-boot/src/test/java/org/baeldung/boot/jsoncomponent/UserJsonSerializerIntegrationTest.java b/spring-boot-modules/spring-boot/src/test/java/org/baeldung/boot/jsoncomponent/UserJsonSerializerIntegrationTest.java similarity index 100% rename from spring-boot/src/test/java/org/baeldung/boot/jsoncomponent/UserJsonSerializerIntegrationTest.java rename to spring-boot-modules/spring-boot/src/test/java/org/baeldung/boot/jsoncomponent/UserJsonSerializerIntegrationTest.java diff --git a/spring-boot/src/test/java/org/baeldung/boot/repository/FooRepositoryIntegrationTest.java b/spring-boot-modules/spring-boot/src/test/java/org/baeldung/boot/repository/FooRepositoryIntegrationTest.java similarity index 100% rename from spring-boot/src/test/java/org/baeldung/boot/repository/FooRepositoryIntegrationTest.java rename to spring-boot-modules/spring-boot/src/test/java/org/baeldung/boot/repository/FooRepositoryIntegrationTest.java diff --git a/spring-boot/src/test/java/org/baeldung/boot/repository/HibernateSessionIntegrationTest.java b/spring-boot-modules/spring-boot/src/test/java/org/baeldung/boot/repository/HibernateSessionIntegrationTest.java similarity index 100% rename from spring-boot/src/test/java/org/baeldung/boot/repository/HibernateSessionIntegrationTest.java rename to spring-boot-modules/spring-boot/src/test/java/org/baeldung/boot/repository/HibernateSessionIntegrationTest.java diff --git a/spring-boot/src/test/java/org/baeldung/boot/repository/NoHibernateSessionIntegrationTest.java b/spring-boot-modules/spring-boot/src/test/java/org/baeldung/boot/repository/NoHibernateSessionIntegrationTest.java similarity index 100% rename from spring-boot/src/test/java/org/baeldung/boot/repository/NoHibernateSessionIntegrationTest.java rename to spring-boot-modules/spring-boot/src/test/java/org/baeldung/boot/repository/NoHibernateSessionIntegrationTest.java diff --git a/spring-boot/src/test/java/org/baeldung/converter/CustomConverterIntegrationTest.java b/spring-boot-modules/spring-boot/src/test/java/org/baeldung/converter/CustomConverterIntegrationTest.java similarity index 100% rename from spring-boot/src/test/java/org/baeldung/converter/CustomConverterIntegrationTest.java rename to spring-boot-modules/spring-boot/src/test/java/org/baeldung/converter/CustomConverterIntegrationTest.java diff --git a/spring-boot/src/test/java/org/baeldung/converter/controller/StringToEmployeeConverterControllerIntegrationTest.java b/spring-boot-modules/spring-boot/src/test/java/org/baeldung/converter/controller/StringToEmployeeConverterControllerIntegrationTest.java similarity index 100% rename from spring-boot/src/test/java/org/baeldung/converter/controller/StringToEmployeeConverterControllerIntegrationTest.java rename to spring-boot-modules/spring-boot/src/test/java/org/baeldung/converter/controller/StringToEmployeeConverterControllerIntegrationTest.java diff --git a/spring-boot/src/test/java/org/baeldung/demo/boottest/EmployeeControllerIntegrationTest.java b/spring-boot-modules/spring-boot/src/test/java/org/baeldung/demo/boottest/EmployeeControllerIntegrationTest.java similarity index 100% rename from spring-boot/src/test/java/org/baeldung/demo/boottest/EmployeeControllerIntegrationTest.java rename to spring-boot-modules/spring-boot/src/test/java/org/baeldung/demo/boottest/EmployeeControllerIntegrationTest.java diff --git a/spring-boot/src/test/java/org/baeldung/demo/boottest/EmployeeRepositoryIntegrationTest.java b/spring-boot-modules/spring-boot/src/test/java/org/baeldung/demo/boottest/EmployeeRepositoryIntegrationTest.java similarity index 100% rename from spring-boot/src/test/java/org/baeldung/demo/boottest/EmployeeRepositoryIntegrationTest.java rename to spring-boot-modules/spring-boot/src/test/java/org/baeldung/demo/boottest/EmployeeRepositoryIntegrationTest.java diff --git a/spring-boot/src/test/java/org/baeldung/demo/boottest/EmployeeRestControllerIntegrationTest.java b/spring-boot-modules/spring-boot/src/test/java/org/baeldung/demo/boottest/EmployeeRestControllerIntegrationTest.java similarity index 100% rename from spring-boot/src/test/java/org/baeldung/demo/boottest/EmployeeRestControllerIntegrationTest.java rename to spring-boot-modules/spring-boot/src/test/java/org/baeldung/demo/boottest/EmployeeRestControllerIntegrationTest.java diff --git a/spring-boot/src/test/java/org/baeldung/demo/boottest/EmployeeServiceImplIntegrationTest.java b/spring-boot-modules/spring-boot/src/test/java/org/baeldung/demo/boottest/EmployeeServiceImplIntegrationTest.java similarity index 100% rename from spring-boot/src/test/java/org/baeldung/demo/boottest/EmployeeServiceImplIntegrationTest.java rename to spring-boot-modules/spring-boot/src/test/java/org/baeldung/demo/boottest/EmployeeServiceImplIntegrationTest.java diff --git a/spring-boot/src/test/java/org/baeldung/demo/boottest/JsonUtil.java b/spring-boot-modules/spring-boot/src/test/java/org/baeldung/demo/boottest/JsonUtil.java similarity index 100% rename from spring-boot/src/test/java/org/baeldung/demo/boottest/JsonUtil.java rename to spring-boot-modules/spring-boot/src/test/java/org/baeldung/demo/boottest/JsonUtil.java diff --git a/spring-boot/src/test/java/org/baeldung/repository/UserRepositoryIntegrationTest.java b/spring-boot-modules/spring-boot/src/test/java/org/baeldung/repository/UserRepositoryIntegrationTest.java similarity index 100% rename from spring-boot/src/test/java/org/baeldung/repository/UserRepositoryIntegrationTest.java rename to spring-boot-modules/spring-boot/src/test/java/org/baeldung/repository/UserRepositoryIntegrationTest.java diff --git a/spring-boot/src/test/resources/application-integrationtest.properties b/spring-boot-modules/spring-boot/src/test/resources/application-integrationtest.properties similarity index 100% rename from spring-boot/src/test/resources/application-integrationtest.properties rename to spring-boot-modules/spring-boot/src/test/resources/application-integrationtest.properties diff --git a/spring-boot/src/test/resources/application.properties b/spring-boot-modules/spring-boot/src/test/resources/application.properties similarity index 100% rename from spring-boot/src/test/resources/application.properties rename to spring-boot-modules/spring-boot/src/test/resources/application.properties diff --git a/spring-boot/src/test/resources/conversion.properties b/spring-boot-modules/spring-boot/src/test/resources/conversion.properties similarity index 100% rename from spring-boot/src/test/resources/conversion.properties rename to spring-boot-modules/spring-boot/src/test/resources/conversion.properties diff --git a/spring-boot/src/test/resources/exception-hibernate.properties b/spring-boot-modules/spring-boot/src/test/resources/exception-hibernate.properties similarity index 100% rename from spring-boot/src/test/resources/exception-hibernate.properties rename to spring-boot-modules/spring-boot/src/test/resources/exception-hibernate.properties diff --git a/spring-boot/src/test/resources/exception.properties b/spring-boot-modules/spring-boot/src/test/resources/exception.properties similarity index 100% rename from spring-boot/src/test/resources/exception.properties rename to spring-boot-modules/spring-boot/src/test/resources/exception.properties diff --git a/spring-boot/src/test/resources/import.sql b/spring-boot-modules/spring-boot/src/test/resources/import.sql similarity index 100% rename from spring-boot/src/test/resources/import.sql rename to spring-boot-modules/spring-boot/src/test/resources/import.sql diff --git a/spring-boot/src/test/resources/logback-test.xml b/spring-boot-modules/spring-boot/src/test/resources/logback-test.xml similarity index 100% rename from spring-boot/src/test/resources/logback-test.xml rename to spring-boot-modules/spring-boot/src/test/resources/logback-test.xml diff --git a/spring-boot/src/test/resources/org/baeldung/boot/expected.json b/spring-boot-modules/spring-boot/src/test/resources/org/baeldung/boot/expected.json similarity index 100% rename from spring-boot/src/test/resources/org/baeldung/boot/expected.json rename to spring-boot-modules/spring-boot/src/test/resources/org/baeldung/boot/expected.json diff --git a/spring-boot-parent/spring-boot-with-custom-parent/pom.xml b/spring-boot-parent/spring-boot-with-custom-parent/pom.xml index 8a55f252d6..1eb4255c7e 100644 --- a/spring-boot-parent/spring-boot-with-custom-parent/pom.xml +++ b/spring-boot-parent/spring-boot-with-custom-parent/pom.xml @@ -11,6 +11,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT + ../../parent-boot-2 diff --git a/spring-boot-parent/spring-boot-with-starter-parent/pom.xml b/spring-boot-parent/spring-boot-with-starter-parent/pom.xml index ed2cb8646c..05c61fc4cc 100644 --- a/spring-boot-parent/spring-boot-with-starter-parent/pom.xml +++ b/spring-boot-parent/spring-boot-with-starter-parent/pom.xml @@ -9,10 +9,10 @@ spring-boot-with-starter-parent - org.springframework.boot - spring-boot-starter-parent - 2.1.5.RELEASE - + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../../parent-boot-2 @@ -38,7 +38,7 @@ 1.8 - 2.1.1.RELEASE + 2.1.5.RELEASE 4.11 diff --git a/spring-boot-rest/README.md b/spring-boot-rest/README.md index 3909a99c65..f78c88d30b 100644 --- a/spring-boot-rest/README.md +++ b/spring-boot-rest/README.md @@ -10,7 +10,6 @@ This module contains articles about Spring Boot RESTful APIs. - [Testing REST with multiple MIME types](https://www.baeldung.com/testing-rest-api-with-multiple-media-types) - [Testing Web APIs with Postman Collections](https://www.baeldung.com/postman-testing-collections) - [Spring Boot Consuming and Producing JSON](https://www.baeldung.com/spring-boot-json) -- [Error Handling for REST with Spring](https://www.baeldung.com/exception-handling-for-rest-with-spring) ### E-book @@ -26,3 +25,6 @@ These articles are part of the Spring REST E-book: 8. [An Intro to Spring HATEOAS](https://www.baeldung.com/spring-hateoas-tutorial) 9. [REST Pagination in Spring](https://www.baeldung.com/rest-api-pagination-in-spring) 10. [Test a REST API with Java](https://www.baeldung.com/integration-testing-a-rest-api) + +NOTE: +Since this is a module tied to an e-book, it should not be moved or used to store the code for any further article. diff --git a/spring-boot-rest/pom.xml b/spring-boot-rest/pom.xml index 10dacf99e8..2483aab6be 100644 --- a/spring-boot-rest/pom.xml +++ b/spring-boot-rest/pom.xml @@ -95,6 +95,7 @@ 27.0.1-jre 1.4.11.1 2.3.5 + 2.1.9.RELEASE diff --git a/spring-boot-rest/src/main/java/com/baeldung/spring/WebConfig.java b/spring-boot-rest/src/main/java/com/baeldung/spring/WebConfig.java index ab16b61e1d..13a9933fa6 100644 --- a/spring-boot-rest/src/main/java/com/baeldung/spring/WebConfig.java +++ b/spring-boot-rest/src/main/java/com/baeldung/spring/WebConfig.java @@ -14,8 +14,6 @@ import org.springframework.web.filter.ShallowEtagHeaderFilter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @Configuration -// If we want to enable xml configurations for message-converter: -// @ImportResource("classpath:WEB-INF/api-servlet.xml") public class WebConfig implements WebMvcConfigurer { // @Override diff --git a/spring-boot-rest/src/main/resources/WEB-INF/api-servlet.xml b/spring-boot-rest/src/main/resources/WEB-INF/api-servlet.xml deleted file mode 100644 index 78e38e1448..0000000000 --- a/spring-boot-rest/src/main/resources/WEB-INF/api-servlet.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/spring-boot-rest/src/test/java/com/baeldung/springhateoas/CustomerControllerIntegrationTest.java b/spring-boot-rest/src/test/java/com/baeldung/springhateoas/CustomerControllerIntegrationTest.java index b08da6d2cd..644ce5132a 100644 --- a/spring-boot-rest/src/test/java/com/baeldung/springhateoas/CustomerControllerIntegrationTest.java +++ b/spring-boot-rest/src/test/java/com/baeldung/springhateoas/CustomerControllerIntegrationTest.java @@ -70,7 +70,7 @@ public class CustomerControllerIntegrationTest { this.mvc.perform(get("/customers/" + DEFAULT_CUSTOMER_ID + "/orders").accept(MediaTypes.HAL_JSON_VALUE)) .andExpect(status().isOk()) - .andExpect(jsonPath("$._embedded.orderList[0]._links.self.href", + .andExpect(jsonPath("$._embedded.orders[0]._links.self.href", is("http://localhost/customers/customer1/order1"))) .andExpect(jsonPath("$._links.self.href", is("http://localhost/customers/customer1/orders"))); } @@ -89,8 +89,8 @@ public class CustomerControllerIntegrationTest { this.mvc.perform(get("/customers/").accept(MediaTypes.HAL_JSON_VALUE)) .andExpect(status().isOk()) .andExpect( - jsonPath("$._embedded.customerList[0]._links.self.href", is("http://localhost/customers/customer1"))) - .andExpect(jsonPath("$._embedded.customerList[0]._links.allOrders.href", + jsonPath("$._embedded.customers[0]._links.self.href", is("http://localhost/customers/customer1"))) + .andExpect(jsonPath("$._embedded.customers[0]._links.allOrders.href", is("http://localhost/customers/customer1/orders"))) .andExpect(jsonPath("$._links.self.href", is("http://localhost/customers"))); } diff --git a/spring-boot-runtime/src/main/resources/logback.xml b/spring-boot-runtime/src/main/resources/logback.xml deleted file mode 100644 index 7d900d8ea8..0000000000 --- a/spring-boot-runtime/src/main/resources/logback.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - \ No newline at end of file diff --git a/spring-boot-security/pom.xml b/spring-boot-security/pom.xml index 62c04b4dc3..92397d42f8 100644 --- a/spring-boot-security/pom.xml +++ b/spring-boot-security/pom.xml @@ -22,12 +22,22 @@ org.springframework.security.oauth spring-security-oauth2 - 2.3.3.RELEASE + 2.4.0.RELEASE + + + org.springframework.security + spring-security-core + 5.2.1.RELEASE + + + commons-io + commons-io + 2.6 org.springframework.security.oauth.boot spring-security-oauth2-autoconfigure - 2.1.2.RELEASE + 2.2.2.RELEASE org.springframework.boot @@ -64,7 +74,7 @@ org.springframework.boot spring-boot-autoconfigure - 2.1.1.RELEASE + diff --git a/spring-boot-security/src/main/java/com/baeldung/springbootsecurity/oauth2server/SpringBootAuthorizationServerApplication.java b/spring-boot-security/src/main/java/com/baeldung/springbootsecurity/oauth2server/SpringBootAuthorizationServerApplication.java index 44dabefbb8..04f046ff78 100644 --- a/spring-boot-security/src/main/java/com/baeldung/springbootsecurity/oauth2server/SpringBootAuthorizationServerApplication.java +++ b/spring-boot-security/src/main/java/com/baeldung/springbootsecurity/oauth2server/SpringBootAuthorizationServerApplication.java @@ -1,7 +1,11 @@ package com.baeldung.springbootsecurity.oauth2server; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.annotation.CurrentSecurityContext; import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer; import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer; import org.springframework.web.bind.annotation.GetMapping; @@ -14,6 +18,8 @@ import java.security.Principal; @SpringBootApplication(scanBasePackages = "com.baeldung.springbootsecurity.oauth2server") public class SpringBootAuthorizationServerApplication { + private static final Logger logger = LoggerFactory.getLogger(SpringBootAuthorizationServerApplication.class); + public static void main(String[] args) { SpringApplication.run(SpringBootAuthorizationServerApplication.class, args); } @@ -26,5 +32,16 @@ public class SpringBootAuthorizationServerApplication { return user; } + @GetMapping("/authentication") + public Object getAuthentication(@CurrentSecurityContext(expression = "authentication") Authentication authentication) { + logger.info("authentication -> {}", authentication); + return authentication.getDetails(); + } + + @GetMapping("/principal") + public String getPrincipal(@CurrentSecurityContext(expression = "authentication.principal") Principal principal) { + logger.info("principal -> {}", principal); + return principal.getName(); + } } } diff --git a/spring-boot-security/src/test/java/com/baeldung/springbootsecurity/oauth2server/CustomConfigAuthorizationServerIntegrationTest.java b/spring-boot-security/src/test/java/com/baeldung/springbootsecurity/oauth2server/CustomConfigAuthorizationServerIntegrationTest.java index cc953eef5a..104e115b18 100644 --- a/spring-boot-security/src/test/java/com/baeldung/springbootsecurity/oauth2server/CustomConfigAuthorizationServerIntegrationTest.java +++ b/spring-boot-security/src/test/java/com/baeldung/springbootsecurity/oauth2server/CustomConfigAuthorizationServerIntegrationTest.java @@ -1,8 +1,10 @@ package com.baeldung.springbootsecurity.oauth2server; +import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.web.server.LocalServerPort; import org.springframework.security.oauth2.client.OAuth2RestTemplate; import org.springframework.security.oauth2.client.resource.OAuth2AccessDeniedException; import org.springframework.security.oauth2.client.token.grant.client.ClientCredentialsResourceDetails; @@ -10,8 +12,13 @@ import org.springframework.security.oauth2.common.OAuth2AccessToken; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; +import java.net.URL; +import java.util.regex.Pattern; + import static java.util.Collections.singletonList; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; @RunWith(SpringRunner.class) @@ -19,6 +26,14 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen @ActiveProfiles("authz") public class CustomConfigAuthorizationServerIntegrationTest extends OAuth2IntegrationTestSupport { + @LocalServerPort + private int port; + + @Before + public void setUp() throws Exception { + base = new URL("http://localhost:" + port); + } + @Test public void givenOAuth2Context_whenAccessTokenIsRequested_ThenAccessTokenValueIsNotNull() { ClientCredentialsResourceDetails resourceDetails = getClientCredentialsResourceDetails("baeldung", singletonList("read")); @@ -27,7 +42,29 @@ public class CustomConfigAuthorizationServerIntegrationTest extends OAuth2Integr OAuth2AccessToken accessToken = restTemplate.getAccessToken(); assertNotNull(accessToken); + } + @Test + public void givenOAuth2Context_whenAccessingAuthentication_ThenRespondTokenDetails() { + ClientCredentialsResourceDetails resourceDetails = getClientCredentialsResourceDetails("baeldung", singletonList("read")); + OAuth2RestTemplate restTemplate = getOAuth2RestTemplate(resourceDetails); + + String authentication = executeGetRequest(restTemplate, "/authentication"); + + Pattern pattern = Pattern.compile("\\{\"remoteAddress\":\".*" + + "\",\"sessionId\":null,\"tokenValue\":\".*" + + "\",\"tokenType\":\"Bearer\",\"decodedDetails\":null}"); + assertTrue("authentication", pattern.matcher(authentication).matches()); + } + + @Test + public void givenOAuth2Context_whenAccessingPrincipal_ThenRespondBaeldung() { + ClientCredentialsResourceDetails resourceDetails = getClientCredentialsResourceDetails("baeldung", singletonList("read")); + OAuth2RestTemplate restTemplate = getOAuth2RestTemplate(resourceDetails); + + String principal = executeGetRequest(restTemplate, "/principal"); + + assertEquals("baeldung", principal); } @Test(expected = OAuth2AccessDeniedException.class) diff --git a/spring-boot-security/src/test/java/com/baeldung/springbootsecurity/oauth2server/OAuth2IntegrationTestSupport.java b/spring-boot-security/src/test/java/com/baeldung/springbootsecurity/oauth2server/OAuth2IntegrationTestSupport.java index 3eef206c7d..a005965998 100644 --- a/spring-boot-security/src/test/java/com/baeldung/springbootsecurity/oauth2server/OAuth2IntegrationTestSupport.java +++ b/spring-boot-security/src/test/java/com/baeldung/springbootsecurity/oauth2server/OAuth2IntegrationTestSupport.java @@ -1,19 +1,33 @@ package com.baeldung.springbootsecurity.oauth2server; +import org.apache.commons.io.IOUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.security.oauth2.client.DefaultOAuth2ClientContext; import org.springframework.security.oauth2.client.OAuth2RestTemplate; import org.springframework.security.oauth2.client.token.grant.client.ClientCredentialsResourceDetails; +import org.springframework.web.client.RequestCallback; +import org.springframework.web.client.ResponseExtractor; +import java.net.URL; +import java.nio.charset.Charset; import java.util.List; import static java.lang.String.format; import static java.util.Collections.singletonList; +import static org.springframework.http.HttpMethod.GET; public class OAuth2IntegrationTestSupport { - @Value("${local.server.port}") protected int port; + public static final ResponseExtractor EXTRACT_BODY_AS_STRING = clientHttpResponse -> + IOUtils.toString(clientHttpResponse.getBody(), Charset.defaultCharset()); + private static final RequestCallback DO_NOTHING_CALLBACK = request -> { + }; + + @Value("${local.server.port}") + protected int port; + + protected URL base; protected ClientCredentialsResourceDetails getClientCredentialsResourceDetails(final String clientId, final List scopes) { ClientCredentialsResourceDetails resourceDetails = new ClientCredentialsResourceDetails(); @@ -31,4 +45,9 @@ public class OAuth2IntegrationTestSupport { restTemplate.setMessageConverters(singletonList(new MappingJackson2HttpMessageConverter())); return restTemplate; } + + protected String executeGetRequest(OAuth2RestTemplate restTemplate, String path) { + return restTemplate.execute(base.toString() + path, GET, DO_NOTHING_CALLBACK, EXTRACT_BODY_AS_STRING); + } + } diff --git a/spring-boot-testing/.mvn/wrapper/maven-wrapper.jar b/spring-boot-testing/.mvn/wrapper/maven-wrapper.jar deleted file mode 100644 index 9cc84ea9b4..0000000000 Binary files a/spring-boot-testing/.mvn/wrapper/maven-wrapper.jar and /dev/null differ diff --git a/spring-boot-vue/src/main/resources/logback.xml b/spring-boot-vue/src/main/resources/logback.xml deleted file mode 100644 index 7d900d8ea8..0000000000 --- a/spring-boot-vue/src/main/resources/logback.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - \ No newline at end of file diff --git a/spring-boot/.factorypath b/spring-boot/.factorypath deleted file mode 100644 index 22b8a1ce95..0000000000 --- a/spring-boot/.factorypath +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/pom.xml b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/pom.xml index e5f76d5d9c..07de78a92e 100644 --- a/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/pom.xml +++ b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/pom.xml @@ -89,7 +89,7 @@ - Finchley.SR2 + Hoxton.SR1 1.0.0.RELEASE diff --git a/spring-core-2/README.md b/spring-core-2/README.md index 0ed303162d..1fb591f693 100644 --- a/spring-core-2/README.md +++ b/spring-core-2/README.md @@ -16,5 +16,5 @@ This module contains articles about core Spring functionality - [Spring Null-Safety Annotations](https://www.baeldung.com/spring-null-safety-annotations) - [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)[[next -->]](/spring-core-3) \ No newline at end of file +- [Reading HttpServletRequest Multiple Times in Spring](https://www.baeldung.com/spring-reading-httpservletrequest-multiple-times) +- More articles: [[<-- prev]](/spring-core)[[next -->]](/spring-core-3) diff --git a/spring-core-2/pom.xml b/spring-core-2/pom.xml index 78b94880d0..4d474d8b2c 100644 --- a/spring-core-2/pom.xml +++ b/spring-core-2/pom.xml @@ -203,7 +203,7 @@ com.baeldung.sample.App - 5.0.6.RELEASE + 5.2.2.RELEASE 1.3.2 5.2.5.Final diff --git a/spring-ejb/README.md b/spring-ejb/README.md index 423d55ea22..8f6522266c 100644 --- a/spring-ejb/README.md +++ b/spring-ejb/README.md @@ -8,5 +8,5 @@ This module contains articles about Spring with EJB - [Java EE Session Beans](https://www.baeldung.com/ejb-session-beans) - [A Guide to Message Driven Beans in EJB](https://www.baeldung.com/ejb-message-driven-beans) - [Integration Guide for Spring and EJB](https://www.baeldung.com/spring-ejb) -- [Singleton Session Bean in Java EE](https://www.baeldung.com/java-ee-singleton-session-bean) +- [Singleton Session Bean in Jakarta EE](https://www.baeldung.com/java-ee-singleton-session-bean) diff --git a/spring-jinq/pom.xml b/spring-jinq/pom.xml index 991401c4a1..29fc3605d7 100644 --- a/spring-jinq/pom.xml +++ b/spring-jinq/pom.xml @@ -11,6 +11,7 @@ com.baeldung parent-boot-1 0.0.1-SNAPSHOT + ../parent-boot-1 diff --git a/spring-jooq/pom.xml b/spring-jooq/pom.xml index 620172f2a1..f3b8cce8dc 100644 --- a/spring-jooq/pom.xml +++ b/spring-jooq/pom.xml @@ -194,6 +194,7 @@ 1.5 1.0.0 org.jooq.example.spring.Application + 2.1.9.RELEASE \ No newline at end of file diff --git a/spring-mvc-basics-3/README.md b/spring-mvc-basics-3/README.md index b21f7b686a..180cee498b 100644 --- a/spring-mvc-basics-3/README.md +++ b/spring-mvc-basics-3/README.md @@ -11,5 +11,5 @@ This module contains articles about Spring MVC - [Using Enums as Request Parameters in Spring](https://www.baeldung.com/spring-enum-request-param) - [Excluding URLs for a Filter in a Spring Web Application](https://www.baeldung.com/spring-exclude-filter) - [Guide to Flash Attributes in a Spring Web Application](https://www.baeldung.com/spring-web-flash-attributes) -- More articles: [[more -->]](/spring-mvc-basics-4) -- More articles: [[<-- prev]](/spring-mvc-basics-2) +- [Handling URL Encoded Form Data in Spring REST](https://www.baeldung.com/spring-url-encoded-form-data) +- More articles: [[<-- prev]](/spring-mvc-basics-2)[[more -->]](/spring-mvc-basics-4) diff --git a/spring-mvc-basics-3/src/test/java/com/baeldung/SpringBootApplicationIntegrationTest.java b/spring-mvc-basics-3/src/test/java/com/baeldung/SpringBootApplicationIntegrationTest.java index 7190c4f427..bccca58aea 100644 --- a/spring-mvc-basics-3/src/test/java/com/baeldung/SpringBootApplicationIntegrationTest.java +++ b/spring-mvc-basics-3/src/test/java/com/baeldung/SpringBootApplicationIntegrationTest.java @@ -16,8 +16,6 @@ import org.springframework.test.web.servlet.result.MockMvcResultMatchers; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.web.context.WebApplicationContext; -import java.nio.charset.Charset; - import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; @@ -39,31 +37,23 @@ public class SpringBootApplicationIntegrationTest { @Test public void givenRequestHasBeenMade_whenMeetsAllOfGivenConditions_thenCorrect() throws Exception { - MediaType contentType = new MediaType(MediaType.APPLICATION_JSON.getType(), MediaType.APPLICATION_JSON.getSubtype(), Charset.forName("utf8")); - - mockMvc.perform(MockMvcRequestBuilders.get("/entity/all")).andExpect(MockMvcResultMatchers.status().isOk()).andExpect(MockMvcResultMatchers.content().contentType(contentType)).andExpect(jsonPath("$", hasSize(4))); + mockMvc.perform(MockMvcRequestBuilders.get("/entity/all")).andExpect(MockMvcResultMatchers.status().isOk()).andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON)).andExpect(jsonPath("$", hasSize(4))); } @Test public void givenRequestHasBeenMade_whenMeetsFindByDateOfGivenConditions_thenCorrect() throws Exception { - MediaType contentType = new MediaType(MediaType.APPLICATION_JSON.getType(), MediaType.APPLICATION_JSON.getSubtype(), Charset.forName("utf8")); - - mockMvc.perform(MockMvcRequestBuilders.get("/entity/findbydate/{date}", "2011-12-03T10:15:30")).andExpect(MockMvcResultMatchers.status().isOk()).andExpect(MockMvcResultMatchers.content().contentType(contentType)) + mockMvc.perform(MockMvcRequestBuilders.get("/entity/findbydate/{date}", "2011-12-03T10:15:30")).andExpect(MockMvcResultMatchers.status().isOk()).andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON)) .andExpect(jsonPath("$.id", equalTo(1))); } @Test public void givenRequestHasBeenMade_whenMeetsFindByModeOfGivenConditions_thenCorrect() throws Exception { - MediaType contentType = new MediaType(MediaType.APPLICATION_JSON.getType(), MediaType.APPLICATION_JSON.getSubtype(), Charset.forName("utf8")); - - mockMvc.perform(MockMvcRequestBuilders.get("/entity/findbymode/{mode}", Modes.ALPHA.name())).andExpect(MockMvcResultMatchers.status().isOk()).andExpect(MockMvcResultMatchers.content().contentType(contentType)).andExpect(jsonPath("$.id", equalTo(1))); + mockMvc.perform(MockMvcRequestBuilders.get("/entity/findbymode/{mode}", Modes.ALPHA.name())).andExpect(MockMvcResultMatchers.status().isOk()).andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON)).andExpect(jsonPath("$.id", equalTo(1))); } @Test public void givenRequestHasBeenMade_whenMeetsFindByVersionOfGivenConditions_thenCorrect() throws Exception { - MediaType contentType = new MediaType(MediaType.APPLICATION_JSON.getType(), MediaType.APPLICATION_JSON.getSubtype(), Charset.forName("utf8")); - - mockMvc.perform(MockMvcRequestBuilders.get("/entity/findbyversion").header("Version", "1.0.0")).andExpect(MockMvcResultMatchers.status().isOk()).andExpect(MockMvcResultMatchers.content().contentType(contentType)) + mockMvc.perform(MockMvcRequestBuilders.get("/entity/findbyversion").header("Version", "1.0.0")).andExpect(MockMvcResultMatchers.status().isOk()).andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON)) .andExpect(jsonPath("$.id", equalTo(1))); } } \ No newline at end of file diff --git a/spring-mvc-basics/src/test/java/com/baeldung/web/controller/EmployeeControllerContentNegotiationIntegrationTest.java b/spring-mvc-basics/src/test/java/com/baeldung/web/controller/EmployeeControllerContentNegotiationIntegrationTest.java index 6500955d23..4ccba79f9c 100644 --- a/spring-mvc-basics/src/test/java/com/baeldung/web/controller/EmployeeControllerContentNegotiationIntegrationTest.java +++ b/spring-mvc-basics/src/test/java/com/baeldung/web/controller/EmployeeControllerContentNegotiationIntegrationTest.java @@ -1,9 +1,5 @@ package com.baeldung.web.controller; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; @@ -12,6 +8,10 @@ import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MockMvc; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + @SpringBootTest @AutoConfigureMockMvc public class EmployeeControllerContentNegotiationIntegrationTest { @@ -23,7 +23,7 @@ public class EmployeeControllerContentNegotiationIntegrationTest { public void whenEndpointUsingJsonSuffixCalled_thenJsonResponseObtained() throws Exception { this.mockMvc.perform(get("/employee/1.json")) .andExpect(status().isOk()) - .andExpect(header().string(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_UTF8_VALUE)); + .andExpect(header().string(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)); } @Test @@ -37,7 +37,7 @@ public class EmployeeControllerContentNegotiationIntegrationTest { public void whenEndpointUsingJsonParameterCalled_thenJsonResponseObtained() throws Exception { this.mockMvc.perform(get("/employee/1?mediaType=json")) .andExpect(status().isOk()) - .andExpect(header().string(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_UTF8_VALUE)); + .andExpect(header().string(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)); } @Test @@ -51,7 +51,7 @@ public class EmployeeControllerContentNegotiationIntegrationTest { public void whenEndpointUsingJsonAcceptHeaderCalled_thenJsonResponseObtained() throws Exception { this.mockMvc.perform(get("/employee/1").header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON_VALUE)) .andExpect(status().isOk()) - .andExpect(header().string(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_UTF8_VALUE)); + .andExpect(header().string(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)); } @Test diff --git a/spring-mvc-basics/src/test/java/com/baeldung/web/controller/SimpleBookControllerIntegrationTest.java b/spring-mvc-basics/src/test/java/com/baeldung/web/controller/SimpleBookControllerIntegrationTest.java index 87d70c2d29..8071828fa3 100644 --- a/spring-mvc-basics/src/test/java/com/baeldung/web/controller/SimpleBookControllerIntegrationTest.java +++ b/spring-mvc-basics/src/test/java/com/baeldung/web/controller/SimpleBookControllerIntegrationTest.java @@ -1,19 +1,17 @@ package com.baeldung.web.controller; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; + public class SimpleBookControllerIntegrationTest { private MockMvc mockMvc; - private static final String CONTENT_TYPE = "application/json;charset=UTF-8"; @BeforeEach public void setup() { @@ -25,7 +23,7 @@ public class SimpleBookControllerIntegrationTest { this.mockMvc .perform(get("/books/42")) .andExpect(status().isOk()) - .andExpect(content().contentType(CONTENT_TYPE)) + .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE)) .andExpect(jsonPath("$.id").value(42)); } diff --git a/spring-mvc-basics/src/test/java/com/baeldung/web/controller/SimpleBookRestControllerIntegrationTest.java b/spring-mvc-basics/src/test/java/com/baeldung/web/controller/SimpleBookRestControllerIntegrationTest.java index 294943f2e2..1062280f3b 100644 --- a/spring-mvc-basics/src/test/java/com/baeldung/web/controller/SimpleBookRestControllerIntegrationTest.java +++ b/spring-mvc-basics/src/test/java/com/baeldung/web/controller/SimpleBookRestControllerIntegrationTest.java @@ -1,19 +1,17 @@ package com.baeldung.web.controller; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; + public class SimpleBookRestControllerIntegrationTest { private MockMvc mockMvc; - private static final String CONTENT_TYPE = "application/json;charset=UTF-8"; @BeforeEach public void setup() { @@ -25,7 +23,7 @@ public class SimpleBookRestControllerIntegrationTest { this.mockMvc .perform(get("/books-rest/42")) .andExpect(status().isOk()) - .andExpect(content().contentType(CONTENT_TYPE)) + .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE)) .andExpect(jsonPath("$.id").value(42)); } diff --git a/spring-mvc-java/pom.xml b/spring-mvc-java/pom.xml index 079a664a5d..0f3a1d65b9 100644 --- a/spring-mvc-java/pom.xml +++ b/spring-mvc-java/pom.xml @@ -223,6 +223,8 @@ + 2.1.9.RELEASE + 3.0.9.RELEASE diff --git a/spring-mvc-views/README.md b/spring-mvc-views/README.md new file mode 100644 index 0000000000..7aa05699f3 --- /dev/null +++ b/spring-mvc-views/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Spring MVC Themes](https://www.baeldung.com/spring-mvc-themes) diff --git a/spring-rest-angular/pom.xml b/spring-rest-angular/pom.xml index 1c6ab77a2d..1d50b4c76c 100644 --- a/spring-rest-angular/pom.xml +++ b/spring-rest-angular/pom.xml @@ -74,7 +74,7 @@ 19.0 - org.baeldung.web.main.Application + com.baeldung.web.main.Application diff --git a/spring-rest-angular/src/main/java/org/baeldung/web/dao/StudentRepository.java b/spring-rest-angular/src/main/java/com/baeldung/web/dao/StudentRepository.java similarity index 66% rename from spring-rest-angular/src/main/java/org/baeldung/web/dao/StudentRepository.java rename to spring-rest-angular/src/main/java/com/baeldung/web/dao/StudentRepository.java index 566d95da00..b69cf6f552 100644 --- a/spring-rest-angular/src/main/java/org/baeldung/web/dao/StudentRepository.java +++ b/spring-rest-angular/src/main/java/com/baeldung/web/dao/StudentRepository.java @@ -1,6 +1,6 @@ -package org.baeldung.web.dao; +package com.baeldung.web.dao; -import org.baeldung.web.entity.Student; +import com.baeldung.web.entity.Student; import org.springframework.data.jpa.repository.JpaRepository; public interface StudentRepository extends JpaRepository diff --git a/spring-rest-angular/src/main/java/org/baeldung/web/entity/Student.java b/spring-rest-angular/src/main/java/com/baeldung/web/entity/Student.java similarity index 97% rename from spring-rest-angular/src/main/java/org/baeldung/web/entity/Student.java rename to spring-rest-angular/src/main/java/com/baeldung/web/entity/Student.java index 0a0b60d87d..849b35cf24 100644 --- a/spring-rest-angular/src/main/java/org/baeldung/web/entity/Student.java +++ b/spring-rest-angular/src/main/java/com/baeldung/web/entity/Student.java @@ -1,4 +1,4 @@ -package org.baeldung.web.entity; +package com.baeldung.web.entity; import java.io.Serializable; diff --git a/spring-rest-angular/src/main/java/org/baeldung/web/exception/MyResourceNotFoundException.java b/spring-rest-angular/src/main/java/com/baeldung/web/exception/MyResourceNotFoundException.java similarity index 93% rename from spring-rest-angular/src/main/java/org/baeldung/web/exception/MyResourceNotFoundException.java rename to spring-rest-angular/src/main/java/com/baeldung/web/exception/MyResourceNotFoundException.java index 740caec59e..ae9c4543ec 100644 --- a/spring-rest-angular/src/main/java/org/baeldung/web/exception/MyResourceNotFoundException.java +++ b/spring-rest-angular/src/main/java/com/baeldung/web/exception/MyResourceNotFoundException.java @@ -1,4 +1,4 @@ -package org.baeldung.web.exception; +package com.baeldung.web.exception; public class MyResourceNotFoundException extends RuntimeException { diff --git a/spring-rest-angular/src/main/java/org/baeldung/web/main/Application.java b/spring-rest-angular/src/main/java/com/baeldung/web/main/Application.java similarity index 96% rename from spring-rest-angular/src/main/java/org/baeldung/web/main/Application.java rename to spring-rest-angular/src/main/java/com/baeldung/web/main/Application.java index fd10643c53..1f3f0aec39 100644 --- a/spring-rest-angular/src/main/java/org/baeldung/web/main/Application.java +++ b/spring-rest-angular/src/main/java/com/baeldung/web/main/Application.java @@ -1,4 +1,4 @@ -package org.baeldung.web.main; +package com.baeldung.web.main; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; diff --git a/spring-rest-angular/src/main/java/org/baeldung/web/main/PersistenceConfig.java b/spring-rest-angular/src/main/java/com/baeldung/web/main/PersistenceConfig.java similarity index 85% rename from spring-rest-angular/src/main/java/org/baeldung/web/main/PersistenceConfig.java rename to spring-rest-angular/src/main/java/com/baeldung/web/main/PersistenceConfig.java index 0fc6b74892..b964c753d2 100644 --- a/spring-rest-angular/src/main/java/org/baeldung/web/main/PersistenceConfig.java +++ b/spring-rest-angular/src/main/java/com/baeldung/web/main/PersistenceConfig.java @@ -1,4 +1,4 @@ -package org.baeldung.web.main; +package com.baeldung.web.main; import javax.sql.DataSource; @@ -12,9 +12,9 @@ import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType; -@EnableJpaRepositories("org.baeldung.web.dao") -@ComponentScan(basePackages = { "org.baeldung.web" }) -@EntityScan("org.baeldung.web.entity") +@EnableJpaRepositories("com.baeldung.web.dao") +@ComponentScan(basePackages = { "com.baeldung.web" }) +@EntityScan("com.baeldung.web.entity") @Configuration public class PersistenceConfig { diff --git a/spring-rest-angular/src/main/java/org/baeldung/web/rest/StudentDirectoryRestController.java b/spring-rest-angular/src/main/java/com/baeldung/web/rest/StudentDirectoryRestController.java similarity index 83% rename from spring-rest-angular/src/main/java/org/baeldung/web/rest/StudentDirectoryRestController.java rename to spring-rest-angular/src/main/java/com/baeldung/web/rest/StudentDirectoryRestController.java index dc295a3d97..6197279384 100644 --- a/spring-rest-angular/src/main/java/org/baeldung/web/rest/StudentDirectoryRestController.java +++ b/spring-rest-angular/src/main/java/com/baeldung/web/rest/StudentDirectoryRestController.java @@ -1,8 +1,8 @@ -package org.baeldung.web.rest; +package com.baeldung.web.rest; -import org.baeldung.web.entity.Student; -import org.baeldung.web.exception.MyResourceNotFoundException; -import org.baeldung.web.service.StudentService; +import com.baeldung.web.entity.Student; +import com.baeldung.web.exception.MyResourceNotFoundException; +import com.baeldung.web.service.StudentService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/spring-rest-angular/src/main/java/org/baeldung/web/service/IOperations.java b/spring-rest-angular/src/main/java/com/baeldung/web/service/IOperations.java similarity index 81% rename from spring-rest-angular/src/main/java/org/baeldung/web/service/IOperations.java rename to spring-rest-angular/src/main/java/com/baeldung/web/service/IOperations.java index 2176c0bb70..60cb4382f4 100644 --- a/spring-rest-angular/src/main/java/org/baeldung/web/service/IOperations.java +++ b/spring-rest-angular/src/main/java/com/baeldung/web/service/IOperations.java @@ -1,4 +1,4 @@ -package org.baeldung.web.service; +package com.baeldung.web.service; import org.springframework.data.domain.Page; diff --git a/spring-rest-angular/src/main/java/com/baeldung/web/service/StudentService.java b/spring-rest-angular/src/main/java/com/baeldung/web/service/StudentService.java new file mode 100644 index 0000000000..65eb791904 --- /dev/null +++ b/spring-rest-angular/src/main/java/com/baeldung/web/service/StudentService.java @@ -0,0 +1,7 @@ +package com.baeldung.web.service; + +import com.baeldung.web.entity.Student; + +public interface StudentService extends IOperations { + +} diff --git a/spring-rest-angular/src/main/java/org/baeldung/web/service/StudentServiceImpl.java b/spring-rest-angular/src/main/java/com/baeldung/web/service/StudentServiceImpl.java similarity index 69% rename from spring-rest-angular/src/main/java/org/baeldung/web/service/StudentServiceImpl.java rename to spring-rest-angular/src/main/java/com/baeldung/web/service/StudentServiceImpl.java index c7bcdc5bd5..cacb0e7840 100644 --- a/spring-rest-angular/src/main/java/org/baeldung/web/service/StudentServiceImpl.java +++ b/spring-rest-angular/src/main/java/com/baeldung/web/service/StudentServiceImpl.java @@ -1,7 +1,7 @@ -package org.baeldung.web.service; +package com.baeldung.web.service; -import org.baeldung.web.dao.StudentRepository; -import org.baeldung.web.entity.Student; +import com.baeldung.web.dao.StudentRepository; +import com.baeldung.web.entity.Student; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; @@ -15,7 +15,7 @@ public class StudentServiceImpl implements StudentService { @Override public Page findPaginated(int page, int size) { - return dao.findAll(new PageRequest(page, size)); + return dao.findAll(PageRequest.of(page, size)); } } diff --git a/spring-rest-angular/src/main/java/org/baeldung/web/service/StudentService.java b/spring-rest-angular/src/main/java/org/baeldung/web/service/StudentService.java deleted file mode 100644 index 1b194f76e2..0000000000 --- a/spring-rest-angular/src/main/java/org/baeldung/web/service/StudentService.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.baeldung.web.service; - -import org.baeldung.web.entity.Student; - -public interface StudentService extends IOperations { - -} diff --git a/spring-rest-angular/src/test/java/org/baeldung/SpringContextTest.java b/spring-rest-angular/src/test/java/com/baeldung/SpringContextTest.java similarity index 85% rename from spring-rest-angular/src/test/java/org/baeldung/SpringContextTest.java rename to spring-rest-angular/src/test/java/com/baeldung/SpringContextTest.java index 9136ce43eb..ee8c553c76 100644 --- a/spring-rest-angular/src/test/java/org/baeldung/SpringContextTest.java +++ b/spring-rest-angular/src/test/java/com/baeldung/SpringContextTest.java @@ -1,6 +1,6 @@ -package org.baeldung; +package com.baeldung; -import org.baeldung.web.main.Application; +import com.baeldung.web.main.Application; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; diff --git a/spring-rest-angular/src/test/java/org/baeldung/web/service/StudentServiceIntegrationTest.java b/spring-rest-angular/src/test/java/com/baeldung/web/service/StudentServiceIntegrationTest.java similarity index 97% rename from spring-rest-angular/src/test/java/org/baeldung/web/service/StudentServiceIntegrationTest.java rename to spring-rest-angular/src/test/java/com/baeldung/web/service/StudentServiceIntegrationTest.java index 1473d44b92..654c4ef647 100644 --- a/spring-rest-angular/src/test/java/org/baeldung/web/service/StudentServiceIntegrationTest.java +++ b/spring-rest-angular/src/test/java/com/baeldung/web/service/StudentServiceIntegrationTest.java @@ -1,4 +1,4 @@ -package org.baeldung.web.service; +package com.baeldung.web.service; import static io.restassured.RestAssured.given; import static org.hamcrest.core.Is.is; @@ -6,7 +6,7 @@ import static org.hamcrest.core.IsCollectionContaining.hasItems; import static org.hamcrest.core.IsEqual.equalTo; import org.apache.commons.lang3.RandomStringUtils; -import org.baeldung.web.main.Application; +import com.baeldung.web.main.Application; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; diff --git a/spring-rest-compress/src/main/java/org/baeldung/spring/rest/compress/CompressingClientHttpRequestInterceptor.java b/spring-rest-compress/src/main/java/com/baeldung/spring/rest/compress/CompressingClientHttpRequestInterceptor.java similarity index 96% rename from spring-rest-compress/src/main/java/org/baeldung/spring/rest/compress/CompressingClientHttpRequestInterceptor.java rename to spring-rest-compress/src/main/java/com/baeldung/spring/rest/compress/CompressingClientHttpRequestInterceptor.java index 7d5326246d..78b77256af 100644 --- a/spring-rest-compress/src/main/java/org/baeldung/spring/rest/compress/CompressingClientHttpRequestInterceptor.java +++ b/spring-rest-compress/src/main/java/com/baeldung/spring/rest/compress/CompressingClientHttpRequestInterceptor.java @@ -1,4 +1,4 @@ -package org.baeldung.spring.rest.compress; +package com.baeldung.spring.rest.compress; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/spring-rest-compress/src/main/java/org/baeldung/spring/rest/compress/GzipUtils.java b/spring-rest-compress/src/main/java/com/baeldung/spring/rest/compress/GzipUtils.java similarity index 96% rename from spring-rest-compress/src/main/java/org/baeldung/spring/rest/compress/GzipUtils.java rename to spring-rest-compress/src/main/java/com/baeldung/spring/rest/compress/GzipUtils.java index 75420ca6d8..b9731535b2 100644 --- a/spring-rest-compress/src/main/java/org/baeldung/spring/rest/compress/GzipUtils.java +++ b/spring-rest-compress/src/main/java/com/baeldung/spring/rest/compress/GzipUtils.java @@ -1,4 +1,4 @@ -package org.baeldung.spring.rest.compress; +package com.baeldung.spring.rest.compress; import org.apache.commons.codec.Charsets; import org.apache.commons.io.IOUtils; diff --git a/spring-rest-compress/src/main/java/org/baeldung/spring/rest/compress/JettyWebServerConfiguration.java b/spring-rest-compress/src/main/java/com/baeldung/spring/rest/compress/JettyWebServerConfiguration.java similarity index 96% rename from spring-rest-compress/src/main/java/org/baeldung/spring/rest/compress/JettyWebServerConfiguration.java rename to spring-rest-compress/src/main/java/com/baeldung/spring/rest/compress/JettyWebServerConfiguration.java index 784814b04d..8de8e5b523 100644 --- a/spring-rest-compress/src/main/java/org/baeldung/spring/rest/compress/JettyWebServerConfiguration.java +++ b/spring-rest-compress/src/main/java/com/baeldung/spring/rest/compress/JettyWebServerConfiguration.java @@ -1,4 +1,4 @@ -package org.baeldung.spring.rest.compress; +package com.baeldung.spring.rest.compress; import org.eclipse.jetty.server.handler.HandlerCollection; import org.eclipse.jetty.server.handler.gzip.GzipHandler; diff --git a/spring-rest-compress/src/main/java/org/baeldung/spring/rest/compress/Message.java b/spring-rest-compress/src/main/java/com/baeldung/spring/rest/compress/Message.java similarity index 92% rename from spring-rest-compress/src/main/java/org/baeldung/spring/rest/compress/Message.java rename to spring-rest-compress/src/main/java/com/baeldung/spring/rest/compress/Message.java index d3450b227c..24272a4fca 100644 --- a/spring-rest-compress/src/main/java/org/baeldung/spring/rest/compress/Message.java +++ b/spring-rest-compress/src/main/java/com/baeldung/spring/rest/compress/Message.java @@ -1,4 +1,4 @@ -package org.baeldung.spring.rest.compress; +package com.baeldung.spring.rest.compress; public class Message { diff --git a/spring-rest-compress/src/main/java/org/baeldung/spring/rest/compress/MessageController.java b/spring-rest-compress/src/main/java/com/baeldung/spring/rest/compress/MessageController.java similarity index 96% rename from spring-rest-compress/src/main/java/org/baeldung/spring/rest/compress/MessageController.java rename to spring-rest-compress/src/main/java/com/baeldung/spring/rest/compress/MessageController.java index 657c3cfec8..2fc2ca8272 100644 --- a/spring-rest-compress/src/main/java/org/baeldung/spring/rest/compress/MessageController.java +++ b/spring-rest-compress/src/main/java/com/baeldung/spring/rest/compress/MessageController.java @@ -1,4 +1,4 @@ -package org.baeldung.spring.rest.compress; +package com.baeldung.spring.rest.compress; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/spring-rest-compress/src/main/java/org/baeldung/spring/rest/compress/RestTemplateConfiguration.java b/spring-rest-compress/src/main/java/com/baeldung/spring/rest/compress/RestTemplateConfiguration.java similarity index 92% rename from spring-rest-compress/src/main/java/org/baeldung/spring/rest/compress/RestTemplateConfiguration.java rename to spring-rest-compress/src/main/java/com/baeldung/spring/rest/compress/RestTemplateConfiguration.java index e1d0f985d9..c1e3c89ae9 100644 --- a/spring-rest-compress/src/main/java/org/baeldung/spring/rest/compress/RestTemplateConfiguration.java +++ b/spring-rest-compress/src/main/java/com/baeldung/spring/rest/compress/RestTemplateConfiguration.java @@ -1,4 +1,4 @@ -package org.baeldung.spring.rest.compress; +package com.baeldung.spring.rest.compress; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-rest-compress/src/main/java/org/baeldung/spring/rest/compress/SpringCompressRequestApplication.java b/spring-rest-compress/src/main/java/com/baeldung/spring/rest/compress/SpringCompressRequestApplication.java similarity index 90% rename from spring-rest-compress/src/main/java/org/baeldung/spring/rest/compress/SpringCompressRequestApplication.java rename to spring-rest-compress/src/main/java/com/baeldung/spring/rest/compress/SpringCompressRequestApplication.java index 3082e3c277..9b1b71979d 100644 --- a/spring-rest-compress/src/main/java/org/baeldung/spring/rest/compress/SpringCompressRequestApplication.java +++ b/spring-rest-compress/src/main/java/com/baeldung/spring/rest/compress/SpringCompressRequestApplication.java @@ -1,4 +1,4 @@ -package org.baeldung.spring.rest.compress; +package com.baeldung.spring.rest.compress; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; diff --git a/spring-rest-compress/src/test/java/org/baeldung/spring/rest/compress/GzipUtilsUnitTest.java b/spring-rest-compress/src/test/java/com/baeldung/spring/rest/compress/GzipUtilsUnitTest.java similarity index 92% rename from spring-rest-compress/src/test/java/org/baeldung/spring/rest/compress/GzipUtilsUnitTest.java rename to spring-rest-compress/src/test/java/com/baeldung/spring/rest/compress/GzipUtilsUnitTest.java index d238c9ec7c..431758d358 100644 --- a/spring-rest-compress/src/test/java/org/baeldung/spring/rest/compress/GzipUtilsUnitTest.java +++ b/spring-rest-compress/src/test/java/com/baeldung/spring/rest/compress/GzipUtilsUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.spring.rest.compress; +package com.baeldung.spring.rest.compress; import org.junit.Test; diff --git a/spring-rest-compress/src/test/java/org/baeldung/spring/rest/compress/MessageControllerUnitTest.java b/spring-rest-compress/src/test/java/com/baeldung/spring/rest/compress/MessageControllerUnitTest.java similarity index 97% rename from spring-rest-compress/src/test/java/org/baeldung/spring/rest/compress/MessageControllerUnitTest.java rename to spring-rest-compress/src/test/java/com/baeldung/spring/rest/compress/MessageControllerUnitTest.java index 9658204917..50b2b7ccd7 100644 --- a/spring-rest-compress/src/test/java/org/baeldung/spring/rest/compress/MessageControllerUnitTest.java +++ b/spring-rest-compress/src/test/java/com/baeldung/spring/rest/compress/MessageControllerUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.spring.rest.compress; +package com.baeldung.spring.rest.compress; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/spring-rest-http/README.md b/spring-rest-http/README.md index 51f5ed4000..54b31e80c4 100644 --- a/spring-rest-http/README.md +++ b/spring-rest-http/README.md @@ -10,5 +10,5 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Guide to UriComponentsBuilder in Spring](https://www.baeldung.com/spring-uricomponentsbuilder) - [How to Set a Header on a Response with Spring 5](https://www.baeldung.com/spring-response-header) - The tests contained for this article rely on the sample application within the [spring-resttemplate](/spring-resttemplate) module - [Returning Custom Status Codes from Spring Controllers](https://www.baeldung.com/spring-mvc-controller-custom-http-status-code) -- [Spring @RequestMapping](https://www.baeldung.com/spring-requestmapping) -- [Guide to DeferredResult in Spring](https://www.baeldung.com/spring-deferred-result) \ No newline at end of file +- [Spring RequestMapping](https://www.baeldung.com/spring-requestmapping) +- [Guide to DeferredResult in Spring](https://www.baeldung.com/spring-deferred-result) diff --git a/spring-rest-simple/src/main/java/com/baeldung/web/dto/FooProtos.java b/spring-rest-simple/src/main/java/com/baeldung/web/dto/FooProtos.java index db7cb66f87..0e8f9caf03 100644 --- a/spring-rest-simple/src/main/java/com/baeldung/web/dto/FooProtos.java +++ b/spring-rest-simple/src/main/java/com/baeldung/web/dto/FooProtos.java @@ -331,7 +331,7 @@ public final class FooProtos { return com.baeldung.web.dto.FooProtos.internal_static_baeldung_Foo_fieldAccessorTable.ensureFieldAccessorsInitialized(com.baeldung.web.dto.FooProtos.Foo.class, com.baeldung.web.dto.FooProtos.Foo.Builder.class); } - // Construct using org.baeldung.web.dto.FooProtos.Foo.newBuilder() + // Construct using com.baeldung.web.dto.FooProtos.Foo.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -581,7 +581,7 @@ public final class FooProtos { private static com.google.protobuf.Descriptors.FileDescriptor descriptor; static { - java.lang.String[] descriptorData = { "\n\017FooProtos.proto\022\010baeldung\"\037\n\003Foo\022\n\n\002id" + "\030\001 \002(\003\022\014\n\004name\030\002 \002(\tB!\n\024org.baeldung.web" + ".dtoB\tFooProtos" }; + java.lang.String[] descriptorData = { "\n\017FooProtos.proto\022\010baeldung\"\037\n\003Foo\022\n\n\002id" + "\030\001 \002(\003\022\014\n\004name\030\002 \002(\tB!\n\024com.baeldung.web" + ".dtoB\tFooProtos" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { public com.google.protobuf.ExtensionRegistry assignDescriptors(com.google.protobuf.Descriptors.FileDescriptor root) { descriptor = root; diff --git a/spring-rest-simple/src/test/java/org/baeldung/SpringContextTest.java b/spring-rest-simple/src/test/java/org/baeldung/SpringContextTest.java deleted file mode 100644 index 5e68a8e64f..0000000000 --- a/spring-rest-simple/src/test/java/org/baeldung/SpringContextTest.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.baeldung; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -import com.baeldung.Application; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = Application.class) -public class SpringContextTest { - - @Test - public void whenSpringContextIsBootstrapped_thenNoExceptions() { - } -} diff --git a/spring-security-modules/pom.xml b/spring-security-modules/pom.xml index 168fab85c0..7de3009f47 100644 --- a/spring-security-modules/pom.xml +++ b/spring-security-modules/pom.xml @@ -30,7 +30,7 @@ spring-security-mvc-persisted-remember-me spring-security-mvc-socket spring-security-oidc - + spring-security-react spring-security-rest spring-security-rest-basic-auth diff --git a/spring-security-modules/spring-security-core/README.md b/spring-security-modules/spring-security-core/README.md index 6b1f236b7c..e42dfecaa0 100644 --- a/spring-security-modules/spring-security-core/README.md +++ b/spring-security-modules/spring-security-core/README.md @@ -7,6 +7,7 @@ This module contains articles about core Spring Security - [Spring Boot Authentication Auditing Support](https://www.baeldung.com/spring-boot-authentication-audit) - [Introduction to Spring Method Security](https://www.baeldung.com/spring-security-method-security) - [Overview and Need for DelegatingFilterProxy in Spring](https://www.baeldung.com/spring-delegating-filter-proxy) +- [Deny Access on Missing @PreAuthorize to Spring Controller Methods](https://www.baeldung.com/spring-deny-access) ### Build the Project diff --git a/spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/models/Tweet.java b/spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/models/Tweet.java index b2e45009f6..54a96deaf3 100644 --- a/spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/models/Tweet.java +++ b/spring-security-modules/spring-security-mvc-boot/src/main/java/com/baeldung/models/Tweet.java @@ -3,14 +3,17 @@ package com.baeldung.models; import java.util.HashSet; import java.util.Set; +import javax.persistence.CollectionTable; import javax.persistence.ElementCollection; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; +import javax.persistence.Table; @Entity +@Table(name = "Tweet") public class Tweet { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE) @@ -18,7 +21,8 @@ public class Tweet { private String tweet; private String owner; @ElementCollection(targetClass = String.class, fetch = FetchType.EAGER) - private Set likes = new HashSet(); + @CollectionTable(name = "Tweet_Likes") + private Set likes = new HashSet<>(); public long getId() { return id; diff --git a/spring-security-modules/spring-security-mvc-boot/src/test/java/com/baeldung/relationships/SpringDataWithSecurityIntegrationTest.java b/spring-security-modules/spring-security-mvc-boot/src/test/java/com/baeldung/relationships/SpringDataWithSecurityIntegrationTest.java index bd0c14ca1f..b2def82c51 100644 --- a/spring-security-modules/spring-security-mvc-boot/src/test/java/com/baeldung/relationships/SpringDataWithSecurityIntegrationTest.java +++ b/spring-security-modules/spring-security-mvc-boot/src/test/java/com/baeldung/relationships/SpringDataWithSecurityIntegrationTest.java @@ -1,29 +1,5 @@ package com.baeldung.relationships; -import static org.springframework.util.Assert.isTrue; - -import java.util.Date; -import java.util.List; - -import javax.servlet.ServletContext; - -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.dao.InvalidDataAccessApiUsageException; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageRequest; -import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.context.web.WebAppConfiguration; -import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; - import com.baeldung.AppConfig; import com.baeldung.data.repositories.TweetRepository; import com.baeldung.data.repositories.UserRepository; @@ -31,6 +7,30 @@ import com.baeldung.models.AppUser; import com.baeldung.models.Tweet; import com.baeldung.security.AppUserPrincipal; import com.baeldung.util.DummyContentUtil; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.dao.InvalidDataAccessApiUsageException; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.context.web.WebAppConfiguration; +import org.springframework.test.jdbc.JdbcTestUtils; +import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; + +import javax.servlet.ServletContext; +import java.util.Date; +import java.util.List; + +import static org.springframework.util.Assert.isTrue; @RunWith(SpringRunner.class) @WebAppConfiguration @@ -54,10 +54,22 @@ public class SpringDataWithSecurityIntegrationTest { tweetRepository.saveAll(DummyContentUtil.generateDummyTweets(appUsers)); } - @AfterClass - public static void tearDown() { - tweetRepository.deleteAll(); - userRepository.deleteAll(); + /** + * This is to ensure the tables are dropped in proper order. + * After the Spring Boot 2.2.2 upgrade, DDL statements generated automatically try to drop Tweet table first. + * As a result we get org.h2.jdbc.JdbcSQLSyntaxErrorException because Tweet_Likes table depends on Tweet. + * + * @see + * StackOverflow#59364212 + * + * @see + * StackOverflow#59561551 + * + */ + @After + public void tearDown() { + JdbcTemplate jdbcTemplate = ctx.getBean(JdbcTemplate.class); + JdbcTestUtils.dropTables(jdbcTemplate, "Tweet_Likes", "Tweet"); } @Test @@ -82,7 +94,7 @@ public class SpringDataWithSecurityIntegrationTest { .setAuthentication(auth); Page page = null; do { - page = tweetRepository.getMyTweetsAndTheOnesILiked(new PageRequest(page != null ? page.getNumber() + 1 : 0, 5)); + page = tweetRepository.getMyTweetsAndTheOnesILiked(PageRequest.of(page != null ? page.getNumber() + 1 : 0, 5)); for (Tweet twt : page.getContent()) { isTrue((twt.getOwner() == appUser.getUsername()) || (twt.getLikes() .contains(appUser.getUsername())), "I do not have any Tweets"); @@ -94,7 +106,7 @@ public class SpringDataWithSecurityIntegrationTest { public void givenNoAppUser_whenPaginatedResultsRetrievalAttempted_shouldFail() { Page page = null; do { - page = tweetRepository.getMyTweetsAndTheOnesILiked(new PageRequest(page != null ? page.getNumber() + 1 : 0, 5)); + page = tweetRepository.getMyTweetsAndTheOnesILiked(PageRequest.of(page != null ? page.getNumber() + 1 : 0, 5)); } while (page != null && page.hasNext()); } } diff --git a/spring-security-modules/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 index 46f3a86c20..6b183d2e5c 100644 --- a/spring-security-modules/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 @@ -9,6 +9,30 @@ "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.4.tgz", "integrity": "sha1-X6rZwsB/YN12dw9xzwJbYqY8/U4=" }, + "accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "requires": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + }, + "dependencies": { + "mime-db": { + "version": "1.43.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", + "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==" + }, + "mime-types": { + "version": "2.1.26", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", + "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", + "requires": { + "mime-db": "1.43.0" + } + } + } + }, "acorn": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz", @@ -123,6 +147,11 @@ "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==" }, + "ansi-html": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/ansi-html/-/ansi-html-0.0.7.tgz", + "integrity": "sha1-gTWEAhliqenm/QOflA0S9WynhZ4=" + }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", @@ -269,6 +298,11 @@ "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=" }, + "array-flatten": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz", + "integrity": "sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ==" + }, "array-includes": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz", @@ -1293,6 +1327,11 @@ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==" }, + "batch": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", + "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=" + }, "bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", @@ -1322,6 +1361,56 @@ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" }, + "body-parser": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", + "requires": { + "bytes": "3.1.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.7.0", + "raw-body": "2.4.0", + "type-is": "~1.6.17" + }, + "dependencies": { + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" + } + } + }, + "bonjour": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/bonjour/-/bonjour-3.5.0.tgz", + "integrity": "sha1-jokKGD2O6aI5OzhExpGkK897yfU=", + "requires": { + "array-flatten": "^2.1.0", + "deep-equal": "^1.0.1", + "dns-equal": "^1.0.0", + "dns-txt": "^2.0.2", + "multicast-dns": "^6.0.1", + "multicast-dns-service-types": "^1.1.0" + } + }, "boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", @@ -1510,6 +1599,11 @@ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.0.tgz", "integrity": "sha512-c5mRlguI/Pe2dSZmpER62rSCu0ryKmWddzRYsuXc50U2/g8jMOulc31VZMa4mYx31U5xsmSOpDCgH88Vl9cDGQ==" }, + "buffer-indexof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-indexof/-/buffer-indexof-1.1.1.tgz", + "integrity": "sha512-4/rOEg86jivtPTeOUUT61jJO1Ya1TrR/OkqCSZDyq84WJh3LuuiphBYJN+fm5xufIk4XAFcEwte/8WzC8If/1g==" + }, "buffer-xor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", @@ -1525,6 +1619,11 @@ "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=" }, + "bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" + }, "cache-base": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", @@ -1936,6 +2035,35 @@ "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" }, + "compressible": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", + "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", + "requires": { + "mime-db": ">= 1.43.0 < 2" + }, + "dependencies": { + "mime-db": { + "version": "1.43.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", + "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==" + } + } + }, + "compression": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz", + "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==", + "requires": { + "accepts": "~1.3.5", + "bytes": "3.0.0", + "compressible": "~2.0.16", + "debug": "2.6.9", + "on-headers": "~1.0.2", + "safe-buffer": "5.1.2", + "vary": "~1.1.2" + } + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -1965,6 +2093,11 @@ "xdg-basedir": "^3.0.0" } }, + "connect-history-api-fallback": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz", + "integrity": "sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==" + }, "console-browserify": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", @@ -1983,6 +2116,19 @@ "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=" }, + "content-disposition": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "requires": { + "safe-buffer": "5.1.2" + } + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" + }, "content-type-parser": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/content-type-parser/-/content-type-parser-1.0.2.tgz", @@ -1993,6 +2139,16 @@ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=" }, + "cookie": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==" + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + }, "copy-descriptor": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", @@ -2377,6 +2533,26 @@ "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" }, + "deep-equal": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", + "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", + "requires": { + "is-arguments": "^1.0.4", + "is-date-object": "^1.0.1", + "is-regex": "^1.0.4", + "object-is": "^1.0.1", + "object-keys": "^1.1.1", + "regexp.prototype.flags": "^1.2.0" + }, + "dependencies": { + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + } + } + }, "deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", @@ -2472,6 +2648,11 @@ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + }, "des.js": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", @@ -2481,6 +2662,11 @@ "minimalistic-assert": "^1.0.0" } }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, "detect-indent": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", @@ -2489,6 +2675,11 @@ "repeating": "^2.0.0" } }, + "detect-node": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.0.4.tgz", + "integrity": "sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw==" + }, "detect-port-alt": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/detect-port-alt/-/detect-port-alt-1.1.6.tgz", @@ -2513,6 +2704,28 @@ "randombytes": "^2.0.0" } }, + "dns-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dns-equal/-/dns-equal-1.0.0.tgz", + "integrity": "sha1-s55/HabrCnW6nBcySzR1PEfgZU0=" + }, + "dns-packet": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.1.tgz", + "integrity": "sha512-0UxfQkMhYAUaZI+xrNZOz/as5KgDU0M/fQ9b6SpkyLbk3GEswDi6PADJVaYJradtRVsRIlF1zLyOodbcTCDzUg==", + "requires": { + "ip": "^1.1.0", + "safe-buffer": "^5.0.1" + } + }, + "dns-txt": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/dns-txt/-/dns-txt-2.0.2.tgz", + "integrity": "sha1-uR2Ab10nGI5Ks+fRB9iBocxGQrY=", + "requires": { + "buffer-indexof": "^1.0.0" + } + }, "doctrine": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", @@ -2624,6 +2837,11 @@ "jsbn": "~0.1.0" } }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, "electron-to-chromium": { "version": "1.3.50", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.50.tgz", @@ -2653,6 +2871,11 @@ "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=" }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + }, "encoding": { "version": "0.1.12", "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", @@ -2785,6 +3008,11 @@ "es6-symbol": "^3.1.1" } }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -3138,6 +3366,11 @@ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" + }, "event-emitter": { "version": "0.3.5", "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", @@ -3147,11 +3380,24 @@ "es5-ext": "~0.10.14" } }, + "eventemitter3": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.0.tgz", + "integrity": "sha512-qerSRB0p+UDEssxTtm6EDKcE7W4OaoisfIMl4CngyEhjpYglocpNg6UEqCvemdGhosAsg4sO2dXJOdyBifPGCg==" + }, "events": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=" }, + "eventsource": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-0.1.6.tgz", + "integrity": "sha1-Cs7ehJ7X3RzMMsgRuxG5RNTykjI=", + "requires": { + "original": ">=0.0.5" + } + }, "evp_bytestokey": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", @@ -3269,6 +3515,60 @@ "homedir-polyfill": "^1.0.1" } }, + "express": { + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", + "requires": { + "accepts": "~1.3.7", + "array-flatten": "1.1.1", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", + "content-type": "~1.0.4", + "cookie": "0.4.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.1.2", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.5", + "qs": "6.7.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.1.2", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "statuses": "~1.5.0", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "dependencies": { + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" + } + } + }, "extend": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", @@ -3398,6 +3698,14 @@ "resolved": "https://registry.npmjs.org/fastparse/-/fastparse-1.1.1.tgz", "integrity": "sha1-0eJkOzipTXWDtHkGDmxK/8lAcfg=" }, + "faye-websocket": { + "version": "0.11.3", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.3.tgz", + "integrity": "sha512-D2y4bovYpzziGgbHYtGCMjlJM36vAl/y+xUyn1C+FVx8szd1E+86KwVw6XvYSzOP8iMpm1X0I4xJD+QtUb36OA==", + "requires": { + "websocket-driver": ">=0.5.1" + } + }, "fb-watchman": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.0.tgz", @@ -3486,6 +3794,20 @@ } } }, + "finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + } + }, "find-cache-dir": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz", @@ -3520,6 +3842,29 @@ "resolved": "https://registry.npmjs.org/flatten/-/flatten-1.0.2.tgz", "integrity": "sha1-2uRqnXj74lKSJYzB54CkHZXAN4I=" }, + "follow-redirects": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.9.1.tgz", + "integrity": "sha512-oUNbrdUjHItyCytZQrHxWQ81ebL4xCFLH10sG0poUMgbKWoBnswpICjUBld3PLJ1lF6cCYVUBG7hAdLro0JNvg==", + "requires": { + "debug": "^3.0.0" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -3553,6 +3898,11 @@ "mime-types": "^2.1.12" } }, + "forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" + }, "fragment-cache": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", @@ -3561,6 +3911,11 @@ "map-cache": "^0.2.2" } }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + }, "fs-extra": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-3.0.1.tgz", @@ -3593,8 +3948,7 @@ }, "ansi-regex": { "version": "2.1.1", - "bundled": true, - "optional": true + "bundled": true }, "aproba": { "version": "1.2.0", @@ -3612,13 +3966,11 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true, - "optional": true + "bundled": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3631,18 +3983,15 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true, - "optional": true + "bundled": true }, "concat-map": { "version": "0.0.1", - "bundled": true, - "optional": true + "bundled": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true, - "optional": true + "bundled": true }, "core-util-is": { "version": "1.0.2", @@ -3745,8 +4094,7 @@ }, "inherits": { "version": "2.0.3", - "bundled": true, - "optional": true + "bundled": true }, "ini": { "version": "1.3.5", @@ -3756,7 +4104,6 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -3769,20 +4116,17 @@ "minimatch": { "version": "3.0.4", "bundled": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true, - "optional": true + "bundled": true }, "minipass": { "version": "2.2.4", "bundled": true, - "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -3799,7 +4143,6 @@ "mkdirp": { "version": "0.5.1", "bundled": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -3872,8 +4215,7 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true, - "optional": true + "bundled": true }, "object-assign": { "version": "4.1.1", @@ -3883,7 +4225,6 @@ "once": { "version": "1.4.0", "bundled": true, - "optional": true, "requires": { "wrappy": "1" } @@ -3959,8 +4300,7 @@ }, "safe-buffer": { "version": "5.1.1", - "bundled": true, - "optional": true + "bundled": true }, "safer-buffer": { "version": "2.1.2", @@ -3990,7 +4330,6 @@ "string-width": { "version": "1.0.2", "bundled": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -4008,7 +4347,6 @@ "strip-ansi": { "version": "3.0.1", "bundled": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -4047,13 +4385,11 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true, - "optional": true + "bundled": true }, "yallist": { "version": "3.0.2", - "bundled": true, - "optional": true + "bundled": true } } }, @@ -4209,6 +4545,11 @@ "duplexer": "^0.1.1" } }, + "handle-thing": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-1.2.5.tgz", + "integrity": "sha1-/Xqtcmvxpf0W38KbL3pmAdJxOcQ=" + }, "handlebars": { "version": "4.0.11", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", @@ -4301,6 +4642,11 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" + }, "has-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", @@ -4385,6 +4731,17 @@ "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.1.tgz", "integrity": "sha512-Ba4+0M4YvIDUUsprMjhVTU1yN9F2/LJSAl69ZpzaLT4l4j5mwTS6jqqW9Ojvj6lKz/veqPzpJBqGbXspOb533A==" }, + "hpack.js": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz", + "integrity": "sha1-h3dMCUnlE/QuhFdbPEVoH63ioLI=", + "requires": { + "inherits": "^2.0.1", + "obuf": "^1.0.0", + "readable-stream": "^2.0.1", + "wbuf": "^1.1.0" + } + }, "html-comment-regex": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/html-comment-regex/-/html-comment-regex-1.1.1.tgz", @@ -4398,6 +4755,11 @@ "whatwg-encoding": "^1.0.1" } }, + "html-entities": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-1.2.1.tgz", + "integrity": "sha1-DfKTUfByEWNRXfueVUPl9u7VFi8=" + }, "html-minifier": { "version": "3.5.17", "resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-3.5.17.tgz", @@ -4487,6 +4849,153 @@ } } }, + "http-deceiver": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz", + "integrity": "sha1-+nFolEq5pRnTN8sL7HKE3D5yPYc=" + }, + "http-errors": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", + "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + } + }, + "http-parser-js": { + "version": "0.4.10", + "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.10.tgz", + "integrity": "sha1-ksnBN0w1CF912zWexWzCV8u5P6Q=" + }, + "http-proxy": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.0.tgz", + "integrity": "sha512-84I2iJM/n1d4Hdgc6y2+qY5mDaz2PUVjlg9znE9byl+q0uC3DeByqBGReQu5tpLK0TAqTIXScRUV+dg7+bUPpQ==", + "requires": { + "eventemitter3": "^4.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + } + }, + "http-proxy-middleware": { + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.17.4.tgz", + "integrity": "sha1-ZC6ISIUdZvCdTxJJEoRtuutBuDM=", + "requires": { + "http-proxy": "^1.16.2", + "is-glob": "^3.1.0", + "lodash": "^4.17.2", + "micromatch": "^2.3.11" + }, + "dependencies": { + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=" + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "requires": { + "is-extglob": "^1.0.0" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" + } + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + }, + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "requires": { + "is-extglob": "^2.1.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "requires": { + "is-extglob": "^1.0.0" + } + } + } + } + } + }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -4538,6 +5047,15 @@ "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=" }, + "import-local": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-0.1.1.tgz", + "integrity": "sha1-sReVcqrNwRxqkQCftDDbyrX2aKg=", + "requires": { + "pkg-dir": "^2.0.0", + "resolve-cwd": "^2.0.0" + } + }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -4626,6 +5144,14 @@ } } }, + "internal-ip": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/internal-ip/-/internal-ip-1.2.0.tgz", + "integrity": "sha1-rp+/k7mEh4eF1QqN4bNWlWBYz1w=", + "requires": { + "meow": "^3.3.0" + } + }, "interpret": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", @@ -4644,6 +5170,16 @@ "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" }, + "ip": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", + "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=" + }, + "ipaddr.js": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz", + "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==" + }, "is-absolute-url": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-2.1.0.tgz", @@ -4667,6 +5203,11 @@ } } }, + "is-arguments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", + "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==" + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -5741,6 +6282,11 @@ "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, + "json3": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.3.tgz", + "integrity": "sha512-c7/8mbUsKigAbLkD5B010BK4D9LZm7A1pNItkEwiUZRpIN66exu/e7YQWysGun+TRKaJp8MhemM+VkfWv42aCA==" + }, "json5": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", @@ -5775,6 +6321,11 @@ "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz", "integrity": "sha1-OGchPo3Xm/Ho8jAMDPwe+xgsDfE=" }, + "killable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/killable/-/killable-1.0.1.tgz", + "integrity": "sha512-LzqtLKlUwirEUyl/nicirVmNiPvYs7l5n8wOPP7fyJVpUPkvCnW/vuiXGpylGUlnPDnB7311rARzAt3Mhswpjg==" + }, "kind-of": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", @@ -5962,6 +6513,11 @@ "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=" }, + "loglevel": { + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.6.6.tgz", + "integrity": "sha512-Sgr5lbboAUBo3eXCSPL4/KoVz3ROKquOjcctxmHIt+vol2DrqTQe3SwkKKuYhEiWB5kYa13YyopJ69deJ1irzQ==" + }, "longest": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", @@ -6063,6 +6619,11 @@ "inherits": "^2.0.1" } }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + }, "mem": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", @@ -6109,6 +6670,16 @@ "resolved": "https://registry.npmjs.org/merge/-/merge-1.2.0.tgz", "integrity": "sha1-dTHjnUlJwoGma4xabgJl6LBYlNo=" }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + }, "micromatch": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", @@ -6216,6 +6787,20 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, + "multicast-dns": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/multicast-dns/-/multicast-dns-6.2.3.tgz", + "integrity": "sha512-ji6J5enbMyGRHIAkAOu3WdV8nggqviKCEKtXcOqfphZZtQrmHKycfynJ2V7eVPUA4NhJ6V7Wf4TmGbTwKE9B6g==", + "requires": { + "dns-packet": "^1.3.1", + "thunky": "^1.0.2" + } + }, + "multicast-dns-service-types": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz", + "integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE=" + }, "mute-stream": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", @@ -6250,6 +6835,11 @@ "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" }, + "negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" + }, "neo-async": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.5.1.tgz", @@ -6277,6 +6867,11 @@ "is-stream": "^1.0.1" } }, + "node-forge": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.9.0.tgz", + "integrity": "sha512-7ASaDa3pD+lJ3WvXFsxekJQelBKRpne+GOVbLbtHYdd7pFspyeuJHnWfLplGf3SwKGbfs/aYl5V/JCIaHVUKKQ==" + }, "node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -6439,6 +7034,16 @@ "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.3.0.tgz", "integrity": "sha512-05KzQ70lSeGSrZJQXE5wNDiTkBJDlUT/myi6RX9dVIvz7a7Qh4oH93BQdiPMn27nldYvVQCKMUaM83AfizZlsQ==" }, + "object-inspect": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==" + }, + "object-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.0.2.tgz", + "integrity": "sha512-Epah+btZd5wrrfjkJZq1AOB9O6OxUQto45hzFd7lXGrpHPGE0W1k+426yrZV+k6NJOzLNNW/nVsmZdIWsAqoOQ==" + }, "object-keys": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", @@ -6452,6 +7057,17 @@ "isobject": "^3.0.0" } }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, "object.omit": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", @@ -6469,6 +7085,24 @@ "isobject": "^3.0.1" } }, + "obuf": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", + "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==" + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } + }, + "on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==" + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -6522,6 +7156,14 @@ "wordwrap": "~1.0.0" } }, + "original": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/original/-/original-1.0.2.tgz", + "integrity": "sha512-hyBVl6iqqUOJ8FqRe+l/gS8H+kKYjrEndd5Pm1MfBtsEKA038HkkdbAl/72EAXGyonD/PFsvmVG+EvcIpliMBg==", + "requires": { + "url-parse": "^1.4.3" + } + }, "os-browserify": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", @@ -6641,6 +7283,11 @@ "resolved": "https://registry.npmjs.org/parse5/-/parse5-1.5.1.tgz", "integrity": "sha1-m387DeMr543CQBsXVzzK8Pb1nZQ=" }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" + }, "pascalcase": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", @@ -6754,6 +7401,44 @@ "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==" }, + "portfinder": { + "version": "1.0.25", + "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.25.tgz", + "integrity": "sha512-6ElJnHBbxVA1XSLgBp7G1FiCkQdlqGzuF7DswL5tcea+E8UpuvPU7beVAjjRwCioTS9ZluNbu+ZyRvgTsmqEBg==", + "requires": { + "async": "^2.6.2", + "debug": "^3.1.1", + "mkdirp": "^0.5.1" + }, + "dependencies": { + "async": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "requires": { + "lodash": "^4.17.14" + } + }, + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, "posix-character-classes": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", @@ -7978,6 +8663,15 @@ "object-assign": "^4.1.1" } }, + "proxy-addr": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz", + "integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==", + "requires": { + "forwarded": "~0.1.2", + "ipaddr.js": "1.9.0" + } + }, "prr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", @@ -8039,6 +8733,11 @@ "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=" }, + "querystringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz", + "integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==" + }, "raf": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/raf/-/raf-3.4.0.tgz", @@ -8081,6 +8780,37 @@ "safe-buffer": "^5.1.0" } }, + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" + }, + "raw-body": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", + "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", + "requires": { + "bytes": "3.1.0", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "dependencies": { + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + } + } + }, "rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", @@ -8130,19 +8860,9 @@ "react-error-overlay": "^4.0.0", "recursive-readdir": "2.2.1", "shell-quote": "1.6.1", + "sockjs-client": "1.1.4", "strip-ansi": "3.0.1", "text-table": "0.2.0" - }, - "dependencies": { - "sockjs-client": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/sockjs-client/-/sockjs-client-1.1.5.tgz", - "integrity": "sha1-G7fA9yIsQPQq3xT0RCy9Eml3GoM=", - "requires": { - "debug": "^2.6.6", - "inherits": "^2.0.1" - } - } } }, "react-dom": { @@ -8202,6 +8922,7 @@ "sw-precache-webpack-plugin": "0.11.4", "url-loader": "0.6.2", "webpack": "3.8.1", + "webpack-dev-server": "2.9.4", "webpack-manifest-plugin": "1.3.2", "whatwg-fetch": "2.0.3" }, @@ -8233,18 +8954,6 @@ "asap": "~2.0.3" } }, - "webpack-dev-server": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-3.1.5.tgz", - "integrity": "sha512-LVHg+EPwZLHIlfvokSTgtJqO/vI5CQi89fASb5JEDtVMDjY0yuIEqPPdMiKaBJIB/Ab7v/UN/sYZ7WsZvntQKw==", - "requires": { - "array-includes": "^3.0.3", - "chokidar": "^2.0.0", - "opn": "^5.1.0", - "strip-ansi": "^3.0.0", - "supports-color": "^5.1.0" - } - }, "whatwg-fetch": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz", @@ -8411,6 +9120,81 @@ "safe-regex": "^1.1.0" } }, + "regexp.prototype.flags": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz", + "integrity": "sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + }, + "dependencies": { + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "requires": { + "object-keys": "^1.0.12" + } + }, + "es-abstract": { + "version": "1.17.4", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.4.tgz", + "integrity": "sha512-Ae3um/gb8F0mui/jPL+QiqmglkUsaQf7FwBEHYIFkztkneosu9imhqHpBzQ3h1vit8t5iQ74t6PEVvphBZiuiQ==", + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + }, + "dependencies": { + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + } + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "is-callable": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==" + }, + "is-regex": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "requires": { + "has": "^1.0.3" + } + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "requires": { + "has-symbols": "^1.0.1" + } + } + } + }, "regexpu-core": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", @@ -8571,6 +9355,11 @@ "resolve-from": "^1.0.0" } }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" + }, "resolve": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.6.0.tgz", @@ -8579,6 +9368,21 @@ "path-parse": "^1.0.5" } }, + "resolve-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", + "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", + "requires": { + "resolve-from": "^3.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=" + } + } + }, "resolve-dir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", @@ -8726,6 +9530,19 @@ "ajv": "^5.0.0" } }, + "select-hose": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", + "integrity": "sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo=" + }, + "selfsigned": { + "version": "1.10.7", + "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.7.tgz", + "integrity": "sha512-8M3wBCzeWIJnQfl43IKwOmC4H/RAp50S8DF60znzjW5GVqTcSe2vWclt7hmYVPkKPlHWOu5EaWOMZ2Y6W8ZXTA==", + "requires": { + "node-forge": "0.9.0" + } + }, "semver": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", @@ -8739,6 +9556,76 @@ "semver": "^5.0.3" } }, + "send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", + "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", + "requires": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.7.2", + "mime": "1.6.0", + "ms": "2.1.1", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" + }, + "dependencies": { + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + } + } + }, + "serve-index": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", + "integrity": "sha1-03aNabHn2C5c4FD/9bRTvqEqkjk=", + "requires": { + "accepts": "~1.3.4", + "batch": "0.6.1", + "debug": "2.6.9", + "escape-html": "~1.0.3", + "http-errors": "~1.6.2", + "mime-types": "~2.1.17", + "parseurl": "~1.3.2" + }, + "dependencies": { + "http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" + } + }, + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" + } + } + }, + "serve-static": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", + "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.17.1" + } + }, "serviceworker-cache-polyfill": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/serviceworker-cache-polyfill/-/serviceworker-cache-polyfill-4.0.0.tgz", @@ -8780,6 +9667,11 @@ "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" }, + "setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" + }, "sha.js": { "version": "2.4.11", "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", @@ -8938,6 +9830,43 @@ } } }, + "sockjs": { + "version": "0.3.18", + "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.18.tgz", + "integrity": "sha1-2bKJMWyn33dZXvKZ4HXw+TfrQgc=", + "requires": { + "faye-websocket": "^0.10.0", + "uuid": "^2.0.2" + }, + "dependencies": { + "faye-websocket": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.10.0.tgz", + "integrity": "sha1-TkkvjQTftviQA1B/btvy1QHnxvQ=", + "requires": { + "websocket-driver": ">=0.5.1" + } + }, + "uuid": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz", + "integrity": "sha1-Z+LoY3lyFVMN/zGOW/nc6/1Hsho=" + } + } + }, + "sockjs-client": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/sockjs-client/-/sockjs-client-1.1.4.tgz", + "integrity": "sha1-W6vjhrd15M8U51IJEUUmVAFsixI=", + "requires": { + "debug": "^2.6.6", + "eventsource": "0.1.6", + "faye-websocket": "~0.11.0", + "inherits": "^2.0.1", + "json3": "^3.3.2", + "url-parse": "^1.1.8" + } + }, "sort-keys": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz", @@ -9016,6 +9945,33 @@ "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==" }, + "spdy": { + "version": "3.4.7", + "resolved": "https://registry.npmjs.org/spdy/-/spdy-3.4.7.tgz", + "integrity": "sha1-Qv9B7OXMD5mjpsKKq7c/XDsDrLw=", + "requires": { + "debug": "^2.6.8", + "handle-thing": "^1.2.5", + "http-deceiver": "^1.2.7", + "safe-buffer": "^5.0.1", + "select-hose": "^2.0.0", + "spdy-transport": "^2.0.18" + } + }, + "spdy-transport": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/spdy-transport/-/spdy-transport-2.1.1.tgz", + "integrity": "sha512-q7D8c148escoB3Z7ySCASadkegMmUZW8Wb/Q1u0/XBgDKMO880rLQDj8Twiew/tYi7ghemKUi/whSYOwE17f5Q==", + "requires": { + "debug": "^2.6.8", + "detect-node": "^2.0.3", + "hpack.js": "^2.1.6", + "obuf": "^1.1.1", + "readable-stream": "^2.2.9", + "safe-buffer": "^5.0.1", + "wbuf": "^1.7.2" + } + }, "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", @@ -9064,6 +10020,11 @@ } } }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" + }, "stream-browserify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", @@ -9122,6 +10083,44 @@ } } }, + "string.prototype.trimleft": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz", + "integrity": "sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag==", + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + }, + "dependencies": { + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "requires": { + "object-keys": "^1.0.12" + } + } + } + }, + "string.prototype.trimright": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz", + "integrity": "sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g==", + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + }, + "dependencies": { + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "requires": { + "object-keys": "^1.0.12" + } + } + } + }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -9322,6 +10321,16 @@ "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" }, + "thunky": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz", + "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==" + }, + "time-stamp": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-2.2.0.tgz", + "integrity": "sha512-zxke8goJQpBeEgD82CXABeMh0LSJcj7CXEd0OHOg45HgcofF7pxNwZm9+RknpxpDhwN4gFpySkApKfFYfRQnUA==" + }, "timed-out": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", @@ -9396,6 +10405,11 @@ "repeat-string": "^1.6.1" } }, + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" + }, "toposort": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/toposort/-/toposort-1.0.7.tgz", @@ -9459,6 +10473,30 @@ "prelude-ls": "~1.1.2" } }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "dependencies": { + "mime-db": { + "version": "1.43.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", + "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==" + }, + "mime-types": { + "version": "2.1.26", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", + "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", + "requires": { + "mime-db": "1.43.0" + } + } + } + }, "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -9584,6 +10622,11 @@ "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + }, "unset-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", @@ -9708,6 +10751,15 @@ "schema-utils": "^0.3.0" } }, + "url-parse": { + "version": "1.4.7", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz", + "integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==", + "requires": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, "url-parse-lax": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", @@ -9742,6 +10794,11 @@ "resolved": "https://registry.npmjs.org/utila/-/utila-0.4.0.tgz", "integrity": "sha1-ihagXURWV6Oupe7MWxKk+lN5dyw=" }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" + }, "uuid": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", @@ -9756,6 +10813,11 @@ "spdx-expression-parse": "^3.0.0" } }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + }, "vendors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/vendors/-/vendors-1.0.2.tgz", @@ -9802,6 +10864,14 @@ "neo-async": "^2.5.0" } }, + "wbuf": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/wbuf/-/wbuf-1.7.3.tgz", + "integrity": "sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA==", + "requires": { + "minimalistic-assert": "^1.0.0" + } + }, "webidl-conversions": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", @@ -9982,6 +11052,194 @@ } } }, + "webpack-dev-middleware": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-1.12.2.tgz", + "integrity": "sha512-FCrqPy1yy/sN6U/SaEZcHKRXGlqU0DUaEBL45jkUYoB8foVb6wCnbIJ1HKIx+qUFTW+3JpVcCJCxZ8VATL4e+A==", + "requires": { + "memory-fs": "~0.4.1", + "mime": "^1.5.0", + "path-is-absolute": "^1.0.0", + "range-parser": "^1.0.3", + "time-stamp": "^2.0.0" + } + }, + "webpack-dev-server": { + "version": "2.9.4", + "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-2.9.4.tgz", + "integrity": "sha512-thrqC0EQEoSjXeYgP6pUXcUCZ+LNrKsDPn+mItLnn5VyyNZOJKd06hUP5vqkYwL8nWWXsii0loSF9NHNccT6ow==", + "requires": { + "ansi-html": "0.0.7", + "array-includes": "^3.0.3", + "bonjour": "^3.5.0", + "chokidar": "^1.6.0", + "compression": "^1.5.2", + "connect-history-api-fallback": "^1.3.0", + "debug": "^3.1.0", + "del": "^3.0.0", + "express": "^4.13.3", + "html-entities": "^1.2.0", + "http-proxy-middleware": "~0.17.4", + "import-local": "^0.1.1", + "internal-ip": "1.2.0", + "ip": "^1.1.5", + "killable": "^1.0.0", + "loglevel": "^1.4.1", + "opn": "^5.1.0", + "portfinder": "^1.0.9", + "selfsigned": "^1.9.1", + "serve-index": "^1.7.2", + "sockjs": "0.3.18", + "sockjs-client": "1.1.4", + "spdy": "^3.4.1", + "strip-ansi": "^3.0.1", + "supports-color": "^4.2.1", + "webpack-dev-middleware": "^1.11.0", + "yargs": "^6.6.0" + }, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=" + }, + "chokidar": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", + "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "requires": { + "anymatch": "^1.3.0", + "async-each": "^1.0.0", + "fsevents": "^1.0.0", + "glob-parent": "^2.0.0", + "inherits": "^2.0.1", + "is-binary-path": "^1.0.0", + "is-glob": "^2.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.0.0" + } + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "del": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/del/-/del-3.0.0.tgz", + "integrity": "sha1-U+z2mf/LyzljdpGrE7rxYIGXZuU=", + "requires": { + "globby": "^6.1.0", + "is-path-cwd": "^1.0.0", + "is-path-in-cwd": "^1.0.0", + "p-map": "^1.1.1", + "pify": "^3.0.0", + "rimraf": "^2.2.8" + } + }, + "globby": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", + "requires": { + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + } + } + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=" + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "requires": { + "has-flag": "^2.0.0" + } + }, + "yargs": { + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-6.6.0.tgz", + "integrity": "sha1-eC7CHvQDNF+DCoCMo9UTr1YGUgg=", + "requires": { + "camelcase": "^3.0.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.2", + "which-module": "^1.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^4.2.0" + } + }, + "yargs-parser": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-4.2.1.tgz", + "integrity": "sha1-KczqwNxPA8bIe0qfIX3RjJ90hxw=", + "requires": { + "camelcase": "^3.0.0" + } + } + } + }, "webpack-manifest-plugin": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/webpack-manifest-plugin/-/webpack-manifest-plugin-1.3.2.tgz", @@ -10022,6 +11280,21 @@ "source-map": "~0.6.1" } }, + "websocket-driver": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.3.tgz", + "integrity": "sha512-bpxWlvbbB459Mlipc5GBzzZwhoZgGEZLuqPaR0INBGnPAY1vdBX6hPnoFXiw+3yWxDuHyQjO2oXTMyS8A5haFg==", + "requires": { + "http-parser-js": ">=0.4.0 <0.4.11", + "safe-buffer": ">=5.1.0", + "websocket-extensions": ">=0.1.1" + } + }, + "websocket-extensions": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz", + "integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==" + }, "whatwg-encoding": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.3.tgz", diff --git a/spring-security-modules/spring-security-react/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-react/src/test/java/org/baeldung/SpringContextTest.java index 9cc52b4726..cfef3322dc 100644 --- a/spring-security-modules/spring-security-react/src/test/java/org/baeldung/SpringContextTest.java +++ b/spring-security-modules/spring-security-react/src/test/java/org/baeldung/SpringContextTest.java @@ -6,8 +6,10 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.web.WebAppConfiguration; @RunWith(SpringJUnit4ClassRunner.class) +@WebAppConfiguration @ContextConfiguration(classes = { MvcConfig.class, SecSecurityConfig.class }) public class SpringContextTest { diff --git a/spring-session/spring-session-mongodb/pom.xml b/spring-session/spring-session-mongodb/pom.xml index 00ffec93c0..10d4eb595e 100644 --- a/spring-session/spring-session-mongodb/pom.xml +++ b/spring-session/spring-session-mongodb/pom.xml @@ -25,13 +25,11 @@ org.springframework.session spring-session-data-mongodb - ${spring-session-data-mongodb.version} org.springframework.boot spring-boot-starter-data-mongodb - ${spring-boot-starter-data-mongodb.version} @@ -56,9 +54,4 @@ - - 2.1.3.RELEASE - 2.1.5.RELEASE - - \ No newline at end of file diff --git a/spring-session/spring-session-mongodb/src/test/java/com/baeldung/springsessionmongodb/SpringSessionMongoDBIntegrationTest.java b/spring-session/spring-session-mongodb/src/test/java/com/baeldung/springsessionmongodb/SpringSessionMongoDBIntegrationTest.java index de41019e49..7233d07536 100644 --- a/spring-session/spring-session-mongodb/src/test/java/com/baeldung/springsessionmongodb/SpringSessionMongoDBIntegrationTest.java +++ b/spring-session/spring-session-mongodb/src/test/java/com/baeldung/springsessionmongodb/SpringSessionMongoDBIntegrationTest.java @@ -10,7 +10,7 @@ import org.springframework.boot.web.server.LocalServerPort; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; -import org.springframework.session.data.mongo.MongoOperationsSessionRepository; +import org.springframework.session.data.mongo.MongoIndexedSessionRepository; import org.springframework.test.context.junit4.SpringRunner; import java.util.Base64; @@ -24,7 +24,7 @@ public class SpringSessionMongoDBIntegrationTest { private int port; @Autowired - private MongoOperationsSessionRepository repository; + private MongoIndexedSessionRepository repository; private TestRestTemplate restTemplate = new TestRestTemplate(); diff --git a/testing-modules/junit-4/README.md b/testing-modules/junit-4/README.md index d19a0a1e47..6cc3981ed4 100644 --- a/testing-modules/junit-4/README.md +++ b/testing-modules/junit-4/README.md @@ -4,3 +4,4 @@ - [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) diff --git a/testing-modules/rest-assured/pom.xml b/testing-modules/rest-assured/pom.xml index 74935bcf6f..0b027312d6 100644 --- a/testing-modules/rest-assured/pom.xml +++ b/testing-modules/rest-assured/pom.xml @@ -147,16 +147,6 @@ wiremock ${wiremock.version} - - com.github.fge - json-schema-validator - ${github-json-schema-validator.version} - - - com.github.fge - json-schema-core - ${json-schema-core.version} - commons-collections commons-collections @@ -208,12 +198,6 @@ 2.4.7 2.4.1 - 2.2.6 - 1.2.5 - - 3.0.1 - 3.0.1 - 2.5.3 diff --git a/testing-modules/testing-libraries/README.md b/testing-modules/testing-libraries/README.md index e5145d6af8..031fd28797 100644 --- a/testing-modules/testing-libraries/README.md +++ b/testing-modules/testing-libraries/README.md @@ -9,4 +9,4 @@ - [Introduction to CheckStyle](https://www.baeldung.com/checkstyle-java) - [Introduction to FindBugs](https://www.baeldung.com/intro-to-findbugs) - [Cucumber Data Tables](https://www.baeldung.com/cucumber-data-tables) - +- [Cucumber Background](https://www.baeldung.com/java-cucumber-background) diff --git a/testing-modules/testing-libraries/src/test/java/com/baeldung/cucumberhooks/books/BookStoreWithHooksIntegrationHooks.java b/testing-modules/testing-libraries/src/test/java/com/baeldung/cucumberhooks/books/BookStoreWithHooksIntegrationHooks.java new file mode 100644 index 0000000000..8de55e4611 --- /dev/null +++ b/testing-modules/testing-libraries/src/test/java/com/baeldung/cucumberhooks/books/BookStoreWithHooksIntegrationHooks.java @@ -0,0 +1,48 @@ +package com.baeldung.cucumberhooks.books; + +import io.cucumber.core.api.Scenario; +import io.cucumber.java.After; +import io.cucumber.java.AfterStep; +import io.cucumber.java.Before; +import io.cucumber.java.BeforeStep; +import io.cucumber.java8.En; + +public class BookStoreWithHooksIntegrationHooks implements En { + + public BookStoreWithHooksIntegrationHooks() { + Before(1, () -> startBrowser()); + } + + @Before(order=2, value="@Screenshots") + public void beforeScenario(Scenario scenario) { + takeScreenshot(); + } + + @After + public void afterScenario(Scenario scenario) { + takeScreenshot(); + } + + @BeforeStep + public void beforeStep(Scenario scenario) { + takeScreenshot(); + } + + @AfterStep + public void afterStep(Scenario scenario) { + takeScreenshot(); + closeBrowser(); + } + + public void takeScreenshot() { + //code to take and save screenshot + } + + public void startBrowser() { + //code to open browser + } + + public void closeBrowser() { + //code to close browser + } +} diff --git a/testing-modules/testing-libraries/src/test/java/com/baeldung/cucumberhooks/books/BookStoreWithHooksIntegrationTest.java b/testing-modules/testing-libraries/src/test/java/com/baeldung/cucumberhooks/books/BookStoreWithHooksIntegrationTest.java index 4db8157c21..79e43bad27 100644 --- a/testing-modules/testing-libraries/src/test/java/com/baeldung/cucumberhooks/books/BookStoreWithHooksIntegrationTest.java +++ b/testing-modules/testing-libraries/src/test/java/com/baeldung/cucumberhooks/books/BookStoreWithHooksIntegrationTest.java @@ -1,11 +1,5 @@ package com.baeldung.cucumberhooks.books; -import io.cucumber.core.api.Scenario; -import io.cucumber.java.After; -import io.cucumber.java.AfterStep; -import io.cucumber.java.Before; -import io.cucumber.java.BeforeStep; -import io.cucumber.java8.En; import io.cucumber.junit.Cucumber; import io.cucumber.junit.CucumberOptions; import org.junit.runner.RunWith; @@ -14,42 +8,6 @@ import org.junit.runner.RunWith; @CucumberOptions(features = "classpath:features/book-store-with-hooks.feature", glue = "com.baeldung.cucumberhooks.books" ) -public class BookStoreWithHooksIntegrationTest implements En { +public class BookStoreWithHooksIntegrationTest { - public BookStoreWithHooksIntegrationTest() { - Before(1, () -> startBrowser()); - } - - @Before(order=2, value="@Screenshots") - public void beforeScenario(Scenario scenario) { - takeScreenshot(); - } - - @After - public void afterScenario(Scenario scenario) { - takeScreenshot(); - } - - @BeforeStep - public void beforeStep(Scenario scenario) { - takeScreenshot(); - } - - @AfterStep - public void afterStep(Scenario scenario) { - takeScreenshot(); - closeBrowser(); - } - - public void takeScreenshot() { - //code to take and save screenshot - } - - public void startBrowser() { - //code to open browser - } - - public void closeBrowser() { - //code to close browser - } } diff --git a/wildfly/pom.xml b/wildfly/pom.xml index e81b609206..cdffe8b996 100644 --- a/wildfly/pom.xml +++ b/wildfly/pom.xml @@ -9,9 +9,10 @@ war - org.springframework.boot - spring-boot-starter-parent - 2.1.6.RELEASE + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../parent-boot-2