From 49b63ea3fb2f7e5d269f3b19448d65a1b25b3d32 Mon Sep 17 00:00:00 2001 From: Aowss Ibrahim Date: Sat, 29 Mar 2025 16:29:37 -0400 Subject: [PATCH 1/6] Downgrade to Java 17 and keep the original URLs --- .github/workflows/pipeline.yml | 4 ++-- pom.xml | 17 ++++------------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index d4fd06a06..74b44d809 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -14,10 +14,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up JDK 23 + - name: Set up JDK 17 uses: actions/setup-java@v4 with: - java-version: '23' + java-version: '17' distribution: 'temurin' cache: maven server-id: github # Value of the distributionManagement/repository/id field of the pom.xml diff --git a/pom.xml b/pom.xml index d82644e17..5db330915 100644 --- a/pom.xml +++ b/pom.xml @@ -15,16 +15,7 @@ This application shows a few key concepts of Domain Driven Design implemented in Enterprise Java. - https://github.com/aowss/dddsample-core - - - - - - - - - + http://dddsample.sourceforge.net @@ -73,12 +64,12 @@ - scm:git:https://github.com/aowss/dddsample-core - https://github.com/aowss/dddsample-core + scm:git:https://github.com/citerus/dddsample-core + https://github.com/citerus/dddsample-core - 23 + 17 ${java.version} ${java.version} UTF-8 From 5ac67f2c556015520793adcb041429f32634a1d9 Mon Sep 17 00:00:00 2001 From: Aowss Ibrahim Date: Sat, 29 Mar 2025 17:04:38 -0400 Subject: [PATCH 2/6] Use ISO format for values and the same format for descriptions --- .../interfaces/tracking/ws/CargoTrackingDTOConverter.java | 4 ++-- src/test/resources/sampleCargoTrackingResponse.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/se/citerus/dddsample/interfaces/tracking/ws/CargoTrackingDTOConverter.java b/src/main/java/se/citerus/dddsample/interfaces/tracking/ws/CargoTrackingDTOConverter.java index 379dd25ca..b165cc299 100644 --- a/src/main/java/se/citerus/dddsample/interfaces/tracking/ws/CargoTrackingDTOConverter.java +++ b/src/main/java/se/citerus/dddsample/interfaces/tracking/ws/CargoTrackingDTOConverter.java @@ -34,7 +34,7 @@ public static CargoTrackingDTO convert(Cargo cargo, List handling private static List convertHandlingEvents(List handlingEvents, Cargo cargo, MessageSource messageSource, Locale locale) { return handlingEvents.stream().map(he -> new HandlingEventDTO( convertLocation(he), - convertTime(he), + he.completionTime().toString(), convertType(he), convertVoyageNumber(he), convertIsExpected(he, cargo), @@ -126,7 +126,7 @@ private static String convertDestination(Cargo cargo) { private static String convertEta(Cargo cargo) { Instant date = cargo.delivery().estimatedTimeOfArrival(); - return date == null ? "Unknown" : formatter.format(date); + return date == null ? "Unknown" : date.toString(); } protected static String convertNextExpectedActivity(Cargo cargo) { diff --git a/src/test/resources/sampleCargoTrackingResponse.json b/src/test/resources/sampleCargoTrackingResponse.json index 2dbceeeb7..4c738ee96 100644 --- a/src/test/resources/sampleCargoTrackingResponse.json +++ b/src/test/resources/sampleCargoTrackingResponse.json @@ -1 +1 @@ -{"trackingId":"ABC123","statusText":"In port New York","destination":"Helsinki","eta":"Mar 12, 2009, 12:00:00 AM","nextExpectedActivity":"Next expected activity is to load cargo onto voyage 0200T in New York","isMisdirected":false,"handlingEvents":[{"location":"Hongkong","time":"Mar 1, 2009, 12:00:00 AM","type":"RECEIVE","voyageNumber":"","isExpected":true,"description":"Received in Hongkong, at Mar 1, 2009, 12:00:00 AM."},{"location":"Hongkong","time":"Mar 2, 2009, 12:00:00 AM","type":"LOAD","voyageNumber":"0100S","isExpected":true,"description":"Loaded onto voyage 0100S in Hongkong, at Mar 2, 2009, 12:00:00 AM."},{"location":"New York","time":"Mar 5, 2009, 12:00:00 AM","type":"UNLOAD","voyageNumber":"0100S","isExpected":true,"description":"Unloaded off voyage 0100S in New York, at Mar 5, 2009, 12:00:00 AM."}]} \ No newline at end of file +{"trackingId":"ABC123","statusText":"In port New York","destination":"Helsinki","eta":"2009-03-12T00:00:00Z","nextExpectedActivity":"Next expected activity is to load cargo onto voyage 0200T in New York","isMisdirected":false,"handlingEvents":[{"location":"Hongkong","time":"2009-03-01T00:00:00Z","type":"RECEIVE","voyageNumber":"","isExpected":true,"description":"Received in Hongkong, at Mar 1, 2009, 12:00:00 AM."},{"location":"Hongkong","time":"2009-03-02T00:00:00Z","type":"LOAD","voyageNumber":"0100S","isExpected":true,"description":"Loaded onto voyage 0100S in Hongkong, at Mar 2, 2009, 12:00:00 AM."},{"location":"New York","time":"2009-03-05T00:00:00Z","type":"UNLOAD","voyageNumber":"0100S","isExpected":true,"description":"Unloaded off voyage 0100S in New York, at Mar 5, 2009, 12:00:00 AM."}]} \ No newline at end of file From 4696fea6e7ae2c973a5bb91c372cd6689eb662d5 Mon Sep 17 00:00:00 2001 From: Aowss Ibrahim Date: Sat, 29 Mar 2025 17:09:22 -0400 Subject: [PATCH 3/6] Revert to using the convertTime method to be consistent with the rest of the code --- .../interfaces/tracking/ws/CargoTrackingDTOConverter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/se/citerus/dddsample/interfaces/tracking/ws/CargoTrackingDTOConverter.java b/src/main/java/se/citerus/dddsample/interfaces/tracking/ws/CargoTrackingDTOConverter.java index b165cc299..1005a3238 100644 --- a/src/main/java/se/citerus/dddsample/interfaces/tracking/ws/CargoTrackingDTOConverter.java +++ b/src/main/java/se/citerus/dddsample/interfaces/tracking/ws/CargoTrackingDTOConverter.java @@ -51,7 +51,7 @@ protected static String convertDescription(HandlingEvent handlingEvent, MessageS args = new Object[]{ handlingEvent.voyage().voyageNumber().idString(), handlingEvent.location().name(), - formatter.format(handlingEvent.completionTime()) + convertTime(handlingEvent) }; break; case RECEIVE: @@ -59,7 +59,7 @@ protected static String convertDescription(HandlingEvent handlingEvent, MessageS case CLAIM: args = new Object[]{ handlingEvent.location().name(), - formatter.format(handlingEvent.completionTime()) + convertTime(handlingEvent) }; break; From abb87fef5825585a0b7a5c7e339394655d207114 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Apr 2025 14:18:27 +0000 Subject: [PATCH 4/6] Bump org.apache.maven.plugins:maven-surefire-plugin from 3.2.5 to 3.5.3 Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.2.5 to 3.5.3. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.2.5...surefire-3.5.3) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5db330915..3e2b4abd7 100644 --- a/pom.xml +++ b/pom.xml @@ -86,7 +86,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 org.apache.maven.plugins From 2bf43bb4dc74a4cd7f8613befa90135c4daa67c0 Mon Sep 17 00:00:00 2001 From: Aowss Ibrahim Date: Sat, 12 Apr 2025 12:32:26 -0400 Subject: [PATCH 5/6] Save progress --- pom.xml | 6 +++--- .../infrastructure/sampledata/SampleDataGenerator.java | 3 ++- .../persistence/inmemory/LocationRepositoryInMem.java | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 3e2b4abd7..7aa9f178f 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ org.springframework.boot spring-boot-starter-parent - 3.3.10 + 3.4.4 @@ -69,7 +69,7 @@ - 17 + 24 ${java.version} ${java.version} UTF-8 @@ -155,7 +155,7 @@ org.seleniumhq.selenium - htmlunit-driver + htmlunit3-driver test diff --git a/src/main/java/se/citerus/dddsample/infrastructure/sampledata/SampleDataGenerator.java b/src/main/java/se/citerus/dddsample/infrastructure/sampledata/SampleDataGenerator.java index 23e3f6471..3c9943cc5 100644 --- a/src/main/java/se/citerus/dddsample/infrastructure/sampledata/SampleDataGenerator.java +++ b/src/main/java/se/citerus/dddsample/infrastructure/sampledata/SampleDataGenerator.java @@ -66,7 +66,8 @@ public void loadHibernateData(TransactionTemplate tt, final HandlingEventFactory tt.execute(new TransactionCallbackWithoutResult() { @Override protected void doInTransactionWithoutResult(TransactionStatus status) { - for (Location location : SampleLocations.getAll()) { + var locations = SampleLocations.getAll(); + for (Location location : locations) { locationRepository.store(location); } diff --git a/src/test/java/se/citerus/dddsample/infrastructure/persistence/inmemory/LocationRepositoryInMem.java b/src/test/java/se/citerus/dddsample/infrastructure/persistence/inmemory/LocationRepositoryInMem.java index df27dded1..f800012bb 100644 --- a/src/test/java/se/citerus/dddsample/infrastructure/persistence/inmemory/LocationRepositoryInMem.java +++ b/src/test/java/se/citerus/dddsample/infrastructure/persistence/inmemory/LocationRepositoryInMem.java @@ -10,7 +10,8 @@ public class LocationRepositoryInMem implements LocationRepository { public Location find(UnLocode unLocode) { - for (Location location : SampleLocations.getAll()) { + var locations = SampleLocations.getAll(); + for (Location location : locations) { if (location.unLocode().equals(unLocode)) { return location; } From aa53907f02c8af2b1c88afdb585c3417f371224d Mon Sep 17 00:00:00 2001 From: Aowss Ibrahim Date: Sat, 19 Apr 2025 09:26:25 -0400 Subject: [PATCH 6/6] Set Java version to 23 --- .github/workflows/build.yml | 4 ++-- pom.xml | 27 ++++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index edaf1d256..5ad8306fd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,10 +22,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Set up JDK 23 uses: actions/setup-java@v4 with: - java-version: '17' + java-version: '23' distribution: 'temurin' cache: maven - name: Build with Maven diff --git a/pom.xml b/pom.xml index 8f3f905bd..8d798cae5 100644 --- a/pom.xml +++ b/pom.xml @@ -78,12 +78,13 @@ - 24 + 23 ${java.version} ${java.version} UTF-8 UTF-8 2.18.0 + 1.20.6 @@ -164,9 +165,15 @@ commons-io ${commons-io.version} + + org.postgresql + postgresql + runtime + org.hsqldb hsqldb + runtime org.apache.activemq @@ -191,6 +198,24 @@ htmlunit3-driver test + + org.testcontainers + testcontainers + ${testcontainers.version} + test + + + org.testcontainers + junit-jupiter + ${testcontainers.version} + test + + + org.testcontainers + postgresql + ${testcontainers.version} + test +