From b045e8309d0c3d7566b1fb0c657ad99b7e1b7c3d Mon Sep 17 00:00:00 2001 From: chrisjaimes <45322800+chrisjaimes@users.noreply.github.com> Date: Thu, 7 Jul 2022 12:41:30 -0400 Subject: [PATCH] BAEL-5363 Fixed pom files, assertions instead of console output, and fixed package folders (#12462) Co-authored-by: Christian Jaimes --- persistence-modules/java-mongodb-queries/pom.xml | 3 +-- .../baeldung/mongo}/crud/CrudClient.java | 0 .../baeldung/mongo}/crud/model/Event.java | 0 .../baeldung/mongo/crud}/CrudClientLiveTest.java | 8 ++++++++ persistence-modules/pom.xml | 1 + pom.xml | 3 --- 6 files changed, 10 insertions(+), 5 deletions(-) rename persistence-modules/java-mongodb-queries/src/main/java/{com.baeldung.mongo => com/baeldung/mongo}/crud/CrudClient.java (100%) rename persistence-modules/java-mongodb-queries/src/main/java/{com.baeldung.mongo => com/baeldung/mongo}/crud/model/Event.java (100%) rename persistence-modules/java-mongodb-queries/src/test/java/{com.baeldung.mongo.crud => com/baeldung/mongo/crud}/CrudClientLiveTest.java (83%) diff --git a/persistence-modules/java-mongodb-queries/pom.xml b/persistence-modules/java-mongodb-queries/pom.xml index 731d61f013..58d7af1bc9 100644 --- a/persistence-modules/java-mongodb-queries/pom.xml +++ b/persistence-modules/java-mongodb-queries/pom.xml @@ -3,10 +3,9 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - parent-modules com.baeldung + persistence-modules 1.0.0-SNAPSHOT - ../../pom.xml 4.0.0 diff --git a/persistence-modules/java-mongodb-queries/src/main/java/com.baeldung.mongo/crud/CrudClient.java b/persistence-modules/java-mongodb-queries/src/main/java/com/baeldung/mongo/crud/CrudClient.java similarity index 100% rename from persistence-modules/java-mongodb-queries/src/main/java/com.baeldung.mongo/crud/CrudClient.java rename to persistence-modules/java-mongodb-queries/src/main/java/com/baeldung/mongo/crud/CrudClient.java diff --git a/persistence-modules/java-mongodb-queries/src/main/java/com.baeldung.mongo/crud/model/Event.java b/persistence-modules/java-mongodb-queries/src/main/java/com/baeldung/mongo/crud/model/Event.java similarity index 100% rename from persistence-modules/java-mongodb-queries/src/main/java/com.baeldung.mongo/crud/model/Event.java rename to persistence-modules/java-mongodb-queries/src/main/java/com/baeldung/mongo/crud/model/Event.java diff --git a/persistence-modules/java-mongodb-queries/src/test/java/com.baeldung.mongo.crud/CrudClientLiveTest.java b/persistence-modules/java-mongodb-queries/src/test/java/com/baeldung/mongo/crud/CrudClientLiveTest.java similarity index 83% rename from persistence-modules/java-mongodb-queries/src/test/java/com.baeldung.mongo.crud/CrudClientLiveTest.java rename to persistence-modules/java-mongodb-queries/src/test/java/com/baeldung/mongo/crud/CrudClientLiveTest.java index db2f35f634..5b5004fd9f 100644 --- a/persistence-modules/java-mongodb-queries/src/test/java/com.baeldung.mongo.crud/CrudClientLiveTest.java +++ b/persistence-modules/java-mongodb-queries/src/test/java/com/baeldung/mongo/crud/CrudClientLiveTest.java @@ -31,6 +31,11 @@ public class CrudClientLiveTest { @Order(2) public void whenReadingEventsByDate_thenCheckForReturnedDocument() { Assertions.assertNotNull(CrudClient.readEventsByDate(CrudClient.dateQuery)); + Event event = CrudClient.readEventsByDate(CrudClient.dateQuery); + Assertions.assertNotNull(event); + Assertions.assertEquals("Soccer game", event.title); + Assertions.assertEquals("Bar Avenue", event.location); + Assertions.assertEquals(CrudClient.soccerGame.dateTime, event.dateTime); } @Test @@ -39,6 +44,9 @@ public class CrudClientLiveTest { List events = CrudClient.readEventsByDateRange(CrudClient.from, CrudClient.to); Assertions.assertNotNull(events); Assertions.assertEquals(1, events.size()); + Assertions.assertEquals("Soccer game", events.get(0).title); + Assertions.assertEquals("Bar Avenue", events.get(0).location); + Assertions.assertEquals(CrudClient.soccerGame.dateTime, events.get(0).dateTime); } @Test diff --git a/persistence-modules/pom.xml b/persistence-modules/pom.xml index 4bab0631bd..ee4807933a 100644 --- a/persistence-modules/pom.xml +++ b/persistence-modules/pom.xml @@ -45,6 +45,7 @@ java-mongodb java-mongodb-2 java-mongodb-3 + java-mongodb-queries jnosql jooq jpa-hibernate-cascade-type diff --git a/pom.xml b/pom.xml index 046f59de53..24aa678523 100644 --- a/pom.xml +++ b/pom.xml @@ -7,9 +7,6 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - - persistence-modules/java-mongodb-queries - parent-modules pom