diff --git a/.gitignore b/.gitignore
index aeb63f7323..7725bf202e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -65,6 +65,12 @@ core-java-io/target_link.txt
core-java/src/main/java/com/baeldung/manifest/MANIFEST.MF
ethereum/logs/
jmeter/src/main/resources/*-JMeter.csv
+jmeter/src/main/resources/*-Basic*.csv
+jmeter/src/main/resources/*-JMeter*.csv
+jmeter/src/main/resources/*ReportsDashboard*.csv
+jmeter/src/main/resources/dashboard/*ReportsDashboard*.csv
+jmeter/src/main/resources/*FileExtractionExample.csv
+
ninja/devDb.mv.db
**/node_modules/
@@ -83,6 +89,7 @@ spring-soap/src/main/java/com/baeldung/springsoap/gen/
/report-*.json
transaction.log
*-shell.log
+customers.xml
apache-cxf/cxf-aegis/baeldung.xml
testing-modules/report-*.json
@@ -97,9 +104,20 @@ spring-boot-modules/spring-boot-react/frontend/build
spring-boot-modules/spring-boot-react/frontend/node
spring-boot-modules/spring-boot-react/frontend/yarn.lock
spring-boot-modules/spring-boot-properties-3/*.log
+spring-boot-modules/spring-boot-properties-3/*.gz
# SDKMan
.sdkmanrc
# Localstack
-**/.localstack
\ No newline at end of file
+**/.localstack
+
+#libraries-2
+libraries-2/employee*
+libraries-2/src/test/resources/crawler4j/**
+
+#web-modules/ninja
+devDb*.db
+
+#jaxb
+*.xjb
\ No newline at end of file
diff --git a/README.md b/README.md
index 1ae225b1f3..b354a8f819 100644
--- a/README.md
+++ b/README.md
@@ -31,9 +31,11 @@ The projects are broadly divided into 3 lists: first, second and heavy.
Next, they are segregated further on the basis of the tests that we want to execute.
-Additionally, there are 2 profiles dedicated for JDK9 and above builds.
+Additionally, there are 2 profiles dedicated for JDK9 and above builds - **which require JDK 17**.
-Therefore, we have a total of 8 profiles:
+We also have a parents profile to build only parent modules.
+
+Therefore, we have a total of 9 profiles:
| Profile | Includes | Type of test enabled |
| -------------------------- | --------------------------- | -------------------- |
@@ -45,6 +47,7 @@ Therefore, we have a total of 8 profiles:
| integration-heavy | Heavy/long running projects | *IntegrationTest |
| default-jdk9-and-above | JDK9 and above projects | *UnitTest |
| integration-jdk9-and-above | JDK9 and above projects | *IntegrationTest |
+| parents | Set of parent modules | None |
Building the project
====================
@@ -71,6 +74,17 @@ Building a single module
====================
To build a specific module, run the command: `mvn clean install` in the module directory.
+It can happen that your module is part of a parent module e.g. `parent-boot-1`,`parent-spring-5` etc, then you will need to build the parent module first so that you can build your module.
+We have created a `parents` profile that you can use to build just the parent modules, just run the profile as:
+`mvn clean install -Pparents`
+
+
+Building modules from the root of the repository
+====================
+To build specific modules from the root of the repository, run the command: `mvn clean install --pl asm,atomikos -Pdefault-first` in the root directory.
+
+Here `asm` and `atomikos` are the modules that we want to build and `default-first` is the maven profile in which these modules are present.
+
Running a Spring Boot module
====================
diff --git a/akka-modules/spring-akka/pom.xml b/akka-modules/spring-akka/pom.xml
index 7451a40b86..2201181435 100644
--- a/akka-modules/spring-akka/pom.xml
+++ b/akka-modules/spring-akka/pom.xml
@@ -43,7 +43,7 @@
- 4.3.4.RELEASE
+ 5.3.25
2.4.14
diff --git a/algorithms-modules/algorithms-genetic/src/test/java/com/baeldung/algorithms/AntColonyOptimizationLongRunningUnitTest.java b/algorithms-modules/algorithms-genetic/src/test/java/com/baeldung/algorithms/AntColonyOptimizationLongRunningUnitTest.java
index 2ac7adc3aa..f828d148ba 100644
--- a/algorithms-modules/algorithms-genetic/src/test/java/com/baeldung/algorithms/AntColonyOptimizationLongRunningUnitTest.java
+++ b/algorithms-modules/algorithms-genetic/src/test/java/com/baeldung/algorithms/AntColonyOptimizationLongRunningUnitTest.java
@@ -1,22 +1,24 @@
package com.baeldung.algorithms;
-import org.junit.Assert;
-import org.junit.Test;
+
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+import org.junit.jupiter.api.Test;
import com.baeldung.algorithms.ga.ant_colony.AntColonyOptimization;
-public class AntColonyOptimizationLongRunningUnitTest {
+class AntColonyOptimizationLongRunningUnitTest {
@Test
- public void testGenerateRandomMatrix() {
+ void testGenerateRandomMatrix() {
AntColonyOptimization antTSP = new AntColonyOptimization(5);
- Assert.assertNotNull(antTSP.generateRandomMatrix(5));
+ assertNotNull(antTSP.generateRandomMatrix(5));
}
@Test
- public void testStartAntOptimization() {
+ void testStartAntOptimization() {
AntColonyOptimization antTSP = new AntColonyOptimization(5);
- Assert.assertNotNull(antTSP.solve());
+ assertNotNull(antTSP.solve());
}
}
diff --git a/algorithms-modules/algorithms-genetic/src/test/java/com/baeldung/algorithms/BinaryGeneticAlgorithmLongRunningUnitTest.java b/algorithms-modules/algorithms-genetic/src/test/java/com/baeldung/algorithms/BinaryGeneticAlgorithmLongRunningUnitTest.java
index e819da4b36..a2f869e171 100644
--- a/algorithms-modules/algorithms-genetic/src/test/java/com/baeldung/algorithms/BinaryGeneticAlgorithmLongRunningUnitTest.java
+++ b/algorithms-modules/algorithms-genetic/src/test/java/com/baeldung/algorithms/BinaryGeneticAlgorithmLongRunningUnitTest.java
@@ -1,16 +1,19 @@
package com.baeldung.algorithms;
-import org.junit.Assert;
-import org.junit.Test;
+
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import org.junit.jupiter.api.Test;
import com.baeldung.algorithms.ga.binary.SimpleGeneticAlgorithm;
-public class BinaryGeneticAlgorithmLongRunningUnitTest {
+class BinaryGeneticAlgorithmLongRunningUnitTest {
@Test
- public void testGA() {
+ void testGA() {
SimpleGeneticAlgorithm ga = new SimpleGeneticAlgorithm();
- Assert.assertTrue(ga.runAlgorithm(50, "1011000100000100010000100000100111001000000100000100000000001111"));
+ assertTrue(ga.runAlgorithm(50, "1011000100000100010000100000100111001000000100000100000000001111"));
}
}
diff --git a/algorithms-modules/algorithms-genetic/src/test/java/com/baeldung/algorithms/SimulatedAnnealingLongRunningUnitTest.java b/algorithms-modules/algorithms-genetic/src/test/java/com/baeldung/algorithms/SimulatedAnnealingLongRunningUnitTest.java
index 2ce7d75e43..461e3e9128 100644
--- a/algorithms-modules/algorithms-genetic/src/test/java/com/baeldung/algorithms/SimulatedAnnealingLongRunningUnitTest.java
+++ b/algorithms-modules/algorithms-genetic/src/test/java/com/baeldung/algorithms/SimulatedAnnealingLongRunningUnitTest.java
@@ -1,15 +1,17 @@
package com.baeldung.algorithms;
-import org.junit.Assert;
-import org.junit.Test;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import org.junit.jupiter.api.Test;
import com.baeldung.algorithms.ga.annealing.SimulatedAnnealing;
-public class SimulatedAnnealingLongRunningUnitTest {
+class SimulatedAnnealingLongRunningUnitTest {
@Test
- public void testSimulateAnnealing() {
- Assert.assertTrue(SimulatedAnnealing.simulateAnnealing(10, 1000, 0.9) > 0);
+ void testSimulateAnnealing() {
+ assertTrue(SimulatedAnnealing.simulateAnnealing(10, 1000, 0.9) > 0);
}
}
diff --git a/algorithms-modules/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/HillClimbingAlgorithmUnitTest.java b/algorithms-modules/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/HillClimbingAlgorithmUnitTest.java
index e817d195b3..4e8f927750 100644
--- a/algorithms-modules/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/HillClimbingAlgorithmUnitTest.java
+++ b/algorithms-modules/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/HillClimbingAlgorithmUnitTest.java
@@ -1,23 +1,25 @@
package com.baeldung.algorithms;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
import com.baeldung.algorithms.hillclimbing.HillClimbing;
import com.baeldung.algorithms.hillclimbing.State;
-import org.junit.Before;
-import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-public class HillClimbingAlgorithmUnitTest {
+class HillClimbingAlgorithmUnitTest {
private Stack initStack;
private Stack goalStack;
- @Before
+ @BeforeEach
public void initStacks() {
String blockArr[] = { "B", "C", "D", "A" };
String goalBlockArr[] = { "A", "B", "C", "D" };
@@ -30,7 +32,7 @@ public class HillClimbingAlgorithmUnitTest {
}
@Test
- public void givenInitAndGoalState_whenGetPathWithHillClimbing_thenPathFound() {
+ void givenInitAndGoalState_whenGetPathWithHillClimbing_thenPathFound() {
HillClimbing hillClimbing = new HillClimbing();
List path;
@@ -46,7 +48,7 @@ public class HillClimbingAlgorithmUnitTest {
}
@Test
- public void givenCurrentState_whenFindNextState_thenBetterHeuristics() {
+ void givenCurrentState_whenFindNextState_thenBetterHeuristics() {
HillClimbing hillClimbing = new HillClimbing();
List> initList = new ArrayList<>();
initList.add(initStack);
diff --git a/algorithms-modules/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/RtFiniteStateMachineLongRunningUnitTest.java b/algorithms-modules/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/RtFiniteStateMachineLongRunningUnitTest.java
index fddccfcd9f..f3e896541d 100644
--- a/algorithms-modules/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/RtFiniteStateMachineLongRunningUnitTest.java
+++ b/algorithms-modules/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/RtFiniteStateMachineLongRunningUnitTest.java
@@ -1,14 +1,16 @@
package com.baeldung.algorithms;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import org.junit.jupiter.api.Test;
+
import com.baeldung.algorithms.automata.*;
-import org.junit.Test;
-import static org.junit.Assert.assertTrue;
-
-public final class RtFiniteStateMachineLongRunningUnitTest {
+class RtFiniteStateMachineLongRunningUnitTest {
@Test
- public void acceptsSimplePair() {
+ void acceptsSimplePair() {
String json = "{\"key\":\"value\"}";
FiniteStateMachine machine = this.buildJsonStateMachine();
for (int i = 0; i < json.length(); i++) {
@@ -18,7 +20,7 @@ public final class RtFiniteStateMachineLongRunningUnitTest {
}
@Test
- public void acceptsMorePairs() {
+ void acceptsMorePairs() {
String json = "{\"key1\":\"value1\",\"key2\":\"value2\"}";
FiniteStateMachine machine = this.buildJsonStateMachine();
for (int i = 0; i < json.length(); i++) {
@@ -27,13 +29,15 @@ public final class RtFiniteStateMachineLongRunningUnitTest {
assertTrue(machine.canStop());
}
- @Test(expected = IllegalArgumentException.class)
- public void missingColon() {
+ @Test
+ void missingColon() {
String json = "{\"key\"\"value\"}";
- FiniteStateMachine machine = this.buildJsonStateMachine();
- for (int i = 0; i < json.length(); i++) {
- machine = machine.switchState(String.valueOf(json.charAt(i)));
- }
+ assertThrows(IllegalArgumentException.class, () -> {
+ FiniteStateMachine machine = this.buildJsonStateMachine();
+ for (int i = 0; i < json.length(); i++) {
+ machine = machine.switchState(String.valueOf(json.charAt(i)));
+ }
+ });
}
/**
diff --git a/algorithms-modules/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/kthlargest/FindKthLargestUnitTest.java b/algorithms-modules/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/kthlargest/FindKthLargestUnitTest.java
index 6fbb7c163a..e877d9945a 100644
--- a/algorithms-modules/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/kthlargest/FindKthLargestUnitTest.java
+++ b/algorithms-modules/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/kthlargest/FindKthLargestUnitTest.java
@@ -1,54 +1,54 @@
package com.baeldung.algorithms.kthlargest;
-import static org.assertj.core.api.Assertions.*;
+import static org.assertj.core.api.Assertions.assertThat;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
-public class FindKthLargestUnitTest {
+class FindKthLargestUnitTest {
private FindKthLargest findKthLargest;
private Integer[] arr = { 3, 7, 1, 2, 8, 10, 4, 5, 6, 9 };
- @Before
+ @BeforeEach
public void setup() {
findKthLargest = new FindKthLargest();
}
@Test
- public void givenIntArray_whenFindKthLargestBySorting_thenGetResult() {
+ void givenIntArray_whenFindKthLargestBySorting_thenGetResult() {
int k = 3;
assertThat(findKthLargest.findKthLargestBySorting(arr, k)).isEqualTo(8);
}
@Test
- public void givenIntArray_whenFindKthLargestBySortingDesc_thenGetResult() {
+ void givenIntArray_whenFindKthLargestBySortingDesc_thenGetResult() {
int k = 3;
assertThat(findKthLargest.findKthLargestBySortingDesc(arr, k)).isEqualTo(8);
}
@Test
- public void givenIntArray_whenFindKthLargestByQuickSelect_thenGetResult() {
+ void givenIntArray_whenFindKthLargestByQuickSelect_thenGetResult() {
int k = 3;
int kthLargest = arr.length - k;
assertThat(findKthLargest.findKthElementByQuickSelect(arr, 0, arr.length - 1, kthLargest)).isEqualTo(8);
}
@Test
- public void givenIntArray_whenFindKthElementByQuickSelectIterative_thenGetResult() {
+ void givenIntArray_whenFindKthElementByQuickSelectIterative_thenGetResult() {
int k = 3;
int kthLargest = arr.length - k;
assertThat(findKthLargest.findKthElementByQuickSelectWithIterativePartition(arr, 0, arr.length - 1, kthLargest)).isEqualTo(8);
}
@Test
- public void givenIntArray_whenFindKthSmallestByQuickSelect_thenGetResult() {
+ void givenIntArray_whenFindKthSmallestByQuickSelect_thenGetResult() {
int k = 3;
assertThat(findKthLargest.findKthElementByQuickSelect(arr, 0, arr.length - 1, k - 1)).isEqualTo(3);
}
@Test
- public void givenIntArray_whenFindKthLargestByRandomizedQuickSelect_thenGetResult() {
+ void givenIntArray_whenFindKthLargestByRandomizedQuickSelect_thenGetResult() {
int k = 3;
int kthLargest = arr.length - k;
assertThat(findKthLargest.findKthElementByRandomizedQuickSelect(arr, 0, arr.length - 1, kthLargest)).isEqualTo(8);
diff --git a/algorithms-modules/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/minimax/MinimaxUnitTest.java b/algorithms-modules/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/minimax/MinimaxUnitTest.java
index 59f0fcf053..e36e3651de 100644
--- a/algorithms-modules/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/minimax/MinimaxUnitTest.java
+++ b/algorithms-modules/algorithms-miscellaneous-1/src/test/java/com/baeldung/algorithms/minimax/MinimaxUnitTest.java
@@ -1,23 +1,24 @@
package com.baeldung.algorithms.minimax;
-import org.junit.Before;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.junit.Assert.*;
-import com.baeldung.algorithms.minimax.MiniMax;
-import com.baeldung.algorithms.minimax.Tree;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
-public class MinimaxUnitTest {
+class MinimaxUnitTest {
private Tree gameTree;
private MiniMax miniMax;
- @Before
+ @BeforeEach
public void initMiniMaxUtility() {
miniMax = new MiniMax();
}
@Test
- public void givenMiniMax_whenConstructTree_thenNotNullTree() {
+ void givenMiniMax_whenConstructTree_thenNotNullTree() {
assertNull(gameTree);
miniMax.constructTree(6);
gameTree = miniMax.getTree();
@@ -25,7 +26,7 @@ public class MinimaxUnitTest {
}
@Test
- public void givenMiniMax_whenCheckWin_thenComputeOptimal() {
+ void givenMiniMax_whenCheckWin_thenComputeOptimal() {
miniMax.constructTree(6);
boolean result = miniMax.checkWin();
assertTrue(result);
diff --git a/algorithms-modules/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/DijkstraAlgorithmLongRunningUnitTest.java b/algorithms-modules/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/DijkstraAlgorithmLongRunningUnitTest.java
index bbc4d4f398..7e80d335be 100644
--- a/algorithms-modules/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/DijkstraAlgorithmLongRunningUnitTest.java
+++ b/algorithms-modules/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/DijkstraAlgorithmLongRunningUnitTest.java
@@ -1,6 +1,6 @@
package com.baeldung.algorithms;
-import org.junit.Test;
+
import com.baeldung.algorithms.ga.dijkstra.Dijkstra;
import com.baeldung.algorithms.ga.dijkstra.Graph;
@@ -11,7 +11,9 @@ import java.util.List;
import static org.junit.Assert.assertTrue;
-public class DijkstraAlgorithmLongRunningUnitTest {
+import org.junit.jupiter.api.Test;
+
+class DijkstraAlgorithmLongRunningUnitTest {
@Test
public void whenSPPSolved_thenCorrect() {
diff --git a/algorithms-modules/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/underground/RouteFinderIntegrationTest.java b/algorithms-modules/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/underground/RouteFinderIntegrationTest.java
index aba7f149da..ba492b33cf 100644
--- a/algorithms-modules/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/underground/RouteFinderIntegrationTest.java
+++ b/algorithms-modules/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/astar/underground/RouteFinderIntegrationTest.java
@@ -1,5 +1,6 @@
package com.baeldung.algorithms.astar.underground;
+
import static org.assertj.core.api.Assertions.assertThat;
import java.util.HashMap;
@@ -10,22 +11,22 @@ import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
import com.baeldung.algorithms.astar.Graph;
import com.baeldung.algorithms.astar.RouteFinder;
import lombok.extern.slf4j.Slf4j;
-import org.junit.Before;
-import org.junit.Test;
-
@Slf4j
-public class RouteFinderIntegrationTest {
+class RouteFinderIntegrationTest {
private Graph underground;
private RouteFinder routeFinder;
- @Before
+ @BeforeEach
public void setUp() throws Exception {
Set stations = new HashSet<>();
Map> connections = new HashMap<>();
@@ -641,7 +642,7 @@ public class RouteFinderIntegrationTest {
}
@Test
- public void findRoute() {
+ void findRoute() {
List route = routeFinder.findRoute(underground.getNode("74"), underground.getNode("7"));
assertThat(route).size().isPositive();
diff --git a/algorithms-modules/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/editdistance/EditDistanceDataProvider.java b/algorithms-modules/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/editdistance/EditDistanceDataProvider.java
deleted file mode 100644
index d11da61191..0000000000
--- a/algorithms-modules/algorithms-miscellaneous-2/src/test/java/com/baeldung/algorithms/editdistance/EditDistanceDataProvider.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.baeldung.algorithms.editdistance;
-
-import org.junit.runners.Parameterized.Parameters;
-
-import java.util.Arrays;
-import java.util.Collection;
-
-public class EditDistanceDataProvider {
-
- @Parameters
- public static Collection