From fe9c78ceb8999b37477da54bf58566e5d4fe328c Mon Sep 17 00:00:00 2001 From: Sam Gardner Date: Thu, 28 Sep 2023 16:29:51 +0100 Subject: [PATCH 01/26] BAEL-6895 Add code for truncating a double to two decimal places --- .../TruncateDoubleUnitTest.java | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 core-java-modules/core-java-numbers-6/src/test/java/com/baeldung/truncatedouble/TruncateDoubleUnitTest.java diff --git a/core-java-modules/core-java-numbers-6/src/test/java/com/baeldung/truncatedouble/TruncateDoubleUnitTest.java b/core-java-modules/core-java-numbers-6/src/test/java/com/baeldung/truncatedouble/TruncateDoubleUnitTest.java new file mode 100644 index 0000000000..d5881c5d66 --- /dev/null +++ b/core-java-modules/core-java-numbers-6/src/test/java/com/baeldung/truncatedouble/TruncateDoubleUnitTest.java @@ -0,0 +1,69 @@ +package com.baeldung.truncatedouble; + +import static org.junit.Assert.assertEquals; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.DecimalFormat; +import java.text.NumberFormat; + +import org.junit.Test; + +public class TruncateDoubleUnitTest { + + @Test + public void givenADouble_whenUsingDecimalFormat_truncateToTwoDecimalPlaces() { + DecimalFormat df = new DecimalFormat("#.##"); + df.setRoundingMode(RoundingMode.DOWN); + + double value = 1.55555555; + String truncated = df.format(value); + assertEquals("1.55", truncated); + + double negativeValue = -1.55555555; + String negativeTruncated = df.format(negativeValue); + assertEquals("-1.55", negativeTruncated); + } + + @Test + public void givenADouble_whenUsingNumberFormat_truncateToTwoDecimalPlaces() { + NumberFormat nf = NumberFormat.getNumberInstance(); + nf.setMaximumFractionDigits(2); + nf.setRoundingMode(RoundingMode.DOWN); + + double value = 1.55555555; + String truncated = nf.format(value); + assertEquals("1.55", truncated); + + double negativeValue = -1.55555555; + String negativeTruncated = nf.format(negativeValue); + assertEquals("-1.55", negativeTruncated); + } + + @Test + public void givenADouble_whenUsingBigDecimal_truncateToTwoDecimalPlaces() { + BigDecimal positive = new BigDecimal(2.555555).setScale(2, RoundingMode.DOWN); + BigDecimal negative = new BigDecimal(-2.555555).setScale(2, RoundingMode.DOWN); + assertEquals("2.55", positive.toString()); + assertEquals("-2.55", negative.toString()); + } + + @Test + public void givenADouble_whenUsingMath_truncateToTwoDecimalPlaces() { + double positive = 1.55555555; + double truncated = Math.floor(positive * 100) / 100; + assertEquals("1.55", String.valueOf(truncated)); + + double negative = -1.55555555; + double negativeTruncated = Math.ceil(negative * 100) / 100; + assertEquals("-1.55", String.valueOf(negativeTruncated)); + } + + @Test + public void givenADouble_whenUsingStringFormat_truncateToTwoDecimalPlaces() { + double value = 1.55555555; + String truncated = String.format("%.2f", value); + assertEquals("1.56", truncated); + } + +} From d4d4a0e1a408eb9a2d9924101de37ab7919ec861 Mon Sep 17 00:00:00 2001 From: Sam Gardner Date: Wed, 11 Oct 2023 11:09:45 +0100 Subject: [PATCH 02/26] BAEL-6895 extend String format test to cover negatives --- .../baeldung/truncatedouble/TruncateDoubleUnitTest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core-java-modules/core-java-numbers-6/src/test/java/com/baeldung/truncatedouble/TruncateDoubleUnitTest.java b/core-java-modules/core-java-numbers-6/src/test/java/com/baeldung/truncatedouble/TruncateDoubleUnitTest.java index d5881c5d66..1bbca4069f 100644 --- a/core-java-modules/core-java-numbers-6/src/test/java/com/baeldung/truncatedouble/TruncateDoubleUnitTest.java +++ b/core-java-modules/core-java-numbers-6/src/test/java/com/baeldung/truncatedouble/TruncateDoubleUnitTest.java @@ -61,9 +61,13 @@ public class TruncateDoubleUnitTest { @Test public void givenADouble_whenUsingStringFormat_truncateToTwoDecimalPlaces() { - double value = 1.55555555; - String truncated = String.format("%.2f", value); + double positive = 1.55555555; + String truncated = String.format("%.2f", positive); assertEquals("1.56", truncated); + + double negative = -1.55555555; + String negativeTruncated = String.format("%.2f", negative); + assertEquals("-1.56", negativeTruncated); } } From 06943519f841b3cb0fb3ef07348921e7528d0a02 Mon Sep 17 00:00:00 2001 From: "emanuel.trandafir" Date: Sat, 14 Oct 2023 13:06:31 +0200 Subject: [PATCH 03/26] BAEL-7001: retry RetryCompletableFuture --- .../retry/RetryCompletableFuture.java | 63 +++++++++ .../retry/RetryCompletableFutureUnitTest.java | 125 ++++++++++++++++++ 2 files changed, 188 insertions(+) create mode 100644 core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/completablefuture/retry/RetryCompletableFuture.java create mode 100644 core-java-modules/core-java-concurrency-basic-3/src/test/java/com/baeldung/concurrent/completablefuture/retry/RetryCompletableFutureUnitTest.java diff --git a/core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/completablefuture/retry/RetryCompletableFuture.java b/core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/completablefuture/retry/RetryCompletableFuture.java new file mode 100644 index 0000000000..41f1309311 --- /dev/null +++ b/core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/completablefuture/retry/RetryCompletableFuture.java @@ -0,0 +1,63 @@ +package com.baeldung.concurrent.completablefuture.retry; + +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; +import java.util.function.Supplier; + +public class RetryCompletableFuture { + public static CompletableFuture retryTask(Supplier supplier, int maxRetries) { + Supplier retryableSupplier = retryFunction(supplier, maxRetries); + return CompletableFuture.supplyAsync(retryableSupplier); + } + + static Supplier retryFunction(Supplier supplier, int maxRetries) { + return () -> { + int retries = 0; + while (retries < maxRetries) { + try { + return supplier.get(); + } catch (Exception e) { + retries++; + } + } + throw new IllegalStateException(String.format("Task failed after %s attempts", maxRetries)); + }; + } + + public static CompletableFuture retryUnsafe(Supplier supplier, int maxRetries) { + CompletableFuture cf = CompletableFuture.supplyAsync(supplier); + sleep(100l); + for (int i = 0; i < maxRetries; i++) { + cf = cf.exceptionally(__ -> supplier.get()); + } + return cf; + } + + public static CompletableFuture retryNesting(Supplier supplier, int maxRetries) { + CompletableFuture cf = CompletableFuture.supplyAsync(supplier); + sleep(100); + for (int i = 0; i < maxRetries; i++) { + cf = cf.thenApply(CompletableFuture::completedFuture) + .exceptionally(__ -> CompletableFuture.supplyAsync(supplier)) + .thenCompose(Function.identity()); + } + return cf; + } + + public static CompletableFuture retryExceptionallyAsync(Supplier supplier, int maxRetries) { + CompletableFuture cf = CompletableFuture.supplyAsync(supplier); + sleep(100); + for (int i = 0; i < maxRetries; i++) { + cf = cf.exceptionallyAsync(__ -> supplier.get()); + } + return cf; + } + + private static void sleep(long millis) { + try { + Thread.sleep(millis); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + } +} diff --git a/core-java-modules/core-java-concurrency-basic-3/src/test/java/com/baeldung/concurrent/completablefuture/retry/RetryCompletableFutureUnitTest.java b/core-java-modules/core-java-concurrency-basic-3/src/test/java/com/baeldung/concurrent/completablefuture/retry/RetryCompletableFutureUnitTest.java new file mode 100644 index 0000000000..b48039d4a6 --- /dev/null +++ b/core-java-modules/core-java-concurrency-basic-3/src/test/java/com/baeldung/concurrent/completablefuture/retry/RetryCompletableFutureUnitTest.java @@ -0,0 +1,125 @@ +package com.baeldung.concurrent.completablefuture.retry; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionException; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.Supplier; + +import static com.baeldung.concurrent.completablefuture.retry.RetryCompletableFuture.*; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + +class RetryCompletableFutureUnitTest { + private AtomicInteger retriesCounter = new AtomicInteger(0); + + @BeforeEach + void beforeEach() { + retriesCounter.set(0); + } + + @Test + void whenRetryingTask_thenReturnsCorrectlyAfterFourInvocations() { + Supplier codeToRun = () -> failFourTimesThenReturn(100); + + CompletableFuture result = retryTask(codeToRun, 10); + + assertThat(result.join()) + .isEqualTo(100); + assertThat(retriesCounter) + .hasValue(4); + } + + @Test + void whenRetryingTask_thenThrowsExceptionAfterThreeInvocations() { + Supplier codeToRun = () -> failFourTimesThenReturn(100); + + CompletableFuture result = retryTask(codeToRun, 3); + + assertThatThrownBy(result::join) + .isInstanceOf(CompletionException.class) + .hasMessageContaining("IllegalStateException: Task failed after 3 attempts"); + } + + @Test + void whenRetryingExceptionally_thenReturnsCorrectlyAfterFourInvocations() { + Supplier codeToRun = () -> failFourTimesThenReturn(100); + + CompletableFuture result = retryUnsafe(codeToRun, 10); + + assertThat(result.join()) + .isEqualTo(100); + assertThat(retriesCounter) + .hasValue(4); + } + + @Test + void whenRetryingExceptionally_thenThrowsExceptionAfterThreeInvocations() { + Supplier codeToRun = () -> failFourTimesThenReturn(100); + + CompletableFuture result = retryUnsafe(codeToRun, 3); + + assertThatThrownBy(result::join) + .isInstanceOf(CompletionException.class) + .hasMessageContaining("RuntimeException: task failed for 3 time(s)"); + } + + @Test + void whenRetryingExceptionallyAsync_thenReturnsCorrectlyAfterFourInvocations() { + Supplier codeToRun = () -> failFourTimesThenReturn(100); + + CompletableFuture result = retryExceptionallyAsync(codeToRun, 10); + + assertThat(result.join()) + .isEqualTo(100); + assertThat(retriesCounter) + .hasValue(4); + } + + @Test + void whenRetryingExceptionallyAsync_thenThrowsExceptionAfterThreeInvocations() { + Supplier codeToRun = () -> failFourTimesThenReturn(100); + + CompletableFuture result = retryExceptionallyAsync(codeToRun, 3); + + assertThatThrownBy(result::join) + .isInstanceOf(CompletionException.class) + .hasMessageContaining("RuntimeException: task failed for 3 time(s)"); + } + + @Test + void whenRetryingNesting_thenReturnsCorrectlyAfterFourInvocations() { + Supplier codeToRun = () -> failFourTimesThenReturn(100); + + CompletableFuture result = retryNesting(codeToRun, 10); + + assertThat(result.join()) + .isEqualTo(100); + assertThat(retriesCounter) + .hasValue(4); + } + + @Test + void whenRetryingNesting_thenThrowsExceptionAfterThreeInvocations() { + Supplier codeToRun = () -> failFourTimesThenReturn(100); + + CompletableFuture result = retryNesting(codeToRun, 3); + + assertThatThrownBy(result::join) + .isInstanceOf(CompletionException.class) + .hasMessageContaining("RuntimeException: task failed for 3 time(s)"); + } + + int failFourTimesThenReturn(int returnValue) { + int retryNr = retriesCounter.get(); + System.out.println(String.format("invocation: %s, thread: %s", retryNr, Thread.currentThread().getName())); + if (retryNr < 4) { + retriesCounter.set(retryNr + 1); + throw new RuntimeException(String.format("task failed for %s time(s)", retryNr)); + } + return returnValue; + } + +} From 4cd426bb149c68448547c08622bf29e6f00887a7 Mon Sep 17 00:00:00 2001 From: Thibault Faure Date: Thu, 12 Oct 2023 20:52:32 +0200 Subject: [PATCH 04/26] BAEL-7107 Code for the article Arrays mismatch method in Java --- .../README.md | 5 + .../pom.xml | 16 ++ .../array/mismatch/ArrayMismatchUnitTest.java | 269 ++++++++++++++++++ core-java-modules/pom.xml | 1 + 4 files changed, 291 insertions(+) create mode 100644 core-java-modules/core-java-arrays-operations-basic-2/README.md create mode 100644 core-java-modules/core-java-arrays-operations-basic-2/pom.xml create mode 100644 core-java-modules/core-java-arrays-operations-basic-2/src/test/java/com/baeldung/array/mismatch/ArrayMismatchUnitTest.java diff --git a/core-java-modules/core-java-arrays-operations-basic-2/README.md b/core-java-modules/core-java-arrays-operations-basic-2/README.md new file mode 100644 index 0000000000..da2f17111f --- /dev/null +++ b/core-java-modules/core-java-arrays-operations-basic-2/README.md @@ -0,0 +1,5 @@ +## Core Java Arrays - Basic Operations + +This module contains articles about Java array fundamentals. They assume no previous background knowledge on working with arrays. + +### Relevant Articles: diff --git a/core-java-modules/core-java-arrays-operations-basic-2/pom.xml b/core-java-modules/core-java-arrays-operations-basic-2/pom.xml new file mode 100644 index 0000000000..7257a39462 --- /dev/null +++ b/core-java-modules/core-java-arrays-operations-basic-2/pom.xml @@ -0,0 +1,16 @@ + + + 4.0.0 + core-java-arrays-operations-basic-2 + core-java-arrays-operations-basic-2 + jar + + + core-java-modules + com.baeldung.core-java-modules + 0.0.1-SNAPSHOT + + + \ No newline at end of file diff --git a/core-java-modules/core-java-arrays-operations-basic-2/src/test/java/com/baeldung/array/mismatch/ArrayMismatchUnitTest.java b/core-java-modules/core-java-arrays-operations-basic-2/src/test/java/com/baeldung/array/mismatch/ArrayMismatchUnitTest.java new file mode 100644 index 0000000000..464221efd0 --- /dev/null +++ b/core-java-modules/core-java-arrays-operations-basic-2/src/test/java/com/baeldung/array/mismatch/ArrayMismatchUnitTest.java @@ -0,0 +1,269 @@ +package com.baeldung.array.mismatch; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import java.util.Arrays; +import java.util.Comparator; + +import org.junit.jupiter.api.Test; + +class ArrayMismatchUnitTest { + + @Test + void givenTwoArraysWithACommonPrefix_whenMismatch_thenIndexOfFirstMismatch() { + int[] firstArray = {1, 2, 3, 4, 5}; + int[] secondArray = {1, 2, 3, 5, 8}; + assertEquals(3, Arrays.mismatch(firstArray, secondArray)); + } + + @Test + void givenTwoIdenticalArrays_whenMismatch_thenMinusOne() { + int[] firstArray = {1, 2, 3, 4, 5}; + int[] secondArray = {1, 2, 3, 4, 5}; + assertEquals(-1, Arrays.mismatch(firstArray, secondArray)); + } + + @Test + void givenFirstArrayIsAPrefixOfTheSecond_whenMismatch_thenFirstArrayLength() { + int[] firstArray = {1, 2, 3, 4, 5}; + int[] secondArray = {1, 2, 3, 4, 5, 6, 7, 8, 9}; + assertEquals(firstArray.length, Arrays.mismatch(firstArray, secondArray)); + } + + @Test + void givenNoCommonPrefix_whenMismatch_thenZero() { + int[] firstArray = {1, 2, 3, 4, 5}; + int[] secondArray = {9, 8, 7}; + assertEquals(0, Arrays.mismatch(firstArray, secondArray)); + } + + @Test + void givenAtLeastANullArray_whenMismatch_thenThrowsNullPointerException() { + int[] firstArray = null; + int[] secondArray = {1, 2, 3, 4, 5}; + assertThrows(NullPointerException.class, () -> Arrays.mismatch(firstArray, secondArray)); + assertThrows(NullPointerException.class, () -> Arrays.mismatch(secondArray, firstArray)); + assertThrows(NullPointerException.class, () -> Arrays.mismatch(firstArray, firstArray)); + } + + @Test + void givenExactlyOneAnEmptyArray_whenMismatch_thenZero() { + int[] firstArray = {}; + int[] secondArray = {1, 2, 3}; + assertEquals(0, Arrays.mismatch(firstArray, secondArray)); + assertEquals(0, Arrays.mismatch(secondArray, firstArray)); + } + + @Test + void givenTwoEmptyArrays_whenMismatch_thenMinusOne() { + assertEquals(-1, Arrays.mismatch(new int[] {}, new int[] {})); + } + + @Test + void givenTwoSubArraysWithACommonPrefix_whenMismatch_thenIndexOfFirstMismatch() { + int[] firstArray = {1, 2, 3, 4, 5}; + int[] secondArray = {0, 1, 2, 3, 5, 8}; + assertEquals(3, Arrays.mismatch(firstArray, 0, 4, secondArray, 1, 6)); + } + + @Test + void givenTwoIdenticalSubArrays_whenMismatch_thenMinusOne() { + int[] firstArray = {0, 0, 1, 2}; + int[] secondArray = {0, 1, 2, 3, 4}; + assertEquals(-1, Arrays.mismatch(firstArray, 2, 4, secondArray, 1, 3)); + } + + @Test + void givenFirstSubArrayIsAPrefixOfTheSecond_whenMismatch_thenFirstArrayLength() { + int[] firstArray = {2, 3, 4, 5, 4, 3, 2}; + int[] secondArray = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + assertEquals(4, Arrays.mismatch(firstArray, 0, 4, secondArray, 2, 9)); + } + + @Test + void givenNoCommonPrefixForSubArrays_whenMismatch_thenZero() { + int[] firstArray = {0, 0, 0, 0, 0}; + int[] secondArray = {9, 8, 7, 6, 5}; + assertEquals(0, Arrays.mismatch(firstArray, 1, 2, secondArray, 1, 2)); + } + + @Test + void givenAtLeastANullSubArray_whenMismatch_thenThrowsNullPointerException() { + int[] firstArray = null; + int[] secondArray = {1, 2, 3, 4, 5}; + assertThrows(NullPointerException.class, () -> Arrays.mismatch(firstArray, 0, 1, secondArray, 0, 1)); + assertThrows(NullPointerException.class, () -> Arrays.mismatch(secondArray, 0, 1, firstArray, 0, 1)); + assertThrows(NullPointerException.class, () -> Arrays.mismatch(firstArray, 0, 1, firstArray, 0, 1)); + } + + @Test + void givenExactlyOneEmptySubArray_whenMismatch_thenZero() { + int[] firstArray = {1}; + int[] secondArray = {1, 2, 3}; + assertEquals(0, Arrays.mismatch(firstArray, 0, 0, secondArray, 0, 2)); + assertEquals(0, Arrays.mismatch(firstArray, 0, 1, secondArray, 2, 2)); + } + + @Test + void givenTwoEmptySubArrays_whenMismatch_thenMinusOne() { + int[] firstArray = {1}; + int[] secondArray = {1, 2, 3}; + assertEquals(-1, Arrays.mismatch(firstArray, 0, 0, secondArray, 2, 2)); + } + + @Test + void givenToIndexGreaterThanFromIndex_whenMismatch_thenThrowsIllegalArgumentException() { + int[] firstArray = {2, 3, 4, 5, 4, 3, 2}; + int[] secondArray = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + assertThrows(IllegalArgumentException.class, () -> Arrays.mismatch(firstArray, 4, 2, secondArray, 0, 6)); + assertThrows(IllegalArgumentException.class, () -> Arrays.mismatch(firstArray, 2, 3, secondArray, 6, 0)); + } + + @Test + void givenIllegalIndexes_whenMismatch_thenThrowsArrayIndexOutOfBoundsException() { + int[] firstArray = {2, 3, 4, 5, 4, 3, 2}; + int[] secondArray = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + assertThrows(ArrayIndexOutOfBoundsException.class, () -> Arrays.mismatch(firstArray, -1, 2, secondArray, 0, 6)); + assertThrows(ArrayIndexOutOfBoundsException.class, () -> Arrays.mismatch(firstArray, 0, 8, secondArray, 0, 6)); + assertThrows(ArrayIndexOutOfBoundsException.class, () -> Arrays.mismatch(firstArray, 2, 3, secondArray, -5, 0)); + assertThrows(ArrayIndexOutOfBoundsException.class, () -> Arrays.mismatch(firstArray, 2, 3, secondArray, 11, 12)); + } + + @Test + void givenTwoStringArraysAndAComparator_whenMismatch_thenIndexOfFirstMismatch() { + String[] firstArray = {"one", "two", "three"}; + String[] secondArray = {"ONE", "TWO", "FOUR"}; + Comparator comparator = String.CASE_INSENSITIVE_ORDER; + assertEquals(2, Arrays.mismatch(firstArray, secondArray, comparator)); + } + + @Test + void givenTwoIdenticalStringArraysForTheComparator_whenMismatch_thenMinusOne() { + String[] firstArray = {"one", "two", "three"}; + String[] secondArray = {"ONE", "TWO", "THREE"}; + Comparator comparator = String.CASE_INSENSITIVE_ORDER; + assertEquals(-1, Arrays.mismatch(firstArray, secondArray, comparator)); + } + + @Test + void givenFirstStringArrayIsAPrefixOfTheSecondForTheComparator_whenMismatch_thenFirstArrayLength() { + String[] firstArray = {"one", "two", "three"}; + String[] secondArray = {"ONE", "TWO", "THREE", "FOUR", "FIVE"}; + Comparator comparator = String.CASE_INSENSITIVE_ORDER; + assertEquals(firstArray.length, Arrays.mismatch(firstArray, secondArray, comparator)); + } + + @Test + void givenNoCommonPrefixForTheComparator_whenMismatch_thenZero() { + String[] firstArray = {"one", "two", "three"}; + String[] secondArray = {"six", "seven", "eight"}; + Comparator comparator = String.CASE_INSENSITIVE_ORDER; + assertEquals(0, Arrays.mismatch(firstArray, secondArray, comparator)); + } + + @Test + void givenAtLeastANullArrayOrNullComparator_whenMismatch_thenThrowsNullPointerException() { + String[] firstArray = null; + String[] secondArray = {"one"}; + Comparator comparator = String.CASE_INSENSITIVE_ORDER; + assertThrows(NullPointerException.class, () -> Arrays.mismatch(firstArray, secondArray, comparator)); + assertThrows(NullPointerException.class, () -> Arrays.mismatch(secondArray, firstArray, comparator)); + assertThrows(NullPointerException.class, () -> Arrays.mismatch(secondArray, secondArray, null)); + } + + @Test + void givenExactlyOneAnEmptyArrayAndAComparator_whenMismatch_thenZero() { + String[] firstArray = {}; + String[] secondArray = {"one"}; + Comparator comparator = String.CASE_INSENSITIVE_ORDER; + assertEquals(0, Arrays.mismatch(firstArray, secondArray, comparator)); + assertEquals(0, Arrays.mismatch(secondArray, firstArray, comparator)); + } + + @Test + void givenTwoEmptyStringArraysForTheComparator_whenMismatch_thenMinusOne() { + assertEquals(-1, Arrays.mismatch(new String[] {}, new String[] {}, String.CASE_INSENSITIVE_ORDER)); + } + + @Test + void givenTwoStringSubarraysAndAComparator_whenMismatch_thenIndexOfFirstMismatch() { + String[] firstArray = {"one", "two", "three", "four"}; + String[] secondArray = {"ZERO", "ONE", "TWO", "FOUR", "EIGHT", "SIXTEEN"}; + Comparator comparator = String.CASE_INSENSITIVE_ORDER; + assertEquals(2, Arrays.mismatch(firstArray, 0, 4, secondArray, 1, 3, comparator)); + } + + @Test + void givenTwoIdenticalStringSubArraysForTheComparator_whenMismatch_thenMinusOne() { + String[] firstArray = {"zero", "zero", "one", "two"}; + String[] secondArray = {"zero", "one", "two", "three", "four"}; + Comparator comparator = String.CASE_INSENSITIVE_ORDER; + assertEquals(-1, Arrays.mismatch(firstArray, 2, 4, secondArray, 1, 3, comparator)); + } + + @Test + void givenFirstSubArrayIsAPrefixOfTheSecondForTheComparator_whenMismatch_thenFirstArrayLength() { + String[] firstArray = {"two", "three", "four", "five", "four", "three", "two"}; + String[] secondArray = {"ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE", "EIGHT", "NINE", "TEN"}; + Comparator comparator = String.CASE_INSENSITIVE_ORDER; + assertEquals(4, Arrays.mismatch(firstArray, 0, 4, secondArray, 2, 9, comparator)); + } + + @Test + void givenNoCommonPrefixForSubArraysForTheComparator_whenMismatch_thenZero() { + String[] firstArray = {"zero", "one"}; + String[] secondArray = {"TEN", "ELEVEN", "TWELVE"}; + Comparator comparator = String.CASE_INSENSITIVE_ORDER; + assertEquals(0, Arrays.mismatch(firstArray, 1, 2, secondArray, 1, 2, comparator)); + } + + @Test + void givenAtLeastANullSubArrayOrNullComparator_whenMismatch_thenThrowsNullPointerException() { + String[] firstArray = null; + String[] secondArray = {"ONE", "TWO", "THREE", "FOUR", "FIVE"}; + Comparator comparator = String.CASE_INSENSITIVE_ORDER; + assertThrows(NullPointerException.class, () -> Arrays.mismatch(firstArray, 0, 1, secondArray, 0, 1, comparator)); + assertThrows(NullPointerException.class, () -> Arrays.mismatch(secondArray, 0, 1, firstArray, 0, 1, comparator)); + assertThrows(NullPointerException.class, () -> Arrays.mismatch(firstArray, 0, 1, firstArray, 0, 1, comparator)); + assertThrows(NullPointerException.class, () -> Arrays.mismatch(secondArray, 0, 1, secondArray, 0, 1, null)); + } + + @Test + void givenExactlyOneEmptySubArrayAndAComparator_whenMismatch_thenZero() { + String[] firstArray = {"one"}; + String[] secondArray = {"ONE", "TWO", "THREE"}; + Comparator comparator = String.CASE_INSENSITIVE_ORDER; + assertEquals(0, Arrays.mismatch(firstArray, 0, 0, secondArray, 0, 2, comparator)); + assertEquals(0, Arrays.mismatch(firstArray, 0, 1, secondArray, 2, 2, comparator)); + } + + @Test + void givenTwoEmptySubArraysAndAComparator_whenMismatch_thenMinusOne() { + String[] firstArray = {"one"}; + String[] secondArray = {"ONE", "TWO", "THREE"}; + Comparator comparator = String.CASE_INSENSITIVE_ORDER; + assertEquals(-1, Arrays.mismatch(firstArray, 0, 0, secondArray, 2, 2, comparator)); + } + + @Test + void givenToIndexGreaterThanFromIndexAndAComparator_whenMismatch_thenThrowsIllegalArgumentException() { + String[] firstArray = {"two", "three", "four", "five", "four", "three", "two"}; + String[] secondArray = {"ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE", "EIGHT", "NINE", "TEN"}; + Comparator comparator = String.CASE_INSENSITIVE_ORDER; + assertThrows(IllegalArgumentException.class, () -> Arrays.mismatch(firstArray, 4, 2, secondArray, 0, 6, comparator)); + assertThrows(IllegalArgumentException.class, () -> Arrays.mismatch(firstArray, 2, 3, secondArray, 6, 0, comparator)); + } + + @Test + void givenIllegalIndexesAndAComparator_whenMismatch_thenThrowsArrayIndexOutOfBoundsException() { + String[] firstArray = {"two", "three", "four", "five", "four", "three", "two"}; + String[] secondArray = {"ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE", "EIGHT", "NINE", "TEN"}; + Comparator comparator = String.CASE_INSENSITIVE_ORDER; + assertThrows(ArrayIndexOutOfBoundsException.class, () -> Arrays.mismatch(firstArray, -1, 2, secondArray, 0, 6, comparator)); + assertThrows(ArrayIndexOutOfBoundsException.class, () -> Arrays.mismatch(firstArray, 0, 8, secondArray, 0, 6, comparator)); + assertThrows(ArrayIndexOutOfBoundsException.class, () -> Arrays.mismatch(firstArray, 2, 3, secondArray, -5, 0, comparator)); + assertThrows(ArrayIndexOutOfBoundsException.class, () -> Arrays.mismatch(firstArray, 2, 3, secondArray, 11, 12, comparator)); + } + +} diff --git a/core-java-modules/pom.xml b/core-java-modules/pom.xml index 2152b90bcb..bf5b90cd32 100644 --- a/core-java-modules/pom.xml +++ b/core-java-modules/pom.xml @@ -73,6 +73,7 @@ core-java-arrays-multidimensional core-java-arrays-convert core-java-arrays-operations-basic + core-java-arrays-operations-basic-2 core-java-arrays-operations-advanced core-java-arrays-operations-advanced-2 core-java-booleans From 210eaf2c0b77fb1bd366cbd2040d5ac0376d81de Mon Sep 17 00:00:00 2001 From: emanueltrandafir1993 Date: Mon, 23 Oct 2023 18:07:43 +0200 Subject: [PATCH 05/26] BAEL-7001: fixed formatting --- .../retry/RetryCompletableFuture.java | 100 +++++----- .../retry/RetryCompletableFutureUnitTest.java | 176 +++++++++--------- 2 files changed, 139 insertions(+), 137 deletions(-) diff --git a/core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/completablefuture/retry/RetryCompletableFuture.java b/core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/completablefuture/retry/RetryCompletableFuture.java index 41f1309311..a3df6b3624 100644 --- a/core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/completablefuture/retry/RetryCompletableFuture.java +++ b/core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/completablefuture/retry/RetryCompletableFuture.java @@ -5,59 +5,59 @@ import java.util.function.Function; import java.util.function.Supplier; public class RetryCompletableFuture { - public static CompletableFuture retryTask(Supplier supplier, int maxRetries) { - Supplier retryableSupplier = retryFunction(supplier, maxRetries); - return CompletableFuture.supplyAsync(retryableSupplier); - } + public static CompletableFuture retryTask(Supplier supplier, int maxRetries) { + Supplier retryableSupplier = retryFunction(supplier, maxRetries); + return CompletableFuture.supplyAsync(retryableSupplier); + } - static Supplier retryFunction(Supplier supplier, int maxRetries) { - return () -> { - int retries = 0; - while (retries < maxRetries) { - try { - return supplier.get(); - } catch (Exception e) { - retries++; - } - } - throw new IllegalStateException(String.format("Task failed after %s attempts", maxRetries)); - }; - } + static Supplier retryFunction(Supplier supplier, int maxRetries) { + return () -> { + int retries = 0; + while (retries < maxRetries) { + try { + return supplier.get(); + } catch (Exception e) { + retries++; + } + } + throw new IllegalStateException(String.format("Task failed after %s attempts", maxRetries)); + }; + } - public static CompletableFuture retryUnsafe(Supplier supplier, int maxRetries) { - CompletableFuture cf = CompletableFuture.supplyAsync(supplier); - sleep(100l); - for (int i = 0; i < maxRetries; i++) { - cf = cf.exceptionally(__ -> supplier.get()); - } - return cf; - } + public static CompletableFuture retryUnsafe(Supplier supplier, int maxRetries) { + CompletableFuture cf = CompletableFuture.supplyAsync(supplier); + sleep(100l); + for (int i = 0; i < maxRetries; i++) { + cf = cf.exceptionally(__ -> supplier.get()); + } + return cf; + } - public static CompletableFuture retryNesting(Supplier supplier, int maxRetries) { - CompletableFuture cf = CompletableFuture.supplyAsync(supplier); - sleep(100); - for (int i = 0; i < maxRetries; i++) { - cf = cf.thenApply(CompletableFuture::completedFuture) - .exceptionally(__ -> CompletableFuture.supplyAsync(supplier)) - .thenCompose(Function.identity()); - } - return cf; - } + public static CompletableFuture retryNesting(Supplier supplier, int maxRetries) { + CompletableFuture cf = CompletableFuture.supplyAsync(supplier); + sleep(100); + for (int i = 0; i < maxRetries; i++) { + cf = cf.thenApply(CompletableFuture::completedFuture) + .exceptionally(__ -> CompletableFuture.supplyAsync(supplier)) + .thenCompose(Function.identity()); + } + return cf; + } - public static CompletableFuture retryExceptionallyAsync(Supplier supplier, int maxRetries) { - CompletableFuture cf = CompletableFuture.supplyAsync(supplier); - sleep(100); - for (int i = 0; i < maxRetries; i++) { - cf = cf.exceptionallyAsync(__ -> supplier.get()); - } - return cf; - } + public static CompletableFuture retryExceptionallyAsync(Supplier supplier, int maxRetries) { + CompletableFuture cf = CompletableFuture.supplyAsync(supplier); + sleep(100); + for (int i = 0; i < maxRetries; i++) { + cf = cf.exceptionallyAsync(__ -> supplier.get()); + } + return cf; + } - private static void sleep(long millis) { - try { - Thread.sleep(millis); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } - } + private static void sleep(long millis) { + try { + Thread.sleep(millis); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + } } diff --git a/core-java-modules/core-java-concurrency-basic-3/src/test/java/com/baeldung/concurrent/completablefuture/retry/RetryCompletableFutureUnitTest.java b/core-java-modules/core-java-concurrency-basic-3/src/test/java/com/baeldung/concurrent/completablefuture/retry/RetryCompletableFutureUnitTest.java index b48039d4a6..ce847fe751 100644 --- a/core-java-modules/core-java-concurrency-basic-3/src/test/java/com/baeldung/concurrent/completablefuture/retry/RetryCompletableFutureUnitTest.java +++ b/core-java-modules/core-java-concurrency-basic-3/src/test/java/com/baeldung/concurrent/completablefuture/retry/RetryCompletableFutureUnitTest.java @@ -1,125 +1,127 @@ package com.baeldung.concurrent.completablefuture.retry; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static com.baeldung.concurrent.completablefuture.retry.RetryCompletableFuture.retryExceptionallyAsync; +import static com.baeldung.concurrent.completablefuture.retry.RetryCompletableFuture.retryNesting; +import static com.baeldung.concurrent.completablefuture.retry.RetryCompletableFuture.retryTask; +import static com.baeldung.concurrent.completablefuture.retry.RetryCompletableFuture.retryUnsafe; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Supplier; -import static com.baeldung.concurrent.completablefuture.retry.RetryCompletableFuture.*; -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; class RetryCompletableFutureUnitTest { - private AtomicInteger retriesCounter = new AtomicInteger(0); + private AtomicInteger retriesCounter = new AtomicInteger(0); - @BeforeEach - void beforeEach() { - retriesCounter.set(0); - } + @BeforeEach + void beforeEach() { + retriesCounter.set(0); + } - @Test - void whenRetryingTask_thenReturnsCorrectlyAfterFourInvocations() { - Supplier codeToRun = () -> failFourTimesThenReturn(100); + @Test + void whenRetryingTask_thenReturnsCorrectlyAfterFourInvocations() { + Supplier codeToRun = () -> failFourTimesThenReturn(100); - CompletableFuture result = retryTask(codeToRun, 10); + CompletableFuture result = retryTask(codeToRun, 10); - assertThat(result.join()) - .isEqualTo(100); - assertThat(retriesCounter) - .hasValue(4); - } + assertThat(result.join()) + .isEqualTo(100); + assertThat(retriesCounter) + .hasValue(4); + } - @Test - void whenRetryingTask_thenThrowsExceptionAfterThreeInvocations() { - Supplier codeToRun = () -> failFourTimesThenReturn(100); + @Test + void whenRetryingTask_thenThrowsExceptionAfterThreeInvocations() { + Supplier codeToRun = () -> failFourTimesThenReturn(100); - CompletableFuture result = retryTask(codeToRun, 3); + CompletableFuture result = retryTask(codeToRun, 3); - assertThatThrownBy(result::join) - .isInstanceOf(CompletionException.class) - .hasMessageContaining("IllegalStateException: Task failed after 3 attempts"); - } + assertThatThrownBy(result::join).isInstanceOf(CompletionException.class) + .hasMessageContaining("IllegalStateException: Task failed after 3 attempts"); + } - @Test - void whenRetryingExceptionally_thenReturnsCorrectlyAfterFourInvocations() { - Supplier codeToRun = () -> failFourTimesThenReturn(100); + @Test + void whenRetryingExceptionally_thenReturnsCorrectlyAfterFourInvocations() { + Supplier codeToRun = () -> failFourTimesThenReturn(100); - CompletableFuture result = retryUnsafe(codeToRun, 10); + CompletableFuture result = retryUnsafe(codeToRun, 10); - assertThat(result.join()) - .isEqualTo(100); - assertThat(retriesCounter) - .hasValue(4); - } + assertThat(result.join()) + .isEqualTo(100); + assertThat(retriesCounter) + .hasValue(4); + } - @Test - void whenRetryingExceptionally_thenThrowsExceptionAfterThreeInvocations() { - Supplier codeToRun = () -> failFourTimesThenReturn(100); + @Test + void whenRetryingExceptionally_thenThrowsExceptionAfterThreeInvocations() { + Supplier codeToRun = () -> failFourTimesThenReturn(100); - CompletableFuture result = retryUnsafe(codeToRun, 3); + CompletableFuture result = retryUnsafe(codeToRun, 3); - assertThatThrownBy(result::join) - .isInstanceOf(CompletionException.class) - .hasMessageContaining("RuntimeException: task failed for 3 time(s)"); - } + assertThatThrownBy(result::join) + .isInstanceOf(CompletionException.class) + .hasMessageContaining("RuntimeException: task failed for 3 time(s)"); + } - @Test - void whenRetryingExceptionallyAsync_thenReturnsCorrectlyAfterFourInvocations() { - Supplier codeToRun = () -> failFourTimesThenReturn(100); + @Test + void whenRetryingExceptionallyAsync_thenReturnsCorrectlyAfterFourInvocations() { + Supplier codeToRun = () -> failFourTimesThenReturn(100); - CompletableFuture result = retryExceptionallyAsync(codeToRun, 10); + CompletableFuture result = retryExceptionallyAsync(codeToRun, 10); - assertThat(result.join()) - .isEqualTo(100); - assertThat(retriesCounter) - .hasValue(4); - } + assertThat(result.join()) + .isEqualTo(100); + assertThat(retriesCounter) + .hasValue(4); + } - @Test - void whenRetryingExceptionallyAsync_thenThrowsExceptionAfterThreeInvocations() { - Supplier codeToRun = () -> failFourTimesThenReturn(100); + @Test + void whenRetryingExceptionallyAsync_thenThrowsExceptionAfterThreeInvocations() { + Supplier codeToRun = () -> failFourTimesThenReturn(100); - CompletableFuture result = retryExceptionallyAsync(codeToRun, 3); + CompletableFuture result = retryExceptionallyAsync(codeToRun, 3); - assertThatThrownBy(result::join) - .isInstanceOf(CompletionException.class) - .hasMessageContaining("RuntimeException: task failed for 3 time(s)"); - } + assertThatThrownBy(result::join) + .isInstanceOf(CompletionException.class) + .hasMessageContaining("RuntimeException: task failed for 3 time(s)"); + } - @Test - void whenRetryingNesting_thenReturnsCorrectlyAfterFourInvocations() { - Supplier codeToRun = () -> failFourTimesThenReturn(100); + @Test + void whenRetryingNesting_thenReturnsCorrectlyAfterFourInvocations() { + Supplier codeToRun = () -> failFourTimesThenReturn(100); - CompletableFuture result = retryNesting(codeToRun, 10); + CompletableFuture result = retryNesting(codeToRun, 10); - assertThat(result.join()) - .isEqualTo(100); - assertThat(retriesCounter) - .hasValue(4); - } + assertThat(result.join()) + .isEqualTo(100); + assertThat(retriesCounter) + .hasValue(4); + } - @Test - void whenRetryingNesting_thenThrowsExceptionAfterThreeInvocations() { - Supplier codeToRun = () -> failFourTimesThenReturn(100); + @Test + void whenRetryingNesting_thenThrowsExceptionAfterThreeInvocations() { + Supplier codeToRun = () -> failFourTimesThenReturn(100); - CompletableFuture result = retryNesting(codeToRun, 3); + CompletableFuture result = retryNesting(codeToRun, 3); - assertThatThrownBy(result::join) - .isInstanceOf(CompletionException.class) - .hasMessageContaining("RuntimeException: task failed for 3 time(s)"); - } + assertThatThrownBy(result::join) + .isInstanceOf(CompletionException.class) + .hasMessageContaining("RuntimeException: task failed for 3 time(s)"); + } - int failFourTimesThenReturn(int returnValue) { - int retryNr = retriesCounter.get(); - System.out.println(String.format("invocation: %s, thread: %s", retryNr, Thread.currentThread().getName())); - if (retryNr < 4) { - retriesCounter.set(retryNr + 1); - throw new RuntimeException(String.format("task failed for %s time(s)", retryNr)); - } - return returnValue; - } + int failFourTimesThenReturn(int returnValue) { + int retryNr = retriesCounter.get(); + System.out.println(String.format("invocation: %s, thread: %s", retryNr, Thread.currentThread().getName())); + if (retryNr < 4) { + retriesCounter.set(retryNr + 1); + throw new RuntimeException(String.format("task failed for %s time(s)", retryNr)); + } + return returnValue; + } } From 5b4fc0d6f3753e8855d44da343dfba749118d123 Mon Sep 17 00:00:00 2001 From: emanueltrandafir1993 Date: Mon, 23 Oct 2023 18:13:35 +0200 Subject: [PATCH 06/26] BAEL-7001: small fix --- .../retry/RetryCompletableFutureUnitTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core-java-modules/core-java-concurrency-basic-3/src/test/java/com/baeldung/concurrent/completablefuture/retry/RetryCompletableFutureUnitTest.java b/core-java-modules/core-java-concurrency-basic-3/src/test/java/com/baeldung/concurrent/completablefuture/retry/RetryCompletableFutureUnitTest.java index ce847fe751..7f1ea41f92 100644 --- a/core-java-modules/core-java-concurrency-basic-3/src/test/java/com/baeldung/concurrent/completablefuture/retry/RetryCompletableFutureUnitTest.java +++ b/core-java-modules/core-java-concurrency-basic-3/src/test/java/com/baeldung/concurrent/completablefuture/retry/RetryCompletableFutureUnitTest.java @@ -41,7 +41,8 @@ class RetryCompletableFutureUnitTest { CompletableFuture result = retryTask(codeToRun, 3); - assertThatThrownBy(result::join).isInstanceOf(CompletionException.class) + assertThatThrownBy(result::join) + .isInstanceOf(CompletionException.class) .hasMessageContaining("IllegalStateException: Task failed after 3 attempts"); } From 46f3aac2995baaf5b466a7226fa7e60479dfb15c Mon Sep 17 00:00:00 2001 From: anuragkumawat Date: Tue, 24 Oct 2023 14:10:17 +0530 Subject: [PATCH 07/26] JAVA-26283 Improve module build time --- .../web/interceptor/SessionTimerInterceptorIntegrationTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-security-modules/spring-security-web-mvc-custom/src/test/java/com/baeldung/web/interceptor/SessionTimerInterceptorIntegrationTest.java b/spring-security-modules/spring-security-web-mvc-custom/src/test/java/com/baeldung/web/interceptor/SessionTimerInterceptorIntegrationTest.java index 07bc22f184..873c28c6a2 100644 --- a/spring-security-modules/spring-security-web-mvc-custom/src/test/java/com/baeldung/web/interceptor/SessionTimerInterceptorIntegrationTest.java +++ b/spring-security-modules/spring-security-web-mvc-custom/src/test/java/com/baeldung/web/interceptor/SessionTimerInterceptorIntegrationTest.java @@ -49,7 +49,7 @@ public class SessionTimerInterceptorIntegrationTest { .andReturn() .getRequest() .getSession(); - Thread.sleep(51000); + Thread.sleep(5000); mockMvc.perform(get("/auth/foos").session((MockHttpSession) session)) .andExpect(status().is2xxSuccessful()); } From 2b7e938e090500d2a970afae1d55f5edf95045b3 Mon Sep 17 00:00:00 2001 From: anuragkumawat Date: Tue, 24 Oct 2023 14:40:19 +0530 Subject: [PATCH 08/26] JAVA-26379 Change parent of spring-web-modules to parent-spring-5 --- spring-web-modules/pom.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spring-web-modules/pom.xml b/spring-web-modules/pom.xml index 9f03b83392..2be896ad83 100644 --- a/spring-web-modules/pom.xml +++ b/spring-web-modules/pom.xml @@ -10,8 +10,9 @@ com.baeldung - parent-modules - 1.0.0-SNAPSHOT + parent-spring-5 + 0.0.1-SNAPSHOT + ../parent-spring-5 From 6807803bd328c1c375a6697617ab7fb9c743a724 Mon Sep 17 00:00:00 2001 From: Saikat Chakraborty <40471715+saikatcse03@users.noreply.github.com> Date: Wed, 25 Oct 2023 17:10:55 +0530 Subject: [PATCH 09/26] Renamed file to skip test in jenkins (#14870) * Renamed file to skip test in jenkins * javadoc add --- .../cassandra/inquery/ProductRepositoryNestedLiveTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/persistence-modules/spring-data-cassandra-2/src/test/java/org/baeldung/cassandra/inquery/ProductRepositoryNestedLiveTest.java b/persistence-modules/spring-data-cassandra-2/src/test/java/org/baeldung/cassandra/inquery/ProductRepositoryNestedLiveTest.java index 3592c8b80d..3d99782afd 100644 --- a/persistence-modules/spring-data-cassandra-2/src/test/java/org/baeldung/cassandra/inquery/ProductRepositoryNestedLiveTest.java +++ b/persistence-modules/spring-data-cassandra-2/src/test/java/org/baeldung/cassandra/inquery/ProductRepositoryNestedLiveTest.java @@ -20,7 +20,9 @@ import java.util.UUID; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.*; - +/** + * This live test requires a running Docker instance so that a Cassandra container can be created + */ @Testcontainers @SpringBootTest class ProductRepositoryNestedLiveTest { From 69aaf2dbf72d13e5b76a8b8efe07cd0556302dbb Mon Sep 17 00:00:00 2001 From: Mo Helmy <135069400+BenHelmyBen@users.noreply.github.com> Date: Wed, 25 Oct 2023 19:10:28 +0300 Subject: [PATCH 10/26] This commit is related to the article BAEL-7089 (#15065) This commit aims to update the evenElementsQueue queue with oddElementsQueue. --- .../RemoveQueueElementsUnitTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core-java-modules/core-java-collections-5/src/test/java/com/baeldung/removequeueelements/RemoveQueueElementsUnitTest.java b/core-java-modules/core-java-collections-5/src/test/java/com/baeldung/removequeueelements/RemoveQueueElementsUnitTest.java index 66cfade866..38fdc58099 100644 --- a/core-java-modules/core-java-collections-5/src/test/java/com/baeldung/removequeueelements/RemoveQueueElementsUnitTest.java +++ b/core-java-modules/core-java-collections-5/src/test/java/com/baeldung/removequeueelements/RemoveQueueElementsUnitTest.java @@ -12,7 +12,7 @@ public class RemoveQueueElementsUnitTest { @Test public void givenQueueWithEvenAndOddNumbers_whenRemovingEvenNumbers_thenOddNumbersRemain() { Queue queue = new LinkedList<>(); - Queue evenElementsQueue = new LinkedList<>(); + Queue oddElementsQueue = new LinkedList<>(); queue.add(1); queue.add(2); queue.add(3); @@ -22,14 +22,14 @@ public class RemoveQueueElementsUnitTest { while (queue.peek() != null) { int element = queue.remove(); if (element % 2 != 0) { - evenElementsQueue.add(element); + oddElementsQueue.add(element); } } - assertEquals(3, evenElementsQueue.size()); - assertTrue(evenElementsQueue.contains(1)); - assertTrue(evenElementsQueue.contains(3)); - assertTrue(evenElementsQueue.contains(5)); + assertEquals(3, oddElementsQueue.size()); + assertTrue(oddElementsQueue.contains(1)); + assertTrue(oddElementsQueue.contains(3)); + assertTrue(oddElementsQueue.contains(5)); } @Test From f182b714a94aa0315dc770616f6af7a1b34b803a Mon Sep 17 00:00:00 2001 From: anuragkumawat Date: Wed, 25 Oct 2023 22:42:51 +0530 Subject: [PATCH 11/26] JAVA-26379 Fix failing test --- spring-web-modules/spring-mvc-xml-2/pom.xml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/spring-web-modules/spring-mvc-xml-2/pom.xml b/spring-web-modules/spring-mvc-xml-2/pom.xml index f4326ccf68..8c0062f538 100644 --- a/spring-web-modules/spring-mvc-xml-2/pom.xml +++ b/spring-web-modules/spring-mvc-xml-2/pom.xml @@ -19,12 +19,12 @@ org.springframework spring-web - ${org.springframework.version} + ${spring.version} org.springframework spring-webmvc - ${org.springframework.version} + ${spring.version} @@ -64,7 +64,7 @@ org.springframework.boot spring-boot-starter-test - ${spring-boot.version} + ${spring-boot-starter-test.version} test @@ -95,8 +95,6 @@ - 5.0.2.RELEASE - 1.5.10.RELEASE 5.1.40 4.4.5 4.5.2 From f5bb9479b455c4a2e4faebeeabeb95bcc7244690 Mon Sep 17 00:00:00 2001 From: emanueltrandafir1993 Date: Wed, 25 Oct 2023 19:53:50 +0200 Subject: [PATCH 12/26] MKT-7001: formatting --- .../retry/RetryCompletableFutureUnitTest.java | 32 +++++++------------ 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/core-java-modules/core-java-concurrency-basic-3/src/test/java/com/baeldung/concurrent/completablefuture/retry/RetryCompletableFutureUnitTest.java b/core-java-modules/core-java-concurrency-basic-3/src/test/java/com/baeldung/concurrent/completablefuture/retry/RetryCompletableFutureUnitTest.java index 7f1ea41f92..ea49f0fa08 100644 --- a/core-java-modules/core-java-concurrency-basic-3/src/test/java/com/baeldung/concurrent/completablefuture/retry/RetryCompletableFutureUnitTest.java +++ b/core-java-modules/core-java-concurrency-basic-3/src/test/java/com/baeldung/concurrent/completablefuture/retry/RetryCompletableFutureUnitTest.java @@ -29,10 +29,8 @@ class RetryCompletableFutureUnitTest { CompletableFuture result = retryTask(codeToRun, 10); - assertThat(result.join()) - .isEqualTo(100); - assertThat(retriesCounter) - .hasValue(4); + assertThat(result.join()).isEqualTo(100); + assertThat(retriesCounter).hasValue(4); } @Test @@ -52,10 +50,8 @@ class RetryCompletableFutureUnitTest { CompletableFuture result = retryUnsafe(codeToRun, 10); - assertThat(result.join()) - .isEqualTo(100); - assertThat(retriesCounter) - .hasValue(4); + assertThat(result.join()).isEqualTo(100); + assertThat(retriesCounter).hasValue(4); } @Test @@ -65,8 +61,8 @@ class RetryCompletableFutureUnitTest { CompletableFuture result = retryUnsafe(codeToRun, 3); assertThatThrownBy(result::join) - .isInstanceOf(CompletionException.class) - .hasMessageContaining("RuntimeException: task failed for 3 time(s)"); + .isInstanceOf(CompletionException.class) + .hasMessageContaining("RuntimeException: task failed for 3 time(s)"); } @Test @@ -75,10 +71,8 @@ class RetryCompletableFutureUnitTest { CompletableFuture result = retryExceptionallyAsync(codeToRun, 10); - assertThat(result.join()) - .isEqualTo(100); - assertThat(retriesCounter) - .hasValue(4); + assertThat(result.join()).isEqualTo(100); + assertThat(retriesCounter).hasValue(4); } @Test @@ -88,7 +82,7 @@ class RetryCompletableFutureUnitTest { CompletableFuture result = retryExceptionallyAsync(codeToRun, 3); assertThatThrownBy(result::join) - .isInstanceOf(CompletionException.class) + .isInstanceOf(CompletionException.class) .hasMessageContaining("RuntimeException: task failed for 3 time(s)"); } @@ -98,10 +92,8 @@ class RetryCompletableFutureUnitTest { CompletableFuture result = retryNesting(codeToRun, 10); - assertThat(result.join()) - .isEqualTo(100); - assertThat(retriesCounter) - .hasValue(4); + assertThat(result.join()).isEqualTo(100); + assertThat(retriesCounter).hasValue(4); } @Test @@ -111,7 +103,7 @@ class RetryCompletableFutureUnitTest { CompletableFuture result = retryNesting(codeToRun, 3); assertThatThrownBy(result::join) - .isInstanceOf(CompletionException.class) + .isInstanceOf(CompletionException.class) .hasMessageContaining("RuntimeException: task failed for 3 time(s)"); } From b4db616646fece37908ed789ccec7ca7dbc10a42 Mon Sep 17 00:00:00 2001 From: Azhwani <13301425+azhwani@users.noreply.github.com> Date: Thu, 26 Oct 2023 08:18:01 +0200 Subject: [PATCH 13/26] BAEL-7026: Check If a String Contains a Number Value in Java (#14867) Co-authored-by: Luis Javier Peris Morillo --- .../core-java-string-operations-7/pom.xml | 142 +++++++++--------- .../StrContainsNumberUtils.java | 77 ++++++++++ .../StrContainsNumberUtilsUnitTest.java | 69 +++++++++ 3 files changed, 217 insertions(+), 71 deletions(-) create mode 100644 core-java-modules/core-java-string-operations-7/src/main/java/com/baeldung/strcontainsnumber/StrContainsNumberUtils.java create mode 100644 core-java-modules/core-java-string-operations-7/src/test/java/com/baeldung/strcontainsnumber/StrContainsNumberUtilsUnitTest.java diff --git a/core-java-modules/core-java-string-operations-7/pom.xml b/core-java-modules/core-java-string-operations-7/pom.xml index 595f918fcd..a2c7036e34 100644 --- a/core-java-modules/core-java-string-operations-7/pom.xml +++ b/core-java-modules/core-java-string-operations-7/pom.xml @@ -1,72 +1,72 @@ - - - 4.0.0 - core-java-string-operations-7 - core-java-string-operations-7 - jar - - - com.baeldung.core-java-modules - core-java-modules - 0.0.1-SNAPSHOT - - - - - org.apache.commons - commons-lang3 - ${apache.commons.lang3.version} - - - org.apache.commons - commons-text - ${commons-text.version} - - - org.liquibase - liquibase-core - 4.9.1 - test - - - org.junit.jupiter - junit-jupiter - 5.8.1 - test - - - org.liquibase - liquibase-core - 4.9.1 - test - - - junit - junit - 4.13.2 - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - ${maven.compiler.source} - ${maven.compiler.target} - - - - - - - 11 - 11 - 3.12.0 - 1.10.0 - - + + + 4.0.0 + core-java-string-operations-7 + core-java-string-operations-7 + jar + + + com.baeldung.core-java-modules + core-java-modules + 0.0.1-SNAPSHOT + + + + + org.apache.commons + commons-lang3 + ${apache.commons.lang3.version} + + + org.apache.commons + commons-text + ${commons-text.version} + + + org.liquibase + liquibase-core + 4.9.1 + test + + + org.junit.jupiter + junit-jupiter + 5.8.1 + test + + + org.liquibase + liquibase-core + 4.9.1 + test + + + junit + junit + 4.13.2 + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${maven.compiler.source} + ${maven.compiler.target} + + + + + + + 11 + 11 + 3.13.0 + 1.10.0 + + \ No newline at end of file diff --git a/core-java-modules/core-java-string-operations-7/src/main/java/com/baeldung/strcontainsnumber/StrContainsNumberUtils.java b/core-java-modules/core-java-string-operations-7/src/main/java/com/baeldung/strcontainsnumber/StrContainsNumberUtils.java new file mode 100644 index 0000000000..a609b94cb8 --- /dev/null +++ b/core-java-modules/core-java-string-operations-7/src/main/java/com/baeldung/strcontainsnumber/StrContainsNumberUtils.java @@ -0,0 +1,77 @@ +package com.baeldung.strcontainsnumber; + +import java.util.regex.Pattern; + +import org.apache.commons.lang3.StringUtils; + +import com.google.common.base.CharMatcher; + +public class StrContainsNumberUtils { + + static boolean checkUsingMatchesMethod(String input) { + if (input == null || input.isEmpty()) { + return false; + } + + return input.matches(".*\\d.*"); + } + + static boolean checkUsingPatternClass(String input) { + if (input == null || input.isEmpty()) { + return false; + } + + return Pattern.compile(".*\\d.*") + .matcher(input) + .matches(); + } + + static boolean checkUsingReplaceAllMethod(String input) { + if (input == null || input.isEmpty()) { + return false; + } + + String result = input.replaceAll("\\d", ""); + return result.length() != input.length(); + } + + static boolean checkUsingIsDigitMethod(String input) { + if (input == null || input.isEmpty()) { + return false; + } + + for (char c : input.toCharArray()) { + if (Character.isDigit(c)) { + return true; + } + } + + return false; + } + + static boolean checkUsingStreamApi(String input) { + if (input == null || input.isEmpty()) { + return false; + } + + return input.chars() + .anyMatch(Character::isDigit); + } + + static boolean checkUsingApacheCommonsLang(String input) { + String result = StringUtils.getDigits(input); + return result != null && !result.isEmpty(); + } + + static boolean checkUsingGuava(String input) { + if (input == null || input.isEmpty()) { + return false; + } + + String result = CharMatcher.forPredicate(Character::isDigit) + .retainFrom(input); + + return !result.isEmpty(); + } + +} diff --git a/core-java-modules/core-java-string-operations-7/src/test/java/com/baeldung/strcontainsnumber/StrContainsNumberUtilsUnitTest.java b/core-java-modules/core-java-string-operations-7/src/test/java/com/baeldung/strcontainsnumber/StrContainsNumberUtilsUnitTest.java new file mode 100644 index 0000000000..9a60a827e0 --- /dev/null +++ b/core-java-modules/core-java-string-operations-7/src/test/java/com/baeldung/strcontainsnumber/StrContainsNumberUtilsUnitTest.java @@ -0,0 +1,69 @@ +package com.baeldung.strcontainsnumber; + +import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; + +import org.junit.Test; + +public class StrContainsNumberUtilsUnitTest { + + private static final String INPUT_WITH_NUMBERS = "We hope 2024 will be great"; + private static final String INPUT_WITHOUT_NUMBERS = "Hello world"; + + @Test + public void givenInputString_whenUsingMatchesMethod_ThenCheck() { + assertTrue(StrContainsNumberUtils.checkUsingMatchesMethod(INPUT_WITH_NUMBERS)); + assertFalse(StrContainsNumberUtils.checkUsingMatchesMethod(INPUT_WITHOUT_NUMBERS)); + assertFalse(StrContainsNumberUtils.checkUsingMatchesMethod("")); + assertFalse(StrContainsNumberUtils.checkUsingMatchesMethod(null)); + } + + @Test + public void givenInputString_whenUsingPatternClass_ThenCheck() { + assertTrue(StrContainsNumberUtils.checkUsingPatternClass(INPUT_WITH_NUMBERS)); + assertFalse(StrContainsNumberUtils.checkUsingPatternClass(INPUT_WITHOUT_NUMBERS)); + assertFalse(StrContainsNumberUtils.checkUsingPatternClass("")); + assertFalse(StrContainsNumberUtils.checkUsingPatternClass(null)); + } + + @Test + public void givenInputString_whenUsingReplaceAllMethod_ThenCheck() { + assertTrue(StrContainsNumberUtils.checkUsingReplaceAllMethod(INPUT_WITH_NUMBERS)); + assertFalse(StrContainsNumberUtils.checkUsingReplaceAllMethod(INPUT_WITHOUT_NUMBERS)); + assertFalse(StrContainsNumberUtils.checkUsingReplaceAllMethod("")); + assertFalse(StrContainsNumberUtils.checkUsingReplaceAllMethod(null)); + } + + @Test + public void givenInputString_whenUsingIsDigitMethod_ThenCheck() { + assertTrue(StrContainsNumberUtils.checkUsingIsDigitMethod(INPUT_WITH_NUMBERS)); + assertFalse(StrContainsNumberUtils.checkUsingIsDigitMethod(INPUT_WITHOUT_NUMBERS)); + assertFalse(StrContainsNumberUtils.checkUsingIsDigitMethod("")); + assertFalse(StrContainsNumberUtils.checkUsingIsDigitMethod(null)); + } + + @Test + public void givenInputString_whenUsingStreamApi_ThenCheck() { + assertTrue(StrContainsNumberUtils.checkUsingStreamApi(INPUT_WITH_NUMBERS)); + assertFalse(StrContainsNumberUtils.checkUsingStreamApi(INPUT_WITHOUT_NUMBERS)); + assertFalse(StrContainsNumberUtils.checkUsingStreamApi("")); + assertFalse(StrContainsNumberUtils.checkUsingStreamApi(null)); + } + + @Test + public void givenInputString_whenUsingApacheCommonsLang_ThenCheck() { + assertTrue(StrContainsNumberUtils.checkUsingApacheCommonsLang(INPUT_WITH_NUMBERS)); + assertFalse(StrContainsNumberUtils.checkUsingApacheCommonsLang(INPUT_WITHOUT_NUMBERS)); + assertFalse(StrContainsNumberUtils.checkUsingApacheCommonsLang("")); + assertFalse(StrContainsNumberUtils.checkUsingApacheCommonsLang(null)); + } + + @Test + public void givenInputString_whenUsingGuava_ThenCheck() { + assertTrue(StrContainsNumberUtils.checkUsingGuava(INPUT_WITH_NUMBERS)); + assertFalse(StrContainsNumberUtils.checkUsingGuava(INPUT_WITHOUT_NUMBERS)); + assertFalse(StrContainsNumberUtils.checkUsingGuava("")); + assertFalse(StrContainsNumberUtils.checkUsingGuava(null)); + } + +} From d9c72a1c1af4d0c01ba518fef819a65a548efd4f Mon Sep 17 00:00:00 2001 From: Michael Olayemi Date: Fri, 27 Oct 2023 05:44:00 +0100 Subject: [PATCH 14/26] Limit for Repository Query Methods (#15055) * Limit for Repository Query Methods * Limit for Repository Query Methods --- .../java/com/baeldung/boot/passenger/PassengerRepository.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/persistence-modules/spring-data-jpa-query/src/main/java/com/baeldung/boot/passenger/PassengerRepository.java b/persistence-modules/spring-data-jpa-query/src/main/java/com/baeldung/boot/passenger/PassengerRepository.java index 14d5403cb5..7b5a307b81 100644 --- a/persistence-modules/spring-data-jpa-query/src/main/java/com/baeldung/boot/passenger/PassengerRepository.java +++ b/persistence-modules/spring-data-jpa-query/src/main/java/com/baeldung/boot/passenger/PassengerRepository.java @@ -12,6 +12,9 @@ interface PassengerRepository extends JpaRepository, CustomPass Passenger findTopByOrderBySeatNumberAsc(); List findByOrderBySeatNumberAsc(); + + //The Limit type is a new feature in Spring Data JPA version 3.2 + //List findByOrderBySeatNumberAsc(Limit limit); List findByFirstNameIgnoreCase(String firstName); From 16b931c4df6ad17d5ab4e0a58e32018bba92b550 Mon Sep 17 00:00:00 2001 From: Azhwani <13301425+azhwani@users.noreply.github.com> Date: Fri, 27 Oct 2023 08:46:04 +0200 Subject: [PATCH 15/26] BAEL-7055: How can I capitalize the first letter of each word in a string? (#14927) Co-authored-by: Mo Helmy <135069400+BenHelmyBen@users.noreply.github.com> --- ...CapitalizeFirstCharacterEachWordUtils.java | 40 +++++++++++++++++++ ...zeFirstCharacterEachWordUtilsUnitTest.java | 38 ++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 core-java-modules/core-java-string-operations-7/src/main/java/com/baeldung/capitalizefirstcharactereachword/CapitalizeFirstCharacterEachWordUtils.java create mode 100644 core-java-modules/core-java-string-operations-7/src/test/java/com/baeldung/capitalizefirstcharactereachword/CapitalizeFirstCharacterEachWordUtilsUnitTest.java diff --git a/core-java-modules/core-java-string-operations-7/src/main/java/com/baeldung/capitalizefirstcharactereachword/CapitalizeFirstCharacterEachWordUtils.java b/core-java-modules/core-java-string-operations-7/src/main/java/com/baeldung/capitalizefirstcharactereachword/CapitalizeFirstCharacterEachWordUtils.java new file mode 100644 index 0000000000..cccc745499 --- /dev/null +++ b/core-java-modules/core-java-string-operations-7/src/main/java/com/baeldung/capitalizefirstcharactereachword/CapitalizeFirstCharacterEachWordUtils.java @@ -0,0 +1,40 @@ +package com.baeldung.capitalizefirstcharactereachword; + +import java.util.Arrays; +import java.util.stream.Collectors; + +import org.apache.commons.lang3.StringUtils; + +class CapitalizeFirstCharacterEachWordUtils { + + static String usingCharacterToUpperCaseMethod(String input) { + if (input == null || input.isEmpty()) { + return null; + } + + return Arrays.stream(input.split("\\s+")) + .map(word -> Character.toUpperCase(word.charAt(0)) + word.substring(1)) + .collect(Collectors.joining(" ")); + } + + static String usingStringToUpperCaseMethod(String input) { + if (input == null || input.isEmpty()) { + return null; + } + + return Arrays.stream(input.split("\\s+")) + .map(word -> word.substring(0, 1).toUpperCase() + word.substring(1)) + .collect(Collectors.joining(" ")); + } + + static String usingStringUtilsClass(String input) { + if (input == null || input.isEmpty()) { + return null; + } + + return Arrays.stream(input.split("\\s+")) + .map(StringUtils::capitalize) + .collect(Collectors.joining(" ")); + } + +} diff --git a/core-java-modules/core-java-string-operations-7/src/test/java/com/baeldung/capitalizefirstcharactereachword/CapitalizeFirstCharacterEachWordUtilsUnitTest.java b/core-java-modules/core-java-string-operations-7/src/test/java/com/baeldung/capitalizefirstcharactereachword/CapitalizeFirstCharacterEachWordUtilsUnitTest.java new file mode 100644 index 0000000000..27c7ddb4c4 --- /dev/null +++ b/core-java-modules/core-java-string-operations-7/src/test/java/com/baeldung/capitalizefirstcharactereachword/CapitalizeFirstCharacterEachWordUtilsUnitTest.java @@ -0,0 +1,38 @@ +package com.baeldung.capitalizefirstcharactereachword; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.apache.commons.text.WordUtils; +import org.junit.jupiter.api.Test; + +class CapitalizeFirstCharacterEachWordUtilsUnitTest { + + @Test + void givenString_whenUsingCharacterToUpperCaseMethod_thenCapitalizeFirstCharacter() { + String input = "hello baeldung visitors"; + + assertEquals("Hello Baeldung Visitors", CapitalizeFirstCharacterEachWordUtils.usingCharacterToUpperCaseMethod(input)); + } + + @Test + void givenString_whenUsingSubstringMethod_thenCapitalizeFirstCharacter() { + String input = "Hi, my name is azhrioun"; + + assertEquals("Hi, My Name Is Azhrioun", CapitalizeFirstCharacterEachWordUtils.usingStringToUpperCaseMethod(input)); + } + + @Test + void givenString_whenUsingStringUtilsClass_thenCapitalizeFirstCharacter() { + String input = "life is short the world is wide"; + + assertEquals("Life Is Short The World Is Wide", CapitalizeFirstCharacterEachWordUtils.usingStringUtilsClass(input)); + } + + @Test + void givenString_whenUsingWordUtilsClass_thenCapitalizeFirstCharacter() { + String input = "smile sunshine is good for your teeth"; + + assertEquals("Smile Sunshine Is Good For Your Teeth", WordUtils.capitalizeFully(input)); + } + +} From 1028ab97c4efff930a9b8668cb84b1bf9a117c28 Mon Sep 17 00:00:00 2001 From: anuragkumawat Date: Fri, 27 Oct 2023 15:57:32 +0530 Subject: [PATCH 16/26] Java 26392 Move modules to patterns-module (#15060) * JAVA-26392 Move axon module and ddd module to patterns-modules * JAVA-26292 Move ddd-contexts to patterns-module --- {axon => patterns-modules/axon}/README.md | 0 {axon => patterns-modules/axon}/pom.xml | 2 +- .../com/baeldung/axon/OrderApplication.java | 0 .../axon/OrderApplicationConfiguration.java | 0 .../commandmodel/order/OrderAggregate.java | 0 .../axon/commandmodel/order/OrderLine.java | 0 .../coreapi/commands/AddProductCommand.java | 0 .../coreapi/commands/ConfirmOrderCommand.java | 0 .../coreapi/commands/CreateOrderCommand.java | 0 .../DecrementProductCountCommand.java | 0 .../IncrementProductCountCommand.java | 0 .../coreapi/commands/ShipOrderCommand.java | 0 .../coreapi/events/OrderConfirmedEvent.java | 0 .../coreapi/events/OrderCreatedEvent.java | 0 .../coreapi/events/OrderShippedEvent.java | 0 .../coreapi/events/ProductAddedEvent.java | 0 .../events/ProductCountDecrementedEvent.java | 0 .../events/ProductCountIncrementedEvent.java | 0 .../coreapi/events/ProductRemovedEvent.java | 0 .../DuplicateOrderLineException.java | 0 .../OrderAlreadyConfirmedException.java | 0 .../exceptions/UnconfirmedOrderException.java | 0 .../queries/FindAllOrderedProductsQuery.java | 0 .../baeldung/axon/coreapi/queries/Order.java | 0 .../axon/coreapi/queries/OrderStatus.java | 0 .../coreapi/queries/OrderUpdatesQuery.java | 0 .../queries/TotalProductsShippedQuery.java | 0 .../baeldung/axon/gui/OrderRestEndpoint.java | 0 .../InMemoryOrdersEventHandler.java | 0 .../axon/querymodel/LegacyQueryHandler.java | 0 .../axon/querymodel/MongoConfiguration.java | 0 .../querymodel/MongoOrdersEventHandler.java | 0 .../axon/querymodel/OrderQueryService.java | 0 .../axon/querymodel/OrderResponse.java | 0 .../axon/querymodel/OrderStatusResponse.java | 0 .../axon/querymodel/OrdersEventHandler.java | 0 .../resources/application-mongo.properties | 0 .../src/main/resources/application.properties | 0 .../axon}/src/main/resources/logback.xml | 0 .../axon}/src/main/resources/order-api.http | 0 .../commandmodel/OrderAggregateUnitTest.java | 0 .../axon/gui/OrderRestEndpointManualTest.java | 0 .../AbstractOrdersEventHandlerUnitTest.java | 0 .../InMemoryOrdersEventHandlerUnitTest.java | 0 .../MongoOrdersEventHandlerUnitTest.java | 0 .../OrderQueryServiceIntegrationTest.java | 0 .../src/test/resources/application.properties | 0 .../axon}/start_axon_server.sh | 0 .../axon}/start_mongo.sh | 0 .../ddd-contexts}/README.md | 0 .../ddd-contexts-infrastructure/pom.xml | 0 .../infrastructure/db/InMemoryOrderStore.java | 0 .../infrastructure/events/SimpleEventBus.java | 0 .../src/main/java/module-info.java | 0 .../ddd-contexts-mainapp/pom.xml | 0 .../dddcontexts/mainapp/Application.java | 0 .../src/main/java/module-info.java | 0 .../ddd-contexts-ordercontext/pom.xml | 0 .../ordercontext/model/CustomerOrder.java | 0 .../ordercontext/model/OrderItem.java | 0 .../repository/CustomerOrderRepository.java | 0 .../service/CustomerOrderService.java | 0 .../ordercontext/service/OrderService.java | 0 .../src/main/java/module-info.java | 0 .../ddd-contexts-sharedkernel/pom.xml | 0 .../sharedkernel/events/ApplicationEvent.java | 0 .../sharedkernel/events/EventBus.java | 0 .../sharedkernel/events/EventSubscriber.java | 0 .../service/ApplicationService.java | 0 .../src/main/java/module-info.java | 0 .../ddd-contexts-shippingcontext/pom.xml | 0 .../shippingcontext/model/PackageItem.java | 0 .../shippingcontext/model/Parcel.java | 0 .../shippingcontext/model/ShippableOrder.java | 0 .../repository/ShippingOrderRepository.java | 0 .../service/ParcelShippingService.java | 0 .../service/ShippingService.java | 0 .../src/main/java/module-info.java | 0 .../ddd-contexts}/pom.xml | 2 +- {ddd => patterns-modules/ddd}/README.md | 0 {ddd => patterns-modules/ddd}/pom.xml | 2 +- .../PersistingDddAggregatesApplication.java | 24 +++++++++---------- .../java/com/baeldung/ddd/order/Order.java | 0 .../com/baeldung/ddd/order/OrderLine.java | 0 .../java/com/baeldung/ddd/order/Product.java | 0 .../config/CustomMongoConfiguration.java | 0 .../AmountBasedDiscountPolicy.java | 0 .../order/doubledispatch/DiscountPolicy.java | 0 .../doubledispatch/FlatDiscountPolicy.java | 0 .../ddd/order/doubledispatch/Order.java | 0 .../doubledispatch/SpecialDiscountPolicy.java | 0 .../order/doubledispatch/SpecialOrder.java | 0 .../visitor/HtmlOrderViewCreator.java | 0 .../doubledispatch/visitor/OrderVisitor.java | 0 .../doubledispatch/visitor/Visitable.java | 0 .../com/baeldung/ddd/order/jpa/JpaOrder.java | 0 .../baeldung/ddd/order/jpa/JpaOrderLine.java | 0 .../ddd/order/jpa/JpaOrderRepository.java | 0 .../baeldung/ddd/order/jpa/JpaProduct.java | 0 .../ddd/order/mongo/OrderMongoRepository.java | 0 .../DomainLayerApplication.java | 0 .../application/cli/CliOrderController.java | 0 .../request/AddProductRequest.java | 0 .../request/CreateOrderRequest.java | 0 .../response/CreateOrderResponse.java | 0 .../application/rest/OrderController.java | 0 .../domain/DomainException.java | 0 .../dddhexagonalspring/domain/Order.java | 0 .../dddhexagonalspring/domain/OrderItem.java | 0 .../domain/OrderStatus.java | 0 .../dddhexagonalspring/domain/Product.java | 0 .../domain/repository/OrderRepository.java | 0 .../domain/service/DomainOrderService.java | 0 .../domain/service/OrderService.java | 0 .../configuration/BeanConfiguration.java | 0 .../configuration/CassandraConfiguration.java | 0 .../configuration/MongoDBConfiguration.java | 0 .../cassandra/CassandraDbOrderRepository.java | 0 .../repository/cassandra/OrderEntity.java | 0 .../repository/cassandra/OrderItemEntity.java | 0 .../SpringDataCassandraOrderRepository.java | 0 .../mongo/MongoDbOrderRepository.java | 0 .../mongo/SpringDataMongoOrderRepository.java | 0 .../src/main/resources/ddd-layers.properties | 0 .../baeldung/ddd/order/OrderFixtureUtils.java | 0 .../com/baeldung/ddd/order/OrderUnitTest.java | 0 .../DoubleDispatchDiscountPolicyUnitTest.java | 0 .../HtmlOrderViewCreatorUnitTest.java | 0 .../MethodOverloadExampleUnitTest.java | 0 .../SingleDispatchDiscountPolicyUnitTest.java | 0 .../ddd/order/jpa/PersistOrderLiveTest.java | 0 .../ViolateOrderBusinessRulesUnitTest.java | 0 .../ddd/order/mongo/OrderMongoLiveTest.java | 0 .../domain/OrderProvider.java | 0 .../domain/OrderUnitTest.java | 0 .../service/DomainOrderServiceUnitTest.java | 0 .../CassandraDbOrderRepositoryLiveTest.java | 0 .../MongoDbOrderRepositoryLiveTest.java | 0 .../MongoDbOrderRepositoryUnitTest.java | 0 .../com/baeldung/dddhexagonalspring/README.md | 0 .../dddhexagonalspring/cassandra-init.cql | 0 .../dddhexagonalspring/docker-compose.yml | 0 .../baeldung/dddhexagonalspring/mongo-init.js | 0 .../test/resources/ddd-layers-test.properties | 0 patterns-modules/pom.xml | 13 ++++++---- pom.xml | 8 ------- 146 files changed, 23 insertions(+), 28 deletions(-) rename {axon => patterns-modules/axon}/README.md (100%) rename {axon => patterns-modules/axon}/pom.xml (98%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/OrderApplication.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/OrderApplicationConfiguration.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/commandmodel/order/OrderAggregate.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/commandmodel/order/OrderLine.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/coreapi/commands/AddProductCommand.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/coreapi/commands/ConfirmOrderCommand.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/coreapi/commands/CreateOrderCommand.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/coreapi/commands/DecrementProductCountCommand.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/coreapi/commands/IncrementProductCountCommand.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/coreapi/commands/ShipOrderCommand.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/coreapi/events/OrderConfirmedEvent.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/coreapi/events/OrderCreatedEvent.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/coreapi/events/OrderShippedEvent.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/coreapi/events/ProductAddedEvent.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/coreapi/events/ProductCountDecrementedEvent.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/coreapi/events/ProductCountIncrementedEvent.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/coreapi/events/ProductRemovedEvent.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/coreapi/exceptions/DuplicateOrderLineException.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/coreapi/exceptions/OrderAlreadyConfirmedException.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/coreapi/exceptions/UnconfirmedOrderException.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/coreapi/queries/FindAllOrderedProductsQuery.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/coreapi/queries/Order.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/coreapi/queries/OrderStatus.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/coreapi/queries/OrderUpdatesQuery.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/coreapi/queries/TotalProductsShippedQuery.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/gui/OrderRestEndpoint.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/querymodel/InMemoryOrdersEventHandler.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/querymodel/LegacyQueryHandler.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/querymodel/MongoConfiguration.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/querymodel/MongoOrdersEventHandler.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/querymodel/OrderQueryService.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/querymodel/OrderResponse.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/querymodel/OrderStatusResponse.java (100%) rename {axon => patterns-modules/axon}/src/main/java/com/baeldung/axon/querymodel/OrdersEventHandler.java (100%) rename {axon => patterns-modules/axon}/src/main/resources/application-mongo.properties (100%) rename {axon => patterns-modules/axon}/src/main/resources/application.properties (100%) rename {axon => patterns-modules/axon}/src/main/resources/logback.xml (100%) rename {axon => patterns-modules/axon}/src/main/resources/order-api.http (100%) rename {axon => patterns-modules/axon}/src/test/java/com/baeldung/axon/commandmodel/OrderAggregateUnitTest.java (100%) rename {axon => patterns-modules/axon}/src/test/java/com/baeldung/axon/gui/OrderRestEndpointManualTest.java (100%) rename {axon => patterns-modules/axon}/src/test/java/com/baeldung/axon/querymodel/AbstractOrdersEventHandlerUnitTest.java (100%) rename {axon => patterns-modules/axon}/src/test/java/com/baeldung/axon/querymodel/InMemoryOrdersEventHandlerUnitTest.java (100%) rename {axon => patterns-modules/axon}/src/test/java/com/baeldung/axon/querymodel/MongoOrdersEventHandlerUnitTest.java (100%) rename {axon => patterns-modules/axon}/src/test/java/com/baeldung/axon/querymodel/OrderQueryServiceIntegrationTest.java (100%) rename {axon => patterns-modules/axon}/src/test/resources/application.properties (100%) rename {axon => patterns-modules/axon}/start_axon_server.sh (100%) mode change 100755 => 100644 rename {axon => patterns-modules/axon}/start_mongo.sh (100%) mode change 100755 => 100644 rename {ddd-contexts => patterns-modules/ddd-contexts}/README.md (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-infrastructure/pom.xml (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-infrastructure/src/main/java/com/baeldung/dddcontexts/infrastructure/db/InMemoryOrderStore.java (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-infrastructure/src/main/java/com/baeldung/dddcontexts/infrastructure/events/SimpleEventBus.java (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-infrastructure/src/main/java/module-info.java (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-mainapp/pom.xml (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-mainapp/src/main/java/com/baeldung/dddcontexts/mainapp/Application.java (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-mainapp/src/main/java/module-info.java (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-ordercontext/pom.xml (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/model/CustomerOrder.java (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/model/OrderItem.java (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/repository/CustomerOrderRepository.java (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/service/CustomerOrderService.java (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/service/OrderService.java (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-ordercontext/src/main/java/module-info.java (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-sharedkernel/pom.xml (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/events/ApplicationEvent.java (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/events/EventBus.java (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/events/EventSubscriber.java (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/service/ApplicationService.java (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-sharedkernel/src/main/java/module-info.java (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-shippingcontext/pom.xml (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/model/PackageItem.java (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/model/Parcel.java (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/model/ShippableOrder.java (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/repository/ShippingOrderRepository.java (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/service/ParcelShippingService.java (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/service/ShippingService.java (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/ddd-contexts-shippingcontext/src/main/java/module-info.java (100%) rename {ddd-contexts => patterns-modules/ddd-contexts}/pom.xml (98%) rename {ddd => patterns-modules/ddd}/README.md (100%) rename {ddd => patterns-modules/ddd}/pom.xml (98%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/ddd/PersistingDddAggregatesApplication.java (96%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/ddd/order/Order.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/ddd/order/OrderLine.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/ddd/order/Product.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/ddd/order/config/CustomMongoConfiguration.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/ddd/order/doubledispatch/AmountBasedDiscountPolicy.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/ddd/order/doubledispatch/DiscountPolicy.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/ddd/order/doubledispatch/FlatDiscountPolicy.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/ddd/order/doubledispatch/Order.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/ddd/order/doubledispatch/SpecialDiscountPolicy.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/ddd/order/doubledispatch/SpecialOrder.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/ddd/order/doubledispatch/visitor/HtmlOrderViewCreator.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/ddd/order/doubledispatch/visitor/OrderVisitor.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/ddd/order/doubledispatch/visitor/Visitable.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/ddd/order/jpa/JpaOrder.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/ddd/order/jpa/JpaOrderLine.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/ddd/order/jpa/JpaOrderRepository.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/ddd/order/jpa/JpaProduct.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/ddd/order/mongo/OrderMongoRepository.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/dddhexagonalspring/DomainLayerApplication.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/dddhexagonalspring/application/cli/CliOrderController.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/dddhexagonalspring/application/request/AddProductRequest.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/dddhexagonalspring/application/request/CreateOrderRequest.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/dddhexagonalspring/application/response/CreateOrderResponse.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/dddhexagonalspring/application/rest/OrderController.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/dddhexagonalspring/domain/DomainException.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/dddhexagonalspring/domain/Order.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/dddhexagonalspring/domain/OrderItem.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/dddhexagonalspring/domain/OrderStatus.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/dddhexagonalspring/domain/Product.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/dddhexagonalspring/domain/repository/OrderRepository.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/dddhexagonalspring/domain/service/DomainOrderService.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/dddhexagonalspring/domain/service/OrderService.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/configuration/BeanConfiguration.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/configuration/CassandraConfiguration.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/configuration/MongoDBConfiguration.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/cassandra/CassandraDbOrderRepository.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/cassandra/OrderEntity.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/cassandra/OrderItemEntity.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/cassandra/SpringDataCassandraOrderRepository.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/mongo/MongoDbOrderRepository.java (100%) rename {ddd => patterns-modules/ddd}/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/mongo/SpringDataMongoOrderRepository.java (100%) rename {ddd => patterns-modules/ddd}/src/main/resources/ddd-layers.properties (100%) rename {ddd => patterns-modules/ddd}/src/test/java/com/baeldung/ddd/order/OrderFixtureUtils.java (100%) rename {ddd => patterns-modules/ddd}/src/test/java/com/baeldung/ddd/order/OrderUnitTest.java (100%) rename {ddd => patterns-modules/ddd}/src/test/java/com/baeldung/ddd/order/doubledispatch/DoubleDispatchDiscountPolicyUnitTest.java (100%) rename {ddd => patterns-modules/ddd}/src/test/java/com/baeldung/ddd/order/doubledispatch/HtmlOrderViewCreatorUnitTest.java (100%) rename {ddd => patterns-modules/ddd}/src/test/java/com/baeldung/ddd/order/doubledispatch/MethodOverloadExampleUnitTest.java (100%) rename {ddd => patterns-modules/ddd}/src/test/java/com/baeldung/ddd/order/doubledispatch/SingleDispatchDiscountPolicyUnitTest.java (100%) rename {ddd => patterns-modules/ddd}/src/test/java/com/baeldung/ddd/order/jpa/PersistOrderLiveTest.java (100%) rename {ddd => patterns-modules/ddd}/src/test/java/com/baeldung/ddd/order/jpa/ViolateOrderBusinessRulesUnitTest.java (100%) rename {ddd => patterns-modules/ddd}/src/test/java/com/baeldung/ddd/order/mongo/OrderMongoLiveTest.java (100%) rename {ddd => patterns-modules/ddd}/src/test/java/com/baeldung/dddhexagonalspring/domain/OrderProvider.java (100%) rename {ddd => patterns-modules/ddd}/src/test/java/com/baeldung/dddhexagonalspring/domain/OrderUnitTest.java (100%) rename {ddd => patterns-modules/ddd}/src/test/java/com/baeldung/dddhexagonalspring/domain/service/DomainOrderServiceUnitTest.java (100%) rename {ddd => patterns-modules/ddd}/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/CassandraDbOrderRepositoryLiveTest.java (100%) rename {ddd => patterns-modules/ddd}/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/MongoDbOrderRepositoryLiveTest.java (100%) rename {ddd => patterns-modules/ddd}/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/MongoDbOrderRepositoryUnitTest.java (100%) rename {ddd => patterns-modules/ddd}/src/test/resources/com/baeldung/dddhexagonalspring/README.md (100%) rename {ddd => patterns-modules/ddd}/src/test/resources/com/baeldung/dddhexagonalspring/cassandra-init.cql (100%) rename {ddd => patterns-modules/ddd}/src/test/resources/com/baeldung/dddhexagonalspring/docker-compose.yml (100%) rename {ddd => patterns-modules/ddd}/src/test/resources/com/baeldung/dddhexagonalspring/mongo-init.js (100%) rename {ddd => patterns-modules/ddd}/src/test/resources/ddd-layers-test.properties (100%) diff --git a/axon/README.md b/patterns-modules/axon/README.md similarity index 100% rename from axon/README.md rename to patterns-modules/axon/README.md diff --git a/axon/pom.xml b/patterns-modules/axon/pom.xml similarity index 98% rename from axon/pom.xml rename to patterns-modules/axon/pom.xml index 5eed742aab..473a1b0e15 100644 --- a/axon/pom.xml +++ b/patterns-modules/axon/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/axon/src/main/java/com/baeldung/axon/OrderApplication.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/OrderApplication.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/OrderApplication.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/OrderApplication.java diff --git a/axon/src/main/java/com/baeldung/axon/OrderApplicationConfiguration.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/OrderApplicationConfiguration.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/OrderApplicationConfiguration.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/OrderApplicationConfiguration.java diff --git a/axon/src/main/java/com/baeldung/axon/commandmodel/order/OrderAggregate.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/commandmodel/order/OrderAggregate.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/commandmodel/order/OrderAggregate.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/commandmodel/order/OrderAggregate.java diff --git a/axon/src/main/java/com/baeldung/axon/commandmodel/order/OrderLine.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/commandmodel/order/OrderLine.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/commandmodel/order/OrderLine.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/commandmodel/order/OrderLine.java diff --git a/axon/src/main/java/com/baeldung/axon/coreapi/commands/AddProductCommand.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/commands/AddProductCommand.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/coreapi/commands/AddProductCommand.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/commands/AddProductCommand.java diff --git a/axon/src/main/java/com/baeldung/axon/coreapi/commands/ConfirmOrderCommand.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/commands/ConfirmOrderCommand.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/coreapi/commands/ConfirmOrderCommand.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/commands/ConfirmOrderCommand.java diff --git a/axon/src/main/java/com/baeldung/axon/coreapi/commands/CreateOrderCommand.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/commands/CreateOrderCommand.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/coreapi/commands/CreateOrderCommand.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/commands/CreateOrderCommand.java diff --git a/axon/src/main/java/com/baeldung/axon/coreapi/commands/DecrementProductCountCommand.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/commands/DecrementProductCountCommand.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/coreapi/commands/DecrementProductCountCommand.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/commands/DecrementProductCountCommand.java diff --git a/axon/src/main/java/com/baeldung/axon/coreapi/commands/IncrementProductCountCommand.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/commands/IncrementProductCountCommand.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/coreapi/commands/IncrementProductCountCommand.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/commands/IncrementProductCountCommand.java diff --git a/axon/src/main/java/com/baeldung/axon/coreapi/commands/ShipOrderCommand.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/commands/ShipOrderCommand.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/coreapi/commands/ShipOrderCommand.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/commands/ShipOrderCommand.java diff --git a/axon/src/main/java/com/baeldung/axon/coreapi/events/OrderConfirmedEvent.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/events/OrderConfirmedEvent.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/coreapi/events/OrderConfirmedEvent.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/events/OrderConfirmedEvent.java diff --git a/axon/src/main/java/com/baeldung/axon/coreapi/events/OrderCreatedEvent.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/events/OrderCreatedEvent.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/coreapi/events/OrderCreatedEvent.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/events/OrderCreatedEvent.java diff --git a/axon/src/main/java/com/baeldung/axon/coreapi/events/OrderShippedEvent.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/events/OrderShippedEvent.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/coreapi/events/OrderShippedEvent.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/events/OrderShippedEvent.java diff --git a/axon/src/main/java/com/baeldung/axon/coreapi/events/ProductAddedEvent.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/events/ProductAddedEvent.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/coreapi/events/ProductAddedEvent.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/events/ProductAddedEvent.java diff --git a/axon/src/main/java/com/baeldung/axon/coreapi/events/ProductCountDecrementedEvent.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/events/ProductCountDecrementedEvent.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/coreapi/events/ProductCountDecrementedEvent.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/events/ProductCountDecrementedEvent.java diff --git a/axon/src/main/java/com/baeldung/axon/coreapi/events/ProductCountIncrementedEvent.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/events/ProductCountIncrementedEvent.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/coreapi/events/ProductCountIncrementedEvent.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/events/ProductCountIncrementedEvent.java diff --git a/axon/src/main/java/com/baeldung/axon/coreapi/events/ProductRemovedEvent.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/events/ProductRemovedEvent.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/coreapi/events/ProductRemovedEvent.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/events/ProductRemovedEvent.java diff --git a/axon/src/main/java/com/baeldung/axon/coreapi/exceptions/DuplicateOrderLineException.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/exceptions/DuplicateOrderLineException.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/coreapi/exceptions/DuplicateOrderLineException.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/exceptions/DuplicateOrderLineException.java diff --git a/axon/src/main/java/com/baeldung/axon/coreapi/exceptions/OrderAlreadyConfirmedException.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/exceptions/OrderAlreadyConfirmedException.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/coreapi/exceptions/OrderAlreadyConfirmedException.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/exceptions/OrderAlreadyConfirmedException.java diff --git a/axon/src/main/java/com/baeldung/axon/coreapi/exceptions/UnconfirmedOrderException.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/exceptions/UnconfirmedOrderException.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/coreapi/exceptions/UnconfirmedOrderException.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/exceptions/UnconfirmedOrderException.java diff --git a/axon/src/main/java/com/baeldung/axon/coreapi/queries/FindAllOrderedProductsQuery.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/queries/FindAllOrderedProductsQuery.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/coreapi/queries/FindAllOrderedProductsQuery.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/queries/FindAllOrderedProductsQuery.java diff --git a/axon/src/main/java/com/baeldung/axon/coreapi/queries/Order.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/queries/Order.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/coreapi/queries/Order.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/queries/Order.java diff --git a/axon/src/main/java/com/baeldung/axon/coreapi/queries/OrderStatus.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/queries/OrderStatus.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/coreapi/queries/OrderStatus.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/queries/OrderStatus.java diff --git a/axon/src/main/java/com/baeldung/axon/coreapi/queries/OrderUpdatesQuery.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/queries/OrderUpdatesQuery.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/coreapi/queries/OrderUpdatesQuery.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/queries/OrderUpdatesQuery.java diff --git a/axon/src/main/java/com/baeldung/axon/coreapi/queries/TotalProductsShippedQuery.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/queries/TotalProductsShippedQuery.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/coreapi/queries/TotalProductsShippedQuery.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/coreapi/queries/TotalProductsShippedQuery.java diff --git a/axon/src/main/java/com/baeldung/axon/gui/OrderRestEndpoint.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/gui/OrderRestEndpoint.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/gui/OrderRestEndpoint.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/gui/OrderRestEndpoint.java diff --git a/axon/src/main/java/com/baeldung/axon/querymodel/InMemoryOrdersEventHandler.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/querymodel/InMemoryOrdersEventHandler.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/querymodel/InMemoryOrdersEventHandler.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/querymodel/InMemoryOrdersEventHandler.java diff --git a/axon/src/main/java/com/baeldung/axon/querymodel/LegacyQueryHandler.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/querymodel/LegacyQueryHandler.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/querymodel/LegacyQueryHandler.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/querymodel/LegacyQueryHandler.java diff --git a/axon/src/main/java/com/baeldung/axon/querymodel/MongoConfiguration.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/querymodel/MongoConfiguration.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/querymodel/MongoConfiguration.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/querymodel/MongoConfiguration.java diff --git a/axon/src/main/java/com/baeldung/axon/querymodel/MongoOrdersEventHandler.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/querymodel/MongoOrdersEventHandler.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/querymodel/MongoOrdersEventHandler.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/querymodel/MongoOrdersEventHandler.java diff --git a/axon/src/main/java/com/baeldung/axon/querymodel/OrderQueryService.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/querymodel/OrderQueryService.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/querymodel/OrderQueryService.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/querymodel/OrderQueryService.java diff --git a/axon/src/main/java/com/baeldung/axon/querymodel/OrderResponse.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/querymodel/OrderResponse.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/querymodel/OrderResponse.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/querymodel/OrderResponse.java diff --git a/axon/src/main/java/com/baeldung/axon/querymodel/OrderStatusResponse.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/querymodel/OrderStatusResponse.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/querymodel/OrderStatusResponse.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/querymodel/OrderStatusResponse.java diff --git a/axon/src/main/java/com/baeldung/axon/querymodel/OrdersEventHandler.java b/patterns-modules/axon/src/main/java/com/baeldung/axon/querymodel/OrdersEventHandler.java similarity index 100% rename from axon/src/main/java/com/baeldung/axon/querymodel/OrdersEventHandler.java rename to patterns-modules/axon/src/main/java/com/baeldung/axon/querymodel/OrdersEventHandler.java diff --git a/axon/src/main/resources/application-mongo.properties b/patterns-modules/axon/src/main/resources/application-mongo.properties similarity index 100% rename from axon/src/main/resources/application-mongo.properties rename to patterns-modules/axon/src/main/resources/application-mongo.properties diff --git a/axon/src/main/resources/application.properties b/patterns-modules/axon/src/main/resources/application.properties similarity index 100% rename from axon/src/main/resources/application.properties rename to patterns-modules/axon/src/main/resources/application.properties diff --git a/axon/src/main/resources/logback.xml b/patterns-modules/axon/src/main/resources/logback.xml similarity index 100% rename from axon/src/main/resources/logback.xml rename to patterns-modules/axon/src/main/resources/logback.xml diff --git a/axon/src/main/resources/order-api.http b/patterns-modules/axon/src/main/resources/order-api.http similarity index 100% rename from axon/src/main/resources/order-api.http rename to patterns-modules/axon/src/main/resources/order-api.http diff --git a/axon/src/test/java/com/baeldung/axon/commandmodel/OrderAggregateUnitTest.java b/patterns-modules/axon/src/test/java/com/baeldung/axon/commandmodel/OrderAggregateUnitTest.java similarity index 100% rename from axon/src/test/java/com/baeldung/axon/commandmodel/OrderAggregateUnitTest.java rename to patterns-modules/axon/src/test/java/com/baeldung/axon/commandmodel/OrderAggregateUnitTest.java diff --git a/axon/src/test/java/com/baeldung/axon/gui/OrderRestEndpointManualTest.java b/patterns-modules/axon/src/test/java/com/baeldung/axon/gui/OrderRestEndpointManualTest.java similarity index 100% rename from axon/src/test/java/com/baeldung/axon/gui/OrderRestEndpointManualTest.java rename to patterns-modules/axon/src/test/java/com/baeldung/axon/gui/OrderRestEndpointManualTest.java diff --git a/axon/src/test/java/com/baeldung/axon/querymodel/AbstractOrdersEventHandlerUnitTest.java b/patterns-modules/axon/src/test/java/com/baeldung/axon/querymodel/AbstractOrdersEventHandlerUnitTest.java similarity index 100% rename from axon/src/test/java/com/baeldung/axon/querymodel/AbstractOrdersEventHandlerUnitTest.java rename to patterns-modules/axon/src/test/java/com/baeldung/axon/querymodel/AbstractOrdersEventHandlerUnitTest.java diff --git a/axon/src/test/java/com/baeldung/axon/querymodel/InMemoryOrdersEventHandlerUnitTest.java b/patterns-modules/axon/src/test/java/com/baeldung/axon/querymodel/InMemoryOrdersEventHandlerUnitTest.java similarity index 100% rename from axon/src/test/java/com/baeldung/axon/querymodel/InMemoryOrdersEventHandlerUnitTest.java rename to patterns-modules/axon/src/test/java/com/baeldung/axon/querymodel/InMemoryOrdersEventHandlerUnitTest.java diff --git a/axon/src/test/java/com/baeldung/axon/querymodel/MongoOrdersEventHandlerUnitTest.java b/patterns-modules/axon/src/test/java/com/baeldung/axon/querymodel/MongoOrdersEventHandlerUnitTest.java similarity index 100% rename from axon/src/test/java/com/baeldung/axon/querymodel/MongoOrdersEventHandlerUnitTest.java rename to patterns-modules/axon/src/test/java/com/baeldung/axon/querymodel/MongoOrdersEventHandlerUnitTest.java diff --git a/axon/src/test/java/com/baeldung/axon/querymodel/OrderQueryServiceIntegrationTest.java b/patterns-modules/axon/src/test/java/com/baeldung/axon/querymodel/OrderQueryServiceIntegrationTest.java similarity index 100% rename from axon/src/test/java/com/baeldung/axon/querymodel/OrderQueryServiceIntegrationTest.java rename to patterns-modules/axon/src/test/java/com/baeldung/axon/querymodel/OrderQueryServiceIntegrationTest.java diff --git a/axon/src/test/resources/application.properties b/patterns-modules/axon/src/test/resources/application.properties similarity index 100% rename from axon/src/test/resources/application.properties rename to patterns-modules/axon/src/test/resources/application.properties diff --git a/axon/start_axon_server.sh b/patterns-modules/axon/start_axon_server.sh old mode 100755 new mode 100644 similarity index 100% rename from axon/start_axon_server.sh rename to patterns-modules/axon/start_axon_server.sh diff --git a/axon/start_mongo.sh b/patterns-modules/axon/start_mongo.sh old mode 100755 new mode 100644 similarity index 100% rename from axon/start_mongo.sh rename to patterns-modules/axon/start_mongo.sh diff --git a/ddd-contexts/README.md b/patterns-modules/ddd-contexts/README.md similarity index 100% rename from ddd-contexts/README.md rename to patterns-modules/ddd-contexts/README.md diff --git a/ddd-contexts/ddd-contexts-infrastructure/pom.xml b/patterns-modules/ddd-contexts/ddd-contexts-infrastructure/pom.xml similarity index 100% rename from ddd-contexts/ddd-contexts-infrastructure/pom.xml rename to patterns-modules/ddd-contexts/ddd-contexts-infrastructure/pom.xml diff --git a/ddd-contexts/ddd-contexts-infrastructure/src/main/java/com/baeldung/dddcontexts/infrastructure/db/InMemoryOrderStore.java b/patterns-modules/ddd-contexts/ddd-contexts-infrastructure/src/main/java/com/baeldung/dddcontexts/infrastructure/db/InMemoryOrderStore.java similarity index 100% rename from ddd-contexts/ddd-contexts-infrastructure/src/main/java/com/baeldung/dddcontexts/infrastructure/db/InMemoryOrderStore.java rename to patterns-modules/ddd-contexts/ddd-contexts-infrastructure/src/main/java/com/baeldung/dddcontexts/infrastructure/db/InMemoryOrderStore.java diff --git a/ddd-contexts/ddd-contexts-infrastructure/src/main/java/com/baeldung/dddcontexts/infrastructure/events/SimpleEventBus.java b/patterns-modules/ddd-contexts/ddd-contexts-infrastructure/src/main/java/com/baeldung/dddcontexts/infrastructure/events/SimpleEventBus.java similarity index 100% rename from ddd-contexts/ddd-contexts-infrastructure/src/main/java/com/baeldung/dddcontexts/infrastructure/events/SimpleEventBus.java rename to patterns-modules/ddd-contexts/ddd-contexts-infrastructure/src/main/java/com/baeldung/dddcontexts/infrastructure/events/SimpleEventBus.java diff --git a/ddd-contexts/ddd-contexts-infrastructure/src/main/java/module-info.java b/patterns-modules/ddd-contexts/ddd-contexts-infrastructure/src/main/java/module-info.java similarity index 100% rename from ddd-contexts/ddd-contexts-infrastructure/src/main/java/module-info.java rename to patterns-modules/ddd-contexts/ddd-contexts-infrastructure/src/main/java/module-info.java diff --git a/ddd-contexts/ddd-contexts-mainapp/pom.xml b/patterns-modules/ddd-contexts/ddd-contexts-mainapp/pom.xml similarity index 100% rename from ddd-contexts/ddd-contexts-mainapp/pom.xml rename to patterns-modules/ddd-contexts/ddd-contexts-mainapp/pom.xml diff --git a/ddd-contexts/ddd-contexts-mainapp/src/main/java/com/baeldung/dddcontexts/mainapp/Application.java b/patterns-modules/ddd-contexts/ddd-contexts-mainapp/src/main/java/com/baeldung/dddcontexts/mainapp/Application.java similarity index 100% rename from ddd-contexts/ddd-contexts-mainapp/src/main/java/com/baeldung/dddcontexts/mainapp/Application.java rename to patterns-modules/ddd-contexts/ddd-contexts-mainapp/src/main/java/com/baeldung/dddcontexts/mainapp/Application.java diff --git a/ddd-contexts/ddd-contexts-mainapp/src/main/java/module-info.java b/patterns-modules/ddd-contexts/ddd-contexts-mainapp/src/main/java/module-info.java similarity index 100% rename from ddd-contexts/ddd-contexts-mainapp/src/main/java/module-info.java rename to patterns-modules/ddd-contexts/ddd-contexts-mainapp/src/main/java/module-info.java diff --git a/ddd-contexts/ddd-contexts-ordercontext/pom.xml b/patterns-modules/ddd-contexts/ddd-contexts-ordercontext/pom.xml similarity index 100% rename from ddd-contexts/ddd-contexts-ordercontext/pom.xml rename to patterns-modules/ddd-contexts/ddd-contexts-ordercontext/pom.xml diff --git a/ddd-contexts/ddd-contexts-ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/model/CustomerOrder.java b/patterns-modules/ddd-contexts/ddd-contexts-ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/model/CustomerOrder.java similarity index 100% rename from ddd-contexts/ddd-contexts-ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/model/CustomerOrder.java rename to patterns-modules/ddd-contexts/ddd-contexts-ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/model/CustomerOrder.java diff --git a/ddd-contexts/ddd-contexts-ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/model/OrderItem.java b/patterns-modules/ddd-contexts/ddd-contexts-ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/model/OrderItem.java similarity index 100% rename from ddd-contexts/ddd-contexts-ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/model/OrderItem.java rename to patterns-modules/ddd-contexts/ddd-contexts-ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/model/OrderItem.java diff --git a/ddd-contexts/ddd-contexts-ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/repository/CustomerOrderRepository.java b/patterns-modules/ddd-contexts/ddd-contexts-ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/repository/CustomerOrderRepository.java similarity index 100% rename from ddd-contexts/ddd-contexts-ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/repository/CustomerOrderRepository.java rename to patterns-modules/ddd-contexts/ddd-contexts-ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/repository/CustomerOrderRepository.java diff --git a/ddd-contexts/ddd-contexts-ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/service/CustomerOrderService.java b/patterns-modules/ddd-contexts/ddd-contexts-ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/service/CustomerOrderService.java similarity index 100% rename from ddd-contexts/ddd-contexts-ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/service/CustomerOrderService.java rename to patterns-modules/ddd-contexts/ddd-contexts-ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/service/CustomerOrderService.java diff --git a/ddd-contexts/ddd-contexts-ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/service/OrderService.java b/patterns-modules/ddd-contexts/ddd-contexts-ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/service/OrderService.java similarity index 100% rename from ddd-contexts/ddd-contexts-ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/service/OrderService.java rename to patterns-modules/ddd-contexts/ddd-contexts-ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/service/OrderService.java diff --git a/ddd-contexts/ddd-contexts-ordercontext/src/main/java/module-info.java b/patterns-modules/ddd-contexts/ddd-contexts-ordercontext/src/main/java/module-info.java similarity index 100% rename from ddd-contexts/ddd-contexts-ordercontext/src/main/java/module-info.java rename to patterns-modules/ddd-contexts/ddd-contexts-ordercontext/src/main/java/module-info.java diff --git a/ddd-contexts/ddd-contexts-sharedkernel/pom.xml b/patterns-modules/ddd-contexts/ddd-contexts-sharedkernel/pom.xml similarity index 100% rename from ddd-contexts/ddd-contexts-sharedkernel/pom.xml rename to patterns-modules/ddd-contexts/ddd-contexts-sharedkernel/pom.xml diff --git a/ddd-contexts/ddd-contexts-sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/events/ApplicationEvent.java b/patterns-modules/ddd-contexts/ddd-contexts-sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/events/ApplicationEvent.java similarity index 100% rename from ddd-contexts/ddd-contexts-sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/events/ApplicationEvent.java rename to patterns-modules/ddd-contexts/ddd-contexts-sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/events/ApplicationEvent.java diff --git a/ddd-contexts/ddd-contexts-sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/events/EventBus.java b/patterns-modules/ddd-contexts/ddd-contexts-sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/events/EventBus.java similarity index 100% rename from ddd-contexts/ddd-contexts-sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/events/EventBus.java rename to patterns-modules/ddd-contexts/ddd-contexts-sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/events/EventBus.java diff --git a/ddd-contexts/ddd-contexts-sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/events/EventSubscriber.java b/patterns-modules/ddd-contexts/ddd-contexts-sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/events/EventSubscriber.java similarity index 100% rename from ddd-contexts/ddd-contexts-sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/events/EventSubscriber.java rename to patterns-modules/ddd-contexts/ddd-contexts-sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/events/EventSubscriber.java diff --git a/ddd-contexts/ddd-contexts-sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/service/ApplicationService.java b/patterns-modules/ddd-contexts/ddd-contexts-sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/service/ApplicationService.java similarity index 100% rename from ddd-contexts/ddd-contexts-sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/service/ApplicationService.java rename to patterns-modules/ddd-contexts/ddd-contexts-sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/service/ApplicationService.java diff --git a/ddd-contexts/ddd-contexts-sharedkernel/src/main/java/module-info.java b/patterns-modules/ddd-contexts/ddd-contexts-sharedkernel/src/main/java/module-info.java similarity index 100% rename from ddd-contexts/ddd-contexts-sharedkernel/src/main/java/module-info.java rename to patterns-modules/ddd-contexts/ddd-contexts-sharedkernel/src/main/java/module-info.java diff --git a/ddd-contexts/ddd-contexts-shippingcontext/pom.xml b/patterns-modules/ddd-contexts/ddd-contexts-shippingcontext/pom.xml similarity index 100% rename from ddd-contexts/ddd-contexts-shippingcontext/pom.xml rename to patterns-modules/ddd-contexts/ddd-contexts-shippingcontext/pom.xml diff --git a/ddd-contexts/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/model/PackageItem.java b/patterns-modules/ddd-contexts/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/model/PackageItem.java similarity index 100% rename from ddd-contexts/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/model/PackageItem.java rename to patterns-modules/ddd-contexts/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/model/PackageItem.java diff --git a/ddd-contexts/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/model/Parcel.java b/patterns-modules/ddd-contexts/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/model/Parcel.java similarity index 100% rename from ddd-contexts/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/model/Parcel.java rename to patterns-modules/ddd-contexts/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/model/Parcel.java diff --git a/ddd-contexts/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/model/ShippableOrder.java b/patterns-modules/ddd-contexts/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/model/ShippableOrder.java similarity index 100% rename from ddd-contexts/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/model/ShippableOrder.java rename to patterns-modules/ddd-contexts/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/model/ShippableOrder.java diff --git a/ddd-contexts/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/repository/ShippingOrderRepository.java b/patterns-modules/ddd-contexts/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/repository/ShippingOrderRepository.java similarity index 100% rename from ddd-contexts/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/repository/ShippingOrderRepository.java rename to patterns-modules/ddd-contexts/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/repository/ShippingOrderRepository.java diff --git a/ddd-contexts/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/service/ParcelShippingService.java b/patterns-modules/ddd-contexts/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/service/ParcelShippingService.java similarity index 100% rename from ddd-contexts/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/service/ParcelShippingService.java rename to patterns-modules/ddd-contexts/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/service/ParcelShippingService.java diff --git a/ddd-contexts/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/service/ShippingService.java b/patterns-modules/ddd-contexts/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/service/ShippingService.java similarity index 100% rename from ddd-contexts/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/service/ShippingService.java rename to patterns-modules/ddd-contexts/ddd-contexts-shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/service/ShippingService.java diff --git a/ddd-contexts/ddd-contexts-shippingcontext/src/main/java/module-info.java b/patterns-modules/ddd-contexts/ddd-contexts-shippingcontext/src/main/java/module-info.java similarity index 100% rename from ddd-contexts/ddd-contexts-shippingcontext/src/main/java/module-info.java rename to patterns-modules/ddd-contexts/ddd-contexts-shippingcontext/src/main/java/module-info.java diff --git a/ddd-contexts/pom.xml b/patterns-modules/ddd-contexts/pom.xml similarity index 98% rename from ddd-contexts/pom.xml rename to patterns-modules/ddd-contexts/pom.xml index 961a1d1624..f43581b0c8 100644 --- a/ddd-contexts/pom.xml +++ b/patterns-modules/ddd-contexts/pom.xml @@ -11,7 +11,7 @@ com.baeldung - parent-modules + patterns-modules 1.0.0-SNAPSHOT diff --git a/ddd/README.md b/patterns-modules/ddd/README.md similarity index 100% rename from ddd/README.md rename to patterns-modules/ddd/README.md diff --git a/ddd/pom.xml b/patterns-modules/ddd/pom.xml similarity index 98% rename from ddd/pom.xml rename to patterns-modules/ddd/pom.xml index 443b2b5148..80147c29c6 100644 --- a/ddd/pom.xml +++ b/patterns-modules/ddd/pom.xml @@ -12,7 +12,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/ddd/src/main/java/com/baeldung/ddd/PersistingDddAggregatesApplication.java b/patterns-modules/ddd/src/main/java/com/baeldung/ddd/PersistingDddAggregatesApplication.java similarity index 96% rename from ddd/src/main/java/com/baeldung/ddd/PersistingDddAggregatesApplication.java rename to patterns-modules/ddd/src/main/java/com/baeldung/ddd/PersistingDddAggregatesApplication.java index 3a52fd0440..2d671ff85e 100644 --- a/ddd/src/main/java/com/baeldung/ddd/PersistingDddAggregatesApplication.java +++ b/patterns-modules/ddd/src/main/java/com/baeldung/ddd/PersistingDddAggregatesApplication.java @@ -1,12 +1,12 @@ -package com.baeldung.ddd; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication(scanBasePackages = "com.baeldung.ddd.order") -public class PersistingDddAggregatesApplication { - - public static void main(String[] args) { - SpringApplication.run(PersistingDddAggregatesApplication.class, args); - } -} +package com.baeldung.ddd; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication(scanBasePackages = "com.baeldung.ddd.order") +public class PersistingDddAggregatesApplication { + + public static void main(String[] args) { + SpringApplication.run(PersistingDddAggregatesApplication.class, args); + } +} diff --git a/ddd/src/main/java/com/baeldung/ddd/order/Order.java b/patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/Order.java similarity index 100% rename from ddd/src/main/java/com/baeldung/ddd/order/Order.java rename to patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/Order.java diff --git a/ddd/src/main/java/com/baeldung/ddd/order/OrderLine.java b/patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/OrderLine.java similarity index 100% rename from ddd/src/main/java/com/baeldung/ddd/order/OrderLine.java rename to patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/OrderLine.java diff --git a/ddd/src/main/java/com/baeldung/ddd/order/Product.java b/patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/Product.java similarity index 100% rename from ddd/src/main/java/com/baeldung/ddd/order/Product.java rename to patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/Product.java diff --git a/ddd/src/main/java/com/baeldung/ddd/order/config/CustomMongoConfiguration.java b/patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/config/CustomMongoConfiguration.java similarity index 100% rename from ddd/src/main/java/com/baeldung/ddd/order/config/CustomMongoConfiguration.java rename to patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/config/CustomMongoConfiguration.java diff --git a/ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/AmountBasedDiscountPolicy.java b/patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/AmountBasedDiscountPolicy.java similarity index 100% rename from ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/AmountBasedDiscountPolicy.java rename to patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/AmountBasedDiscountPolicy.java diff --git a/ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/DiscountPolicy.java b/patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/DiscountPolicy.java similarity index 100% rename from ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/DiscountPolicy.java rename to patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/DiscountPolicy.java diff --git a/ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/FlatDiscountPolicy.java b/patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/FlatDiscountPolicy.java similarity index 100% rename from ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/FlatDiscountPolicy.java rename to patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/FlatDiscountPolicy.java diff --git a/ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/Order.java b/patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/Order.java similarity index 100% rename from ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/Order.java rename to patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/Order.java diff --git a/ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/SpecialDiscountPolicy.java b/patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/SpecialDiscountPolicy.java similarity index 100% rename from ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/SpecialDiscountPolicy.java rename to patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/SpecialDiscountPolicy.java diff --git a/ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/SpecialOrder.java b/patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/SpecialOrder.java similarity index 100% rename from ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/SpecialOrder.java rename to patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/SpecialOrder.java diff --git a/ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/visitor/HtmlOrderViewCreator.java b/patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/visitor/HtmlOrderViewCreator.java similarity index 100% rename from ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/visitor/HtmlOrderViewCreator.java rename to patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/visitor/HtmlOrderViewCreator.java diff --git a/ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/visitor/OrderVisitor.java b/patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/visitor/OrderVisitor.java similarity index 100% rename from ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/visitor/OrderVisitor.java rename to patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/visitor/OrderVisitor.java diff --git a/ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/visitor/Visitable.java b/patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/visitor/Visitable.java similarity index 100% rename from ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/visitor/Visitable.java rename to patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/doubledispatch/visitor/Visitable.java diff --git a/ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaOrder.java b/patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaOrder.java similarity index 100% rename from ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaOrder.java rename to patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaOrder.java diff --git a/ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaOrderLine.java b/patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaOrderLine.java similarity index 100% rename from ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaOrderLine.java rename to patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaOrderLine.java diff --git a/ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaOrderRepository.java b/patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaOrderRepository.java similarity index 100% rename from ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaOrderRepository.java rename to patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaOrderRepository.java diff --git a/ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaProduct.java b/patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaProduct.java similarity index 100% rename from ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaProduct.java rename to patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/jpa/JpaProduct.java diff --git a/ddd/src/main/java/com/baeldung/ddd/order/mongo/OrderMongoRepository.java b/patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/mongo/OrderMongoRepository.java similarity index 100% rename from ddd/src/main/java/com/baeldung/ddd/order/mongo/OrderMongoRepository.java rename to patterns-modules/ddd/src/main/java/com/baeldung/ddd/order/mongo/OrderMongoRepository.java diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/DomainLayerApplication.java b/patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/DomainLayerApplication.java similarity index 100% rename from ddd/src/main/java/com/baeldung/dddhexagonalspring/DomainLayerApplication.java rename to patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/DomainLayerApplication.java diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/application/cli/CliOrderController.java b/patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/application/cli/CliOrderController.java similarity index 100% rename from ddd/src/main/java/com/baeldung/dddhexagonalspring/application/cli/CliOrderController.java rename to patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/application/cli/CliOrderController.java diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/application/request/AddProductRequest.java b/patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/application/request/AddProductRequest.java similarity index 100% rename from ddd/src/main/java/com/baeldung/dddhexagonalspring/application/request/AddProductRequest.java rename to patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/application/request/AddProductRequest.java diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/application/request/CreateOrderRequest.java b/patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/application/request/CreateOrderRequest.java similarity index 100% rename from ddd/src/main/java/com/baeldung/dddhexagonalspring/application/request/CreateOrderRequest.java rename to patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/application/request/CreateOrderRequest.java diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/application/response/CreateOrderResponse.java b/patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/application/response/CreateOrderResponse.java similarity index 100% rename from ddd/src/main/java/com/baeldung/dddhexagonalspring/application/response/CreateOrderResponse.java rename to patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/application/response/CreateOrderResponse.java diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/application/rest/OrderController.java b/patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/application/rest/OrderController.java similarity index 100% rename from ddd/src/main/java/com/baeldung/dddhexagonalspring/application/rest/OrderController.java rename to patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/application/rest/OrderController.java diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/DomainException.java b/patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/DomainException.java similarity index 100% rename from ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/DomainException.java rename to patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/DomainException.java diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/Order.java b/patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/Order.java similarity index 100% rename from ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/Order.java rename to patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/Order.java diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/OrderItem.java b/patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/OrderItem.java similarity index 100% rename from ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/OrderItem.java rename to patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/OrderItem.java diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/OrderStatus.java b/patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/OrderStatus.java similarity index 100% rename from ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/OrderStatus.java rename to patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/OrderStatus.java diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/Product.java b/patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/Product.java similarity index 100% rename from ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/Product.java rename to patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/Product.java diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/repository/OrderRepository.java b/patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/repository/OrderRepository.java similarity index 100% rename from ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/repository/OrderRepository.java rename to patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/repository/OrderRepository.java diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/service/DomainOrderService.java b/patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/service/DomainOrderService.java similarity index 100% rename from ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/service/DomainOrderService.java rename to patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/service/DomainOrderService.java diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/service/OrderService.java b/patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/service/OrderService.java similarity index 100% rename from ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/service/OrderService.java rename to patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/service/OrderService.java diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/configuration/BeanConfiguration.java b/patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/configuration/BeanConfiguration.java similarity index 100% rename from ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/configuration/BeanConfiguration.java rename to patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/configuration/BeanConfiguration.java diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/configuration/CassandraConfiguration.java b/patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/configuration/CassandraConfiguration.java similarity index 100% rename from ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/configuration/CassandraConfiguration.java rename to patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/configuration/CassandraConfiguration.java diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/configuration/MongoDBConfiguration.java b/patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/configuration/MongoDBConfiguration.java similarity index 100% rename from ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/configuration/MongoDBConfiguration.java rename to patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/configuration/MongoDBConfiguration.java diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/cassandra/CassandraDbOrderRepository.java b/patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/cassandra/CassandraDbOrderRepository.java similarity index 100% rename from ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/cassandra/CassandraDbOrderRepository.java rename to patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/cassandra/CassandraDbOrderRepository.java diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/cassandra/OrderEntity.java b/patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/cassandra/OrderEntity.java similarity index 100% rename from ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/cassandra/OrderEntity.java rename to patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/cassandra/OrderEntity.java diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/cassandra/OrderItemEntity.java b/patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/cassandra/OrderItemEntity.java similarity index 100% rename from ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/cassandra/OrderItemEntity.java rename to patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/cassandra/OrderItemEntity.java diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/cassandra/SpringDataCassandraOrderRepository.java b/patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/cassandra/SpringDataCassandraOrderRepository.java similarity index 100% rename from ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/cassandra/SpringDataCassandraOrderRepository.java rename to patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/cassandra/SpringDataCassandraOrderRepository.java diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/mongo/MongoDbOrderRepository.java b/patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/mongo/MongoDbOrderRepository.java similarity index 100% rename from ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/mongo/MongoDbOrderRepository.java rename to patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/mongo/MongoDbOrderRepository.java diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/mongo/SpringDataMongoOrderRepository.java b/patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/mongo/SpringDataMongoOrderRepository.java similarity index 100% rename from ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/mongo/SpringDataMongoOrderRepository.java rename to patterns-modules/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/mongo/SpringDataMongoOrderRepository.java diff --git a/ddd/src/main/resources/ddd-layers.properties b/patterns-modules/ddd/src/main/resources/ddd-layers.properties similarity index 100% rename from ddd/src/main/resources/ddd-layers.properties rename to patterns-modules/ddd/src/main/resources/ddd-layers.properties diff --git a/ddd/src/test/java/com/baeldung/ddd/order/OrderFixtureUtils.java b/patterns-modules/ddd/src/test/java/com/baeldung/ddd/order/OrderFixtureUtils.java similarity index 100% rename from ddd/src/test/java/com/baeldung/ddd/order/OrderFixtureUtils.java rename to patterns-modules/ddd/src/test/java/com/baeldung/ddd/order/OrderFixtureUtils.java diff --git a/ddd/src/test/java/com/baeldung/ddd/order/OrderUnitTest.java b/patterns-modules/ddd/src/test/java/com/baeldung/ddd/order/OrderUnitTest.java similarity index 100% rename from ddd/src/test/java/com/baeldung/ddd/order/OrderUnitTest.java rename to patterns-modules/ddd/src/test/java/com/baeldung/ddd/order/OrderUnitTest.java diff --git a/ddd/src/test/java/com/baeldung/ddd/order/doubledispatch/DoubleDispatchDiscountPolicyUnitTest.java b/patterns-modules/ddd/src/test/java/com/baeldung/ddd/order/doubledispatch/DoubleDispatchDiscountPolicyUnitTest.java similarity index 100% rename from ddd/src/test/java/com/baeldung/ddd/order/doubledispatch/DoubleDispatchDiscountPolicyUnitTest.java rename to patterns-modules/ddd/src/test/java/com/baeldung/ddd/order/doubledispatch/DoubleDispatchDiscountPolicyUnitTest.java diff --git a/ddd/src/test/java/com/baeldung/ddd/order/doubledispatch/HtmlOrderViewCreatorUnitTest.java b/patterns-modules/ddd/src/test/java/com/baeldung/ddd/order/doubledispatch/HtmlOrderViewCreatorUnitTest.java similarity index 100% rename from ddd/src/test/java/com/baeldung/ddd/order/doubledispatch/HtmlOrderViewCreatorUnitTest.java rename to patterns-modules/ddd/src/test/java/com/baeldung/ddd/order/doubledispatch/HtmlOrderViewCreatorUnitTest.java diff --git a/ddd/src/test/java/com/baeldung/ddd/order/doubledispatch/MethodOverloadExampleUnitTest.java b/patterns-modules/ddd/src/test/java/com/baeldung/ddd/order/doubledispatch/MethodOverloadExampleUnitTest.java similarity index 100% rename from ddd/src/test/java/com/baeldung/ddd/order/doubledispatch/MethodOverloadExampleUnitTest.java rename to patterns-modules/ddd/src/test/java/com/baeldung/ddd/order/doubledispatch/MethodOverloadExampleUnitTest.java diff --git a/ddd/src/test/java/com/baeldung/ddd/order/doubledispatch/SingleDispatchDiscountPolicyUnitTest.java b/patterns-modules/ddd/src/test/java/com/baeldung/ddd/order/doubledispatch/SingleDispatchDiscountPolicyUnitTest.java similarity index 100% rename from ddd/src/test/java/com/baeldung/ddd/order/doubledispatch/SingleDispatchDiscountPolicyUnitTest.java rename to patterns-modules/ddd/src/test/java/com/baeldung/ddd/order/doubledispatch/SingleDispatchDiscountPolicyUnitTest.java diff --git a/ddd/src/test/java/com/baeldung/ddd/order/jpa/PersistOrderLiveTest.java b/patterns-modules/ddd/src/test/java/com/baeldung/ddd/order/jpa/PersistOrderLiveTest.java similarity index 100% rename from ddd/src/test/java/com/baeldung/ddd/order/jpa/PersistOrderLiveTest.java rename to patterns-modules/ddd/src/test/java/com/baeldung/ddd/order/jpa/PersistOrderLiveTest.java diff --git a/ddd/src/test/java/com/baeldung/ddd/order/jpa/ViolateOrderBusinessRulesUnitTest.java b/patterns-modules/ddd/src/test/java/com/baeldung/ddd/order/jpa/ViolateOrderBusinessRulesUnitTest.java similarity index 100% rename from ddd/src/test/java/com/baeldung/ddd/order/jpa/ViolateOrderBusinessRulesUnitTest.java rename to patterns-modules/ddd/src/test/java/com/baeldung/ddd/order/jpa/ViolateOrderBusinessRulesUnitTest.java diff --git a/ddd/src/test/java/com/baeldung/ddd/order/mongo/OrderMongoLiveTest.java b/patterns-modules/ddd/src/test/java/com/baeldung/ddd/order/mongo/OrderMongoLiveTest.java similarity index 100% rename from ddd/src/test/java/com/baeldung/ddd/order/mongo/OrderMongoLiveTest.java rename to patterns-modules/ddd/src/test/java/com/baeldung/ddd/order/mongo/OrderMongoLiveTest.java diff --git a/ddd/src/test/java/com/baeldung/dddhexagonalspring/domain/OrderProvider.java b/patterns-modules/ddd/src/test/java/com/baeldung/dddhexagonalspring/domain/OrderProvider.java similarity index 100% rename from ddd/src/test/java/com/baeldung/dddhexagonalspring/domain/OrderProvider.java rename to patterns-modules/ddd/src/test/java/com/baeldung/dddhexagonalspring/domain/OrderProvider.java diff --git a/ddd/src/test/java/com/baeldung/dddhexagonalspring/domain/OrderUnitTest.java b/patterns-modules/ddd/src/test/java/com/baeldung/dddhexagonalspring/domain/OrderUnitTest.java similarity index 100% rename from ddd/src/test/java/com/baeldung/dddhexagonalspring/domain/OrderUnitTest.java rename to patterns-modules/ddd/src/test/java/com/baeldung/dddhexagonalspring/domain/OrderUnitTest.java diff --git a/ddd/src/test/java/com/baeldung/dddhexagonalspring/domain/service/DomainOrderServiceUnitTest.java b/patterns-modules/ddd/src/test/java/com/baeldung/dddhexagonalspring/domain/service/DomainOrderServiceUnitTest.java similarity index 100% rename from ddd/src/test/java/com/baeldung/dddhexagonalspring/domain/service/DomainOrderServiceUnitTest.java rename to patterns-modules/ddd/src/test/java/com/baeldung/dddhexagonalspring/domain/service/DomainOrderServiceUnitTest.java diff --git a/ddd/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/CassandraDbOrderRepositoryLiveTest.java b/patterns-modules/ddd/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/CassandraDbOrderRepositoryLiveTest.java similarity index 100% rename from ddd/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/CassandraDbOrderRepositoryLiveTest.java rename to patterns-modules/ddd/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/CassandraDbOrderRepositoryLiveTest.java diff --git a/ddd/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/MongoDbOrderRepositoryLiveTest.java b/patterns-modules/ddd/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/MongoDbOrderRepositoryLiveTest.java similarity index 100% rename from ddd/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/MongoDbOrderRepositoryLiveTest.java rename to patterns-modules/ddd/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/MongoDbOrderRepositoryLiveTest.java diff --git a/ddd/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/MongoDbOrderRepositoryUnitTest.java b/patterns-modules/ddd/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/MongoDbOrderRepositoryUnitTest.java similarity index 100% rename from ddd/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/MongoDbOrderRepositoryUnitTest.java rename to patterns-modules/ddd/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/MongoDbOrderRepositoryUnitTest.java diff --git a/ddd/src/test/resources/com/baeldung/dddhexagonalspring/README.md b/patterns-modules/ddd/src/test/resources/com/baeldung/dddhexagonalspring/README.md similarity index 100% rename from ddd/src/test/resources/com/baeldung/dddhexagonalspring/README.md rename to patterns-modules/ddd/src/test/resources/com/baeldung/dddhexagonalspring/README.md diff --git a/ddd/src/test/resources/com/baeldung/dddhexagonalspring/cassandra-init.cql b/patterns-modules/ddd/src/test/resources/com/baeldung/dddhexagonalspring/cassandra-init.cql similarity index 100% rename from ddd/src/test/resources/com/baeldung/dddhexagonalspring/cassandra-init.cql rename to patterns-modules/ddd/src/test/resources/com/baeldung/dddhexagonalspring/cassandra-init.cql diff --git a/ddd/src/test/resources/com/baeldung/dddhexagonalspring/docker-compose.yml b/patterns-modules/ddd/src/test/resources/com/baeldung/dddhexagonalspring/docker-compose.yml similarity index 100% rename from ddd/src/test/resources/com/baeldung/dddhexagonalspring/docker-compose.yml rename to patterns-modules/ddd/src/test/resources/com/baeldung/dddhexagonalspring/docker-compose.yml diff --git a/ddd/src/test/resources/com/baeldung/dddhexagonalspring/mongo-init.js b/patterns-modules/ddd/src/test/resources/com/baeldung/dddhexagonalspring/mongo-init.js similarity index 100% rename from ddd/src/test/resources/com/baeldung/dddhexagonalspring/mongo-init.js rename to patterns-modules/ddd/src/test/resources/com/baeldung/dddhexagonalspring/mongo-init.js diff --git a/ddd/src/test/resources/ddd-layers-test.properties b/patterns-modules/ddd/src/test/resources/ddd-layers-test.properties similarity index 100% rename from ddd/src/test/resources/ddd-layers-test.properties rename to patterns-modules/ddd/src/test/resources/ddd-layers-test.properties diff --git a/patterns-modules/pom.xml b/patterns-modules/pom.xml index add2b0475b..7dd26ac31c 100644 --- a/patterns-modules/pom.xml +++ b/patterns-modules/pom.xml @@ -14,6 +14,12 @@ + axon + clean-architecture + coupling + cqrs-es + ddd + ddd-contexts design-patterns-architectural design-patterns-behavioral design-patterns-behavioral-2 @@ -24,14 +30,11 @@ design-patterns-singleton design-patterns-structural dip - cqrs-es + enterprise-patterns front-controller + idd intercepting-filter solid - clean-architecture - enterprise-patterns - coupling - idd diff --git a/pom.xml b/pom.xml index 327d83017f..a5abb59502 100644 --- a/pom.xml +++ b/pom.xml @@ -771,7 +771,6 @@ core-java-modules custom-pmd data-structures - ddd-contexts jackson-modules jmh deeplearning4j @@ -821,11 +820,8 @@ atomikos atomix - axon - bazel google-auto-project - ddd disruptor dozer dubbo @@ -1057,7 +1053,6 @@ spring-aop-2 custom-pmd data-structures - ddd-contexts jackson-modules jmh deeplearning4j @@ -1107,11 +1102,8 @@ atomikos atomix - axon - bazel google-auto-project - ddd disruptor dozer From 520b679733d06d32a7fd9792c9e3519924f0be98 Mon Sep 17 00:00:00 2001 From: anuragkumawat Date: Fri, 27 Oct 2023 17:04:45 +0530 Subject: [PATCH 17/26] JAVA-26393 Move couchbase to persistence-modules (#15059) --- {couchbase => persistence-modules/couchbase}/.gitignore | 0 {couchbase => persistence-modules/couchbase}/README.md | 0 {couchbase => persistence-modules/couchbase}/mvnw | 0 {couchbase => persistence-modules/couchbase}/mvnw.cmd | 0 {couchbase => persistence-modules/couchbase}/pom.xml | 2 +- .../java/com/baeldung/couchbase/async/CouchbaseEntity.java | 0 .../main/java/com/baeldung/couchbase/async/person/Person.java | 0 .../baeldung/couchbase/async/person/PersonCrudService.java | 0 .../couchbase/async/person/PersonDocumentConverter.java | 0 .../baeldung/couchbase/async/person/RegistrationService.java | 0 .../couchbase/async/service/AbstractBucketService.java | 0 .../baeldung/couchbase/async/service/AbstractCrudService.java | 0 .../com/baeldung/couchbase/async/service/BucketService.java | 0 .../com/baeldung/couchbase/async/service/ClusterService.java | 0 .../baeldung/couchbase/async/service/ClusterServiceImpl.java | 0 .../com/baeldung/couchbase/async/service/CrudService.java | 0 .../couchbase/async/service/JsonDocumentConverter.java | 0 .../couchbase/async/service/TutorialBucketService.java | 0 .../main/java/com/baeldung/couchbase/intro/CodeSnippets.java | 0 .../baeldung/couchbase/mapreduce/CouchbaseKeyGenerator.java | 0 .../baeldung/couchbase/mapreduce/DuplicateKeyException.java | 0 .../com/baeldung/couchbase/mapreduce/RandomUUIDGenerator.java | 0 .../java/com/baeldung/couchbase/mapreduce/StudentGrade.java | 0 .../couchbase/mapreduce/StudentGradeKeyGenerator.java | 0 .../couchbase/mapreduce/StudentGradeQueryBuilder.java | 0 .../com/baeldung/couchbase/mapreduce/StudentGradeService.java | 0 .../main/java/com/baeldung/couchbase/n1ql/BucketFactory.java | 0 .../main/java/com/baeldung/couchbase/n1ql/CodeSnippets.java | 0 .../java/com/baeldung/couchbase/spring/person/Person.java | 0 .../baeldung/couchbase/spring/person/PersonCrudService.java | 0 .../couchbase/spring/person/PersonDocumentConverter.java | 0 .../baeldung/couchbase/spring/person/RegistrationService.java | 0 .../com/baeldung/couchbase/spring/service/BucketService.java | 0 .../com/baeldung/couchbase/spring/service/ClusterService.java | 0 .../baeldung/couchbase/spring/service/ClusterServiceImpl.java | 0 .../com/baeldung/couchbase/spring/service/CrudService.java | 0 .../couchbase/spring/service/JsonDocumentConverter.java | 0 .../couchbase/spring/service/TutorialBucketService.java | 0 .../couchbase}/src/main/resources/application.properties | 0 .../couchbase}/src/main/resources/logback.xml | 0 .../com/baeldung/couchbase/async/AsyncIntegrationTest.java | 0 .../baeldung/couchbase/async/AsyncIntegrationTestConfig.java | 0 .../async/person/PersonCrudServiceIntegrationTestConfig.java | 0 .../couchbase/async/person/PersonCrudServiceLiveTest.java | 0 .../couchbase/async/service/ClusterServiceLiveTest.java | 0 .../couchbase/mapreduce/StudentGradeServiceLiveTest.java | 0 .../com/baeldung/couchbase/n1ql/IntegrationTestConfig.java | 0 .../test/java/com/baeldung/couchbase/n1ql/N1QLLiveTest.java | 0 .../java/com/baeldung/couchbase/spring/IntegrationTest.java | 0 .../com/baeldung/couchbase/spring/IntegrationTestConfig.java | 0 .../couchbase/spring/person/PersonCrudServiceLiveTest.java | 0 .../couchbase/spring/service/ClusterServiceLiveTest.java | 0 .../couchbase}/src/test/resources/logback.xml | 0 persistence-modules/pom.xml | 1 + pom.xml | 4 +--- 55 files changed, 3 insertions(+), 4 deletions(-) rename {couchbase => persistence-modules/couchbase}/.gitignore (100%) rename {couchbase => persistence-modules/couchbase}/README.md (100%) rename {couchbase => persistence-modules/couchbase}/mvnw (100%) rename {couchbase => persistence-modules/couchbase}/mvnw.cmd (100%) rename {couchbase => persistence-modules/couchbase}/pom.xml (98%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/async/CouchbaseEntity.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/async/person/Person.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/async/person/PersonCrudService.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/async/person/PersonDocumentConverter.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/async/person/RegistrationService.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/async/service/AbstractBucketService.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/async/service/AbstractCrudService.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/async/service/BucketService.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/async/service/ClusterService.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/async/service/ClusterServiceImpl.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/async/service/CrudService.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/async/service/JsonDocumentConverter.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/async/service/TutorialBucketService.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/intro/CodeSnippets.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/mapreduce/CouchbaseKeyGenerator.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/mapreduce/DuplicateKeyException.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/mapreduce/RandomUUIDGenerator.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/mapreduce/StudentGrade.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/mapreduce/StudentGradeKeyGenerator.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/mapreduce/StudentGradeQueryBuilder.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/mapreduce/StudentGradeService.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/n1ql/BucketFactory.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/n1ql/CodeSnippets.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/spring/person/Person.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/spring/person/PersonCrudService.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/spring/person/PersonDocumentConverter.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/spring/person/RegistrationService.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/spring/service/BucketService.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/spring/service/ClusterService.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/spring/service/ClusterServiceImpl.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/spring/service/CrudService.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/spring/service/JsonDocumentConverter.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/java/com/baeldung/couchbase/spring/service/TutorialBucketService.java (100%) rename {couchbase => persistence-modules/couchbase}/src/main/resources/application.properties (100%) rename {couchbase => persistence-modules/couchbase}/src/main/resources/logback.xml (100%) rename {couchbase => persistence-modules/couchbase}/src/test/java/com/baeldung/couchbase/async/AsyncIntegrationTest.java (100%) rename {couchbase => persistence-modules/couchbase}/src/test/java/com/baeldung/couchbase/async/AsyncIntegrationTestConfig.java (100%) rename {couchbase => persistence-modules/couchbase}/src/test/java/com/baeldung/couchbase/async/person/PersonCrudServiceIntegrationTestConfig.java (100%) rename {couchbase => persistence-modules/couchbase}/src/test/java/com/baeldung/couchbase/async/person/PersonCrudServiceLiveTest.java (100%) rename {couchbase => persistence-modules/couchbase}/src/test/java/com/baeldung/couchbase/async/service/ClusterServiceLiveTest.java (100%) rename {couchbase => persistence-modules/couchbase}/src/test/java/com/baeldung/couchbase/mapreduce/StudentGradeServiceLiveTest.java (100%) rename {couchbase => persistence-modules/couchbase}/src/test/java/com/baeldung/couchbase/n1ql/IntegrationTestConfig.java (100%) rename {couchbase => persistence-modules/couchbase}/src/test/java/com/baeldung/couchbase/n1ql/N1QLLiveTest.java (100%) rename {couchbase => persistence-modules/couchbase}/src/test/java/com/baeldung/couchbase/spring/IntegrationTest.java (100%) rename {couchbase => persistence-modules/couchbase}/src/test/java/com/baeldung/couchbase/spring/IntegrationTestConfig.java (100%) rename {couchbase => persistence-modules/couchbase}/src/test/java/com/baeldung/couchbase/spring/person/PersonCrudServiceLiveTest.java (100%) rename {couchbase => persistence-modules/couchbase}/src/test/java/com/baeldung/couchbase/spring/service/ClusterServiceLiveTest.java (100%) rename {couchbase => persistence-modules/couchbase}/src/test/resources/logback.xml (100%) diff --git a/couchbase/.gitignore b/persistence-modules/couchbase/.gitignore similarity index 100% rename from couchbase/.gitignore rename to persistence-modules/couchbase/.gitignore diff --git a/couchbase/README.md b/persistence-modules/couchbase/README.md similarity index 100% rename from couchbase/README.md rename to persistence-modules/couchbase/README.md diff --git a/couchbase/mvnw b/persistence-modules/couchbase/mvnw similarity index 100% rename from couchbase/mvnw rename to persistence-modules/couchbase/mvnw diff --git a/couchbase/mvnw.cmd b/persistence-modules/couchbase/mvnw.cmd similarity index 100% rename from couchbase/mvnw.cmd rename to persistence-modules/couchbase/mvnw.cmd diff --git a/couchbase/pom.xml b/persistence-modules/couchbase/pom.xml similarity index 98% rename from couchbase/pom.xml rename to persistence-modules/couchbase/pom.xml index 823b33ee29..b98c0cc387 100644 --- a/couchbase/pom.xml +++ b/persistence-modules/couchbase/pom.xml @@ -10,7 +10,7 @@ com.baeldung - parent-modules + persistence-modules 1.0.0-SNAPSHOT diff --git a/couchbase/src/main/java/com/baeldung/couchbase/async/CouchbaseEntity.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/async/CouchbaseEntity.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/async/CouchbaseEntity.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/async/CouchbaseEntity.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/async/person/Person.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/async/person/Person.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/async/person/Person.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/async/person/Person.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/async/person/PersonCrudService.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/async/person/PersonCrudService.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/async/person/PersonCrudService.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/async/person/PersonCrudService.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/async/person/PersonDocumentConverter.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/async/person/PersonDocumentConverter.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/async/person/PersonDocumentConverter.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/async/person/PersonDocumentConverter.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/async/person/RegistrationService.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/async/person/RegistrationService.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/async/person/RegistrationService.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/async/person/RegistrationService.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/async/service/AbstractBucketService.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/async/service/AbstractBucketService.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/async/service/AbstractBucketService.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/async/service/AbstractBucketService.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/async/service/AbstractCrudService.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/async/service/AbstractCrudService.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/async/service/AbstractCrudService.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/async/service/AbstractCrudService.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/async/service/BucketService.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/async/service/BucketService.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/async/service/BucketService.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/async/service/BucketService.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/async/service/ClusterService.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/async/service/ClusterService.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/async/service/ClusterService.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/async/service/ClusterService.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/async/service/ClusterServiceImpl.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/async/service/ClusterServiceImpl.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/async/service/ClusterServiceImpl.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/async/service/ClusterServiceImpl.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/async/service/CrudService.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/async/service/CrudService.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/async/service/CrudService.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/async/service/CrudService.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/async/service/JsonDocumentConverter.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/async/service/JsonDocumentConverter.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/async/service/JsonDocumentConverter.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/async/service/JsonDocumentConverter.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/async/service/TutorialBucketService.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/async/service/TutorialBucketService.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/async/service/TutorialBucketService.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/async/service/TutorialBucketService.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/intro/CodeSnippets.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/intro/CodeSnippets.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/intro/CodeSnippets.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/intro/CodeSnippets.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/mapreduce/CouchbaseKeyGenerator.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/mapreduce/CouchbaseKeyGenerator.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/mapreduce/CouchbaseKeyGenerator.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/mapreduce/CouchbaseKeyGenerator.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/mapreduce/DuplicateKeyException.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/mapreduce/DuplicateKeyException.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/mapreduce/DuplicateKeyException.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/mapreduce/DuplicateKeyException.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/mapreduce/RandomUUIDGenerator.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/mapreduce/RandomUUIDGenerator.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/mapreduce/RandomUUIDGenerator.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/mapreduce/RandomUUIDGenerator.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/mapreduce/StudentGrade.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/mapreduce/StudentGrade.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/mapreduce/StudentGrade.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/mapreduce/StudentGrade.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/mapreduce/StudentGradeKeyGenerator.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/mapreduce/StudentGradeKeyGenerator.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/mapreduce/StudentGradeKeyGenerator.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/mapreduce/StudentGradeKeyGenerator.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/mapreduce/StudentGradeQueryBuilder.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/mapreduce/StudentGradeQueryBuilder.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/mapreduce/StudentGradeQueryBuilder.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/mapreduce/StudentGradeQueryBuilder.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/mapreduce/StudentGradeService.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/mapreduce/StudentGradeService.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/mapreduce/StudentGradeService.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/mapreduce/StudentGradeService.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/n1ql/BucketFactory.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/n1ql/BucketFactory.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/n1ql/BucketFactory.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/n1ql/BucketFactory.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/n1ql/CodeSnippets.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/n1ql/CodeSnippets.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/n1ql/CodeSnippets.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/n1ql/CodeSnippets.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/spring/person/Person.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/spring/person/Person.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/spring/person/Person.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/spring/person/Person.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/spring/person/PersonCrudService.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/spring/person/PersonCrudService.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/spring/person/PersonCrudService.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/spring/person/PersonCrudService.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/spring/person/PersonDocumentConverter.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/spring/person/PersonDocumentConverter.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/spring/person/PersonDocumentConverter.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/spring/person/PersonDocumentConverter.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/spring/person/RegistrationService.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/spring/person/RegistrationService.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/spring/person/RegistrationService.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/spring/person/RegistrationService.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/spring/service/BucketService.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/spring/service/BucketService.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/spring/service/BucketService.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/spring/service/BucketService.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/spring/service/ClusterService.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/spring/service/ClusterService.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/spring/service/ClusterService.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/spring/service/ClusterService.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/spring/service/ClusterServiceImpl.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/spring/service/ClusterServiceImpl.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/spring/service/ClusterServiceImpl.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/spring/service/ClusterServiceImpl.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/spring/service/CrudService.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/spring/service/CrudService.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/spring/service/CrudService.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/spring/service/CrudService.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/spring/service/JsonDocumentConverter.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/spring/service/JsonDocumentConverter.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/spring/service/JsonDocumentConverter.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/spring/service/JsonDocumentConverter.java diff --git a/couchbase/src/main/java/com/baeldung/couchbase/spring/service/TutorialBucketService.java b/persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/spring/service/TutorialBucketService.java similarity index 100% rename from couchbase/src/main/java/com/baeldung/couchbase/spring/service/TutorialBucketService.java rename to persistence-modules/couchbase/src/main/java/com/baeldung/couchbase/spring/service/TutorialBucketService.java diff --git a/couchbase/src/main/resources/application.properties b/persistence-modules/couchbase/src/main/resources/application.properties similarity index 100% rename from couchbase/src/main/resources/application.properties rename to persistence-modules/couchbase/src/main/resources/application.properties diff --git a/couchbase/src/main/resources/logback.xml b/persistence-modules/couchbase/src/main/resources/logback.xml similarity index 100% rename from couchbase/src/main/resources/logback.xml rename to persistence-modules/couchbase/src/main/resources/logback.xml diff --git a/couchbase/src/test/java/com/baeldung/couchbase/async/AsyncIntegrationTest.java b/persistence-modules/couchbase/src/test/java/com/baeldung/couchbase/async/AsyncIntegrationTest.java similarity index 100% rename from couchbase/src/test/java/com/baeldung/couchbase/async/AsyncIntegrationTest.java rename to persistence-modules/couchbase/src/test/java/com/baeldung/couchbase/async/AsyncIntegrationTest.java diff --git a/couchbase/src/test/java/com/baeldung/couchbase/async/AsyncIntegrationTestConfig.java b/persistence-modules/couchbase/src/test/java/com/baeldung/couchbase/async/AsyncIntegrationTestConfig.java similarity index 100% rename from couchbase/src/test/java/com/baeldung/couchbase/async/AsyncIntegrationTestConfig.java rename to persistence-modules/couchbase/src/test/java/com/baeldung/couchbase/async/AsyncIntegrationTestConfig.java diff --git a/couchbase/src/test/java/com/baeldung/couchbase/async/person/PersonCrudServiceIntegrationTestConfig.java b/persistence-modules/couchbase/src/test/java/com/baeldung/couchbase/async/person/PersonCrudServiceIntegrationTestConfig.java similarity index 100% rename from couchbase/src/test/java/com/baeldung/couchbase/async/person/PersonCrudServiceIntegrationTestConfig.java rename to persistence-modules/couchbase/src/test/java/com/baeldung/couchbase/async/person/PersonCrudServiceIntegrationTestConfig.java diff --git a/couchbase/src/test/java/com/baeldung/couchbase/async/person/PersonCrudServiceLiveTest.java b/persistence-modules/couchbase/src/test/java/com/baeldung/couchbase/async/person/PersonCrudServiceLiveTest.java similarity index 100% rename from couchbase/src/test/java/com/baeldung/couchbase/async/person/PersonCrudServiceLiveTest.java rename to persistence-modules/couchbase/src/test/java/com/baeldung/couchbase/async/person/PersonCrudServiceLiveTest.java diff --git a/couchbase/src/test/java/com/baeldung/couchbase/async/service/ClusterServiceLiveTest.java b/persistence-modules/couchbase/src/test/java/com/baeldung/couchbase/async/service/ClusterServiceLiveTest.java similarity index 100% rename from couchbase/src/test/java/com/baeldung/couchbase/async/service/ClusterServiceLiveTest.java rename to persistence-modules/couchbase/src/test/java/com/baeldung/couchbase/async/service/ClusterServiceLiveTest.java diff --git a/couchbase/src/test/java/com/baeldung/couchbase/mapreduce/StudentGradeServiceLiveTest.java b/persistence-modules/couchbase/src/test/java/com/baeldung/couchbase/mapreduce/StudentGradeServiceLiveTest.java similarity index 100% rename from couchbase/src/test/java/com/baeldung/couchbase/mapreduce/StudentGradeServiceLiveTest.java rename to persistence-modules/couchbase/src/test/java/com/baeldung/couchbase/mapreduce/StudentGradeServiceLiveTest.java diff --git a/couchbase/src/test/java/com/baeldung/couchbase/n1ql/IntegrationTestConfig.java b/persistence-modules/couchbase/src/test/java/com/baeldung/couchbase/n1ql/IntegrationTestConfig.java similarity index 100% rename from couchbase/src/test/java/com/baeldung/couchbase/n1ql/IntegrationTestConfig.java rename to persistence-modules/couchbase/src/test/java/com/baeldung/couchbase/n1ql/IntegrationTestConfig.java diff --git a/couchbase/src/test/java/com/baeldung/couchbase/n1ql/N1QLLiveTest.java b/persistence-modules/couchbase/src/test/java/com/baeldung/couchbase/n1ql/N1QLLiveTest.java similarity index 100% rename from couchbase/src/test/java/com/baeldung/couchbase/n1ql/N1QLLiveTest.java rename to persistence-modules/couchbase/src/test/java/com/baeldung/couchbase/n1ql/N1QLLiveTest.java diff --git a/couchbase/src/test/java/com/baeldung/couchbase/spring/IntegrationTest.java b/persistence-modules/couchbase/src/test/java/com/baeldung/couchbase/spring/IntegrationTest.java similarity index 100% rename from couchbase/src/test/java/com/baeldung/couchbase/spring/IntegrationTest.java rename to persistence-modules/couchbase/src/test/java/com/baeldung/couchbase/spring/IntegrationTest.java diff --git a/couchbase/src/test/java/com/baeldung/couchbase/spring/IntegrationTestConfig.java b/persistence-modules/couchbase/src/test/java/com/baeldung/couchbase/spring/IntegrationTestConfig.java similarity index 100% rename from couchbase/src/test/java/com/baeldung/couchbase/spring/IntegrationTestConfig.java rename to persistence-modules/couchbase/src/test/java/com/baeldung/couchbase/spring/IntegrationTestConfig.java diff --git a/couchbase/src/test/java/com/baeldung/couchbase/spring/person/PersonCrudServiceLiveTest.java b/persistence-modules/couchbase/src/test/java/com/baeldung/couchbase/spring/person/PersonCrudServiceLiveTest.java similarity index 100% rename from couchbase/src/test/java/com/baeldung/couchbase/spring/person/PersonCrudServiceLiveTest.java rename to persistence-modules/couchbase/src/test/java/com/baeldung/couchbase/spring/person/PersonCrudServiceLiveTest.java diff --git a/couchbase/src/test/java/com/baeldung/couchbase/spring/service/ClusterServiceLiveTest.java b/persistence-modules/couchbase/src/test/java/com/baeldung/couchbase/spring/service/ClusterServiceLiveTest.java similarity index 100% rename from couchbase/src/test/java/com/baeldung/couchbase/spring/service/ClusterServiceLiveTest.java rename to persistence-modules/couchbase/src/test/java/com/baeldung/couchbase/spring/service/ClusterServiceLiveTest.java diff --git a/couchbase/src/test/resources/logback.xml b/persistence-modules/couchbase/src/test/resources/logback.xml similarity index 100% rename from couchbase/src/test/resources/logback.xml rename to persistence-modules/couchbase/src/test/resources/logback.xml diff --git a/persistence-modules/pom.xml b/persistence-modules/pom.xml index a99a180390..53e408c3a5 100644 --- a/persistence-modules/pom.xml +++ b/persistence-modules/pom.xml @@ -21,6 +21,7 @@ blaze-persistence core-java-persistence core-java-persistence-2 + couchbase elasticsearch flyway flyway-repair diff --git a/pom.xml b/pom.xml index a5abb59502..17a914d619 100644 --- a/pom.xml +++ b/pom.xml @@ -765,7 +765,6 @@ aws-modules checker-framework - couchbase core-groovy-modules core-java-modules @@ -1035,8 +1034,7 @@ aws-modules checker-framework - couchbase - + core-groovy-modules core-java-modules From ce6640a476d145fe54b2ebb39c01e184e8544e8e Mon Sep 17 00:00:00 2001 From: Ehsan Sasanianno Date: Fri, 27 Oct 2023 18:42:59 +0200 Subject: [PATCH 18/26] Java-24346: Fix integration test for spring-cloud-contract-consumer module --- .../BasicMathControllerIntegrationTest.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/spring-cloud-modules/spring-cloud-contract/spring-cloud-contract-consumer/src/test/java/com/baeldung/spring/cloud/springcloudcontractconsumer/controller/BasicMathControllerIntegrationTest.java b/spring-cloud-modules/spring-cloud-contract/spring-cloud-contract-consumer/src/test/java/com/baeldung/spring/cloud/springcloudcontractconsumer/controller/BasicMathControllerIntegrationTest.java index e21223e6ea..c19b3f3694 100644 --- a/spring-cloud-modules/spring-cloud-contract/spring-cloud-contract-consumer/src/test/java/com/baeldung/spring/cloud/springcloudcontractconsumer/controller/BasicMathControllerIntegrationTest.java +++ b/spring-cloud-modules/spring-cloud-contract/spring-cloud-contract-consumer/src/test/java/com/baeldung/spring/cloud/springcloudcontractconsumer/controller/BasicMathControllerIntegrationTest.java @@ -1,5 +1,10 @@ package com.baeldung.spring.cloud.springcloudcontractconsumer.controller; +import com.github.tomakehurst.wiremock.WireMockServer; +import com.github.tomakehurst.wiremock.core.WireMockConfiguration; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -13,6 +18,7 @@ import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; +import static com.github.tomakehurst.wiremock.client.WireMock.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @@ -26,6 +32,36 @@ public class BasicMathControllerIntegrationTest { @Autowired private MockMvc mockMvc; + private static WireMockServer wireMockServer; + + + @BeforeClass + public static void setupClass() { + WireMockConfiguration wireMockConfiguration = WireMockConfiguration.options().port(8090); // Use the same port as in your code + + wireMockServer = new WireMockServer(wireMockConfiguration); + wireMockServer.start(); + } + + @AfterClass + public static void teardownClass() { + wireMockServer.stop(); + } + + @Before + public void setup() { + wireMockServer.stubFor(get(urlEqualTo("/validate/prime-number?number=1")) + .willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody("Odd"))); + + wireMockServer.stubFor(get(urlEqualTo("/validate/prime-number?number=2")) + .willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody("Even"))); + } @Test public void given_WhenPassEvenNumberInQueryParam_ThenReturnEven() throws Exception { From 3c8d10dd828178d786a7dcb978991c7688913006 Mon Sep 17 00:00:00 2001 From: Anton Dalagan Date: Fri, 27 Oct 2023 18:44:07 +0200 Subject: [PATCH 19/26] Bael 7146 improvement to this article convert double to float in java (#15067) * Commit 1 - Anton Dalagan Code for Evaluation article. Contains Unit tests, domain class, and App main method. * BAEL-7146 Updated the unit test to display the results of the conversion. This will be explained in the article itself. * BAEL-7146 cleaned up pR --- .../FloatDoubleConversionsTest.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/core-java-modules/core-java-numbers-conversions/src/test/java/com/baeldung/floatdoubleconversions/FloatDoubleConversionsTest.java b/core-java-modules/core-java-numbers-conversions/src/test/java/com/baeldung/floatdoubleconversions/FloatDoubleConversionsTest.java index 9c6b01e9de..9da50276a9 100644 --- a/core-java-modules/core-java-numbers-conversions/src/test/java/com/baeldung/floatdoubleconversions/FloatDoubleConversionsTest.java +++ b/core-java-modules/core-java-numbers-conversions/src/test/java/com/baeldung/floatdoubleconversions/FloatDoubleConversionsTest.java @@ -7,23 +7,27 @@ public class FloatDoubleConversionsTest { @Test public void whenDoubleType_thenFloatTypeSuccess(){ - double interestRatesYearly = 13.333333333333334; + double interestRatesYearly = 13.333333333333333; float interest = (float) interestRatesYearly; - Assert.assertEquals(13.333333f, interest, 0.000004f); + System.out.println(interest); //13.333333 + Assert.assertEquals(13.333333f, interest, 0.000001f); - Double monthlyRates = 2.111111111111112; + Double monthlyRates = 2.111111111111111; float rates = monthlyRates.floatValue(); - Assert.assertEquals(2.1111112f, rates, 0.00000013); + System.out.println(rates); //2.1111112 + Assert.assertEquals(2.1111111f, rates, 0.0000001f); } @Test public void whenFloatType_thenDoubleTypeSuccess(){ float gradeAverage =2.05f; double average = gradeAverage; - Assert.assertEquals(2.05, average, 0.06); + System.out.println(average); //2.049999952316284 + Assert.assertEquals(2.05, average, 0.01); - Float monthlyRates = 2.1111112f; + Float monthlyRates = 2.1111111f; Double rates = monthlyRates.doubleValue(); - Assert.assertEquals(2.11111112, rates, 0.0000002);//true + System.out.println(rates); //2.1111111640930176 + Assert.assertEquals(2.11111111, rates, 0.0000001);//true } } From 65411d9deec5338b3a2f9f9425649432c5d27fa2 Mon Sep 17 00:00:00 2001 From: Mo Helmy <135069400+BenHelmyBen@users.noreply.github.com> Date: Fri, 27 Oct 2023 18:49:21 +0200 Subject: [PATCH 20/26] This commit is related to the article BAEL-7084 (#15070) This commit aims to add a test class "XMLStringToDocumentObjectUnitTest.java" that provides a test method to convert XML string into a Document object in Java. --- .../XMLStringToDocumentObjectUnitTest.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 xml-2/src/test/java/com/baeldung/xml/xml2document/XMLStringToDocumentObjectUnitTest.java diff --git a/xml-2/src/test/java/com/baeldung/xml/xml2document/XMLStringToDocumentObjectUnitTest.java b/xml-2/src/test/java/com/baeldung/xml/xml2document/XMLStringToDocumentObjectUnitTest.java new file mode 100644 index 0000000000..f573e1c96d --- /dev/null +++ b/xml-2/src/test/java/com/baeldung/xml/xml2document/XMLStringToDocumentObjectUnitTest.java @@ -0,0 +1,37 @@ +package com.baeldung.xml2document; + +import org.junit.Test; +import org.w3c.dom.*; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import java.io.IOException; +import java.io.StringReader; + +import static org.junit.Assert.assertEquals; + +public class XMLStringToDocumentObjectUnitTest { + @Test + public void givenValidXMLString_whenParsing_thenDocumentIsCorrect() throws ParserConfigurationException { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder builder = factory.newDocumentBuilder(); + String xmlString = "XML Parsing Example"; + InputSource is = new InputSource(new StringReader(xmlString)); + Document xmlDoc = null; + try { + xmlDoc = builder.parse(is); + } catch (SAXException e) { + throw new RuntimeException(e); + } catch (IOException e) { + throw new RuntimeException(e); + } + + assertEquals("root", xmlDoc.getDocumentElement().getNodeName()); + assertEquals("element", xmlDoc.getDocumentElement().getElementsByTagName("element").item(0).getNodeName()); + assertEquals("XML Parsing Example", xmlDoc.getDocumentElement().getElementsByTagName("element").item(0).getTextContent()); + } +} From 6341e1844fd923825423c9cf445b3cf54f6bc154 Mon Sep 17 00:00:00 2001 From: Constantin <50400363+constantinurs@users.noreply.github.com> Date: Fri, 27 Oct 2023 21:31:28 +0300 Subject: [PATCH 21/26] BAEL-6769: Override Cucumber option values (#15078) --- spring-cucumber/pom.xml | 9 ++++- .../CucumberOptionsApplication.java | 13 +++++++ .../HealthCheckController.java | 22 +++++++++++ .../HealthCheckStepDefsIntegrationTest.java | 38 +++++++++++++++++++ .../cucumberoptions/healthcheck.feature | 11 ++++++ .../src/test/resources/cucumber.properties | 1 + 6 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 spring-cucumber/src/main/java/com/baeldung/cucumberoptions/CucumberOptionsApplication.java create mode 100644 spring-cucumber/src/main/java/com/baeldung/cucumberoptions/HealthCheckController.java create mode 100644 spring-cucumber/src/test/java/com/baeldung/cucumberoptions/HealthCheckStepDefsIntegrationTest.java create mode 100644 spring-cucumber/src/test/resources/com/baeldung/cucumberoptions/healthcheck.feature create mode 100644 spring-cucumber/src/test/resources/cucumber.properties diff --git a/spring-cucumber/pom.xml b/spring-cucumber/pom.xml index c6c163d7d1..042e81971f 100644 --- a/spring-cucumber/pom.xml +++ b/spring-cucumber/pom.xml @@ -45,6 +45,12 @@ ${cucumber.version} test + + org.junit.vintage + junit-vintage-engine + ${junit-vintage-engine.version} + test + org.apache.commons @@ -54,8 +60,9 @@ - 6.8.0 + 7.14.0 1.3.2 + 5.10.0 \ No newline at end of file diff --git a/spring-cucumber/src/main/java/com/baeldung/cucumberoptions/CucumberOptionsApplication.java b/spring-cucumber/src/main/java/com/baeldung/cucumberoptions/CucumberOptionsApplication.java new file mode 100644 index 0000000000..03082128b3 --- /dev/null +++ b/spring-cucumber/src/main/java/com/baeldung/cucumberoptions/CucumberOptionsApplication.java @@ -0,0 +1,13 @@ +package com.baeldung.cucumberoptions; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class CucumberOptionsApplication { + + public static void main(String[] args) { + SpringApplication.run(CucumberOptionsApplication.class, args); + } + +} \ No newline at end of file diff --git a/spring-cucumber/src/main/java/com/baeldung/cucumberoptions/HealthCheckController.java b/spring-cucumber/src/main/java/com/baeldung/cucumberoptions/HealthCheckController.java new file mode 100644 index 0000000000..637dbdb540 --- /dev/null +++ b/spring-cucumber/src/main/java/com/baeldung/cucumberoptions/HealthCheckController.java @@ -0,0 +1,22 @@ +package com.baeldung.cucumberoptions; + +import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HealthCheckController { + + @GetMapping(path = "/v1/status", produces = APPLICATION_JSON_VALUE) + public HttpStatus getV1Status() { + return ResponseEntity.ok().build().getStatusCode(); + } + + @GetMapping(path = "/v2/status", produces = APPLICATION_JSON_VALUE) + public HttpStatus getV2Status() { + return ResponseEntity.ok().build().getStatusCode(); + } +} \ No newline at end of file diff --git a/spring-cucumber/src/test/java/com/baeldung/cucumberoptions/HealthCheckStepDefsIntegrationTest.java b/spring-cucumber/src/test/java/com/baeldung/cucumberoptions/HealthCheckStepDefsIntegrationTest.java new file mode 100644 index 0000000000..999adadbef --- /dev/null +++ b/spring-cucumber/src/test/java/com/baeldung/cucumberoptions/HealthCheckStepDefsIntegrationTest.java @@ -0,0 +1,38 @@ +package com.baeldung.cucumberoptions; + +import io.cucumber.java.en.Then; +import io.cucumber.java.en.When; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.client.RestTemplate; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; + +import com.baeldung.SpringIntegrationTest; + +public class HealthCheckStepDefsIntegrationTest extends SpringIntegrationTest { + + private ResponseEntity statusResponse; + + private ResponseEntity doGet(String url) { + return new RestTemplate().getForEntity(url, String.class); + } + + @When("^the client calls /v1/status") + public void checkV1Status() throws Throwable { + statusResponse = doGet("http://localhost:8082/v1/status"); + } + + @When("^the client calls /v2/status") + public void checkV2Status() throws Throwable { + statusResponse = doGet("http://localhost:8082/v2/status"); + } + + @Then("^the client receives (\\d+) status code$") + public void verifyStatusCode(int statusCode) throws Throwable { + final HttpStatus currentStatusCode = statusResponse.getStatusCode(); + assertThat(currentStatusCode.value(), is(statusCode)); + } +} \ No newline at end of file diff --git a/spring-cucumber/src/test/resources/com/baeldung/cucumberoptions/healthcheck.feature b/spring-cucumber/src/test/resources/com/baeldung/cucumberoptions/healthcheck.feature new file mode 100644 index 0000000000..33e07c1add --- /dev/null +++ b/spring-cucumber/src/test/resources/com/baeldung/cucumberoptions/healthcheck.feature @@ -0,0 +1,11 @@ +Feature: healthcheck endpoints can be verified + + @v1 + Scenario: v1 status is healthy + When the client calls /v1/status + Then the client receives 200 status code + + @v2 + Scenario: v2 status is healthy + When the client calls /v2/status + Then the client receives 200 status code diff --git a/spring-cucumber/src/test/resources/cucumber.properties b/spring-cucumber/src/test/resources/cucumber.properties new file mode 100644 index 0000000000..22c3379201 --- /dev/null +++ b/spring-cucumber/src/test/resources/cucumber.properties @@ -0,0 +1 @@ +cucumber.filter.tags=not @v2 \ No newline at end of file From 2db8c97c1f338b2a5257baea7e9e73cf6d5197b0 Mon Sep 17 00:00:00 2001 From: Bipin kumar Date: Sat, 28 Oct 2023 12:45:52 +0530 Subject: [PATCH 22/26] JAVA-25111: Changes made for reoving duplicate module (#15076) --- pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/pom.xml b/pom.xml index 17a914d619..07b9d6d842 100644 --- a/pom.xml +++ b/pom.xml @@ -1211,7 +1211,6 @@ gradle-modules/gradle/maven-to-gradle persistence-modules/spring-data-neo4j spring-actuator - gcp-firebase spring-di-4 spring-kafka-2 From 235cba0dbd10cf7579002b2156535b54965bab88 Mon Sep 17 00:00:00 2001 From: collaboratewithakash <38683470+collaboratewithakash@users.noreply.github.com> Date: Sat, 28 Oct 2023 13:08:15 +0530 Subject: [PATCH 23/26] updated backlink --- core-java-modules/core-java-8/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core-java-modules/core-java-8/README.md b/core-java-modules/core-java-8/README.md index 6061f3318d..0921c1538a 100644 --- a/core-java-modules/core-java-8/README.md +++ b/core-java-modules/core-java-8/README.md @@ -11,5 +11,5 @@ This module contains articles about Java 8 core features - [Finding Min/Max in an Array with Java](https://www.baeldung.com/java-array-min-max) - [Internationalization and Localization in Java 8](https://www.baeldung.com/java-8-localization) - [Generalized Target-Type Inference in Java](https://www.baeldung.com/java-generalized-target-type-inference) -- [Monads in Java](https://www.baeldung.com/java-monads) +- [Monads in Java – Optional](https://www.baeldung.com/java-monads) - [[More -->]](/core-java-modules/core-java-8-2) From 30523bdc89d568c05999d074f994187e106370ad Mon Sep 17 00:00:00 2001 From: collaboratewithakash <38683470+collaboratewithakash@users.noreply.github.com> Date: Sat, 28 Oct 2023 13:24:41 +0530 Subject: [PATCH 24/26] backlink removed --- aws-modules/aws-miscellaneous/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/aws-modules/aws-miscellaneous/README.md b/aws-modules/aws-miscellaneous/README.md index 5be8e6a3f2..104c8719df 100644 --- a/aws-modules/aws-miscellaneous/README.md +++ b/aws-modules/aws-miscellaneous/README.md @@ -5,6 +5,5 @@ This module contains articles about various Amazon Web Services (AWS) such as EC ### Relevant articles - [Managing EC2 Instances in Java](https://www.baeldung.com/ec2-java) -- [Integration Testing with a Local DynamoDB Instance](https://www.baeldung.com/dynamodb-local-integration-tests) - [Managing Amazon SQS Queues in Java](https://www.baeldung.com/aws-queues-java) - [Guide to AWS Aurora RDS with Java](https://www.baeldung.com/aws-aurora-rds-java) From 96b32de7ba49b06580c79efe00ac998d176f1aaf Mon Sep 17 00:00:00 2001 From: collaboratewithakash <38683470+collaboratewithakash@users.noreply.github.com> Date: Sat, 28 Oct 2023 14:33:07 +0530 Subject: [PATCH 25/26] backlink added --- core-java-modules/core-java-string-operations-7/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-modules/core-java-string-operations-7/README.md b/core-java-modules/core-java-string-operations-7/README.md index 2dce44d217..7020369f02 100644 --- a/core-java-modules/core-java-string-operations-7/README.md +++ b/core-java-modules/core-java-string-operations-7/README.md @@ -1,2 +1,3 @@ ### Relevant Articles: +[How to Center Text Output in Java](https://www.baeldung.com/java-center-text-output) From 3042166f4bb63d2e542df96ca8aa67f4a1fafc1c Mon Sep 17 00:00:00 2001 From: collaboratewithakash <38683470+collaboratewithakash@users.noreply.github.com> Date: Sat, 28 Oct 2023 14:39:02 +0530 Subject: [PATCH 26/26] readme created or backlink added --- core-java-modules/core-java-concurrency-advanced-5/README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 core-java-modules/core-java-concurrency-advanced-5/README.md diff --git a/core-java-modules/core-java-concurrency-advanced-5/README.md b/core-java-modules/core-java-concurrency-advanced-5/README.md new file mode 100644 index 0000000000..ba845a7c4b --- /dev/null +++ b/core-java-modules/core-java-concurrency-advanced-5/README.md @@ -0,0 +1,3 @@ + +### Relevant Articles: +- [Why wait() Requires Synchronization?](https://www.baeldung.com/java-wait-necessary-synchronization)