diff --git a/src/test/java/org/eclipse/cargotracker/domain/model/cargo/CargoTest.java b/src/test/java/org/eclipse/cargotracker/domain/model/cargo/CargoTest.java index 86cd177d..85fdc928 100644 --- a/src/test/java/org/eclipse/cargotracker/domain/model/cargo/CargoTest.java +++ b/src/test/java/org/eclipse/cargotracker/domain/model/cargo/CargoTest.java @@ -40,10 +40,11 @@ public void testConstruction() { Cargo cargo = new Cargo(trackingId, routeSpecification); - assertThat( cargo.getDelivery().getRoutingStatus()).isEqualTo(RoutingStatus.NOT_ROUTED); - assertThat( cargo.getDelivery().getTransportStatus()).isEqualTo(TransportStatus.NOT_RECEIVED); - assertThat( cargo.getDelivery().getLastKnownLocation()).isEqualTo(Location.UNKNOWN); - assertThat( cargo.getDelivery().getCurrentVoyage()).isEqualTo(Voyage.NONE); + assertThat(cargo.getDelivery().getRoutingStatus()).isEqualTo(RoutingStatus.NOT_ROUTED); + assertThat(cargo.getDelivery().getTransportStatus()) + .isEqualTo(TransportStatus.NOT_RECEIVED); + assertThat(cargo.getDelivery().getLastKnownLocation()).isEqualTo(Location.UNKNOWN); + assertThat(cargo.getDelivery().getCurrentVoyage()).isEqualTo(Voyage.NONE); } @Test @@ -72,10 +73,10 @@ public boolean isSatisfiedBy(Itinerary itinerary) { cargo.specifyNewRoute(acceptOnlyGood); - assertThat( cargo.getDelivery().getRoutingStatus()).isEqualTo(RoutingStatus.NOT_ROUTED); + assertThat(cargo.getDelivery().getRoutingStatus()).isEqualTo(RoutingStatus.NOT_ROUTED); cargo.assignToRoute(bad); - assertThat(cargo.getDelivery().getRoutingStatus()).isEqualTo(RoutingStatus.MISROUTED) ; + assertThat(cargo.getDelivery().getRoutingStatus()).isEqualTo(RoutingStatus.MISROUTED); cargo.assignToRoute(good); assertThat(cargo.getDelivery().getRoutingStatus()).isEqualTo(RoutingStatus.ROUTED); @@ -98,14 +99,14 @@ public void testLastKnownLocationUnknownWhenNoEvents() { public void testLastKnownLocationReceived() throws Exception { Cargo cargo = populateCargoReceivedStockholm(); - assertThat( cargo.getDelivery().getLastKnownLocation()).isEqualTo(SampleLocations.STOCKHOLM); + assertThat(cargo.getDelivery().getLastKnownLocation()).isEqualTo(SampleLocations.STOCKHOLM); } @Test public void testLastKnownLocationClaimed() throws Exception { Cargo cargo = populateCargoClaimedMelbourne(); - assertThat( cargo.getDelivery().getLastKnownLocation()).isEqualTo(SampleLocations.MELBOURNE); + assertThat(cargo.getDelivery().getLastKnownLocation()).isEqualTo(SampleLocations.MELBOURNE); } @Test diff --git a/src/test/java/org/eclipse/cargotracker/domain/model/cargo/RouteSpecificationTest.java b/src/test/java/org/eclipse/cargotracker/domain/model/cargo/RouteSpecificationTest.java index 2628e0c0..7718e780 100644 --- a/src/test/java/org/eclipse/cargotracker/domain/model/cargo/RouteSpecificationTest.java +++ b/src/test/java/org/eclipse/cargotracker/domain/model/cargo/RouteSpecificationTest.java @@ -10,8 +10,6 @@ import java.util.Arrays; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; public class RouteSpecificationTest { diff --git a/src/test/java/org/eclipse/cargotracker/domain/model/handling/HandlingEventTest.java b/src/test/java/org/eclipse/cargotracker/domain/model/handling/HandlingEventTest.java index b2c260b1..52b30b70 100644 --- a/src/test/java/org/eclipse/cargotracker/domain/model/handling/HandlingEventTest.java +++ b/src/test/java/org/eclipse/cargotracker/domain/model/handling/HandlingEventTest.java @@ -43,7 +43,7 @@ public void testNewWithCarrierMovement() { HandlingEvent.Type.UNLOAD, SampleLocations.NEWYORK, SampleVoyages.CM003); - assertThat( event2.getLocation()).isEqualTo(SampleLocations.NEWYORK); + assertThat(event2.getLocation()).isEqualTo(SampleLocations.NEWYORK); // These event types prohibit a carrier movement association for (HandlingEvent.Type type : @@ -90,7 +90,7 @@ public void testNewWithLocation() { LocalDateTime.now(), HandlingEvent.Type.CLAIM, SampleLocations.HELSINKI); - assertThat( event1.getLocation()).isEqualTo(SampleLocations.HELSINKI); + assertThat(event1.getLocation()).isEqualTo(SampleLocations.HELSINKI); } @Test @@ -104,7 +104,7 @@ public void testCurrentLocationLoadEvent() throws Exception { SampleLocations.CHICAGO, SampleVoyages.CM004); - assertThat( event.getLocation()).isEqualTo(SampleLocations.CHICAGO); + assertThat(event.getLocation()).isEqualTo(SampleLocations.CHICAGO); } @Test @@ -118,7 +118,7 @@ public void testCurrentLocationUnloadEvent() throws Exception { SampleLocations.HAMBURG, SampleVoyages.CM004); - assertThat( ev.getLocation()).isEqualTo(SampleLocations.HAMBURG); + assertThat(ev.getLocation()).isEqualTo(SampleLocations.HAMBURG); } @Test @@ -131,7 +131,7 @@ public void testCurrentLocationReceivedEvent() throws Exception { HandlingEvent.Type.RECEIVE, SampleLocations.CHICAGO); - assertThat( event.getLocation()).isEqualTo(SampleLocations.CHICAGO); + assertThat(event.getLocation()).isEqualTo(SampleLocations.CHICAGO); } @Test @@ -144,6 +144,6 @@ public void testCurrentLocationClaimedEvent() throws Exception { HandlingEvent.Type.CLAIM, SampleLocations.CHICAGO); - assertThat( event.getLocation()).isEqualTo(SampleLocations.CHICAGO); + assertThat(event.getLocation()).isEqualTo(SampleLocations.CHICAGO); } } diff --git a/src/test/java/org/eclipse/cargotracker/domain/model/handling/HandlingHistoryTest.java b/src/test/java/org/eclipse/cargotracker/domain/model/handling/HandlingHistoryTest.java index 5724a180..67eee053 100644 --- a/src/test/java/org/eclipse/cargotracker/domain/model/handling/HandlingHistoryTest.java +++ b/src/test/java/org/eclipse/cargotracker/domain/model/handling/HandlingHistoryTest.java @@ -14,7 +14,6 @@ import java.util.Arrays; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertEquals; // TODO [Jakarta EE 8] Move to the Java Date-Time API for date manipulation. Avoid hard-coded dates. public class HandlingHistoryTest { @@ -72,12 +71,12 @@ public class HandlingHistoryTest { @Test public void testDistinctEventsByCompletionTime() { - assertThat( - handlingHistory.getDistinctEventsByCompletionTime()).isEqualTo(Arrays.asList(event1, event2)); + assertThat(handlingHistory.getDistinctEventsByCompletionTime()) + .isEqualTo(Arrays.asList(event1, event2)); } @Test public void testMostRecentlyCompletedEvent() { - assertThat( handlingHistory.getMostRecentlyCompletedEvent()).isEqualTo(event2); + assertThat(handlingHistory.getMostRecentlyCompletedEvent()).isEqualTo(event2); } } diff --git a/src/test/java/org/eclipse/cargotracker/domain/shared/DomainObjectUtilsTest.java b/src/test/java/org/eclipse/cargotracker/domain/shared/DomainObjectUtilsTest.java index 455b2f19..5a8cdd71 100644 --- a/src/test/java/org/eclipse/cargotracker/domain/shared/DomainObjectUtilsTest.java +++ b/src/test/java/org/eclipse/cargotracker/domain/shared/DomainObjectUtilsTest.java @@ -12,9 +12,9 @@ public void testNullSafe() { String noneNullObject = new String("noneNull"); var safeObject = DomainObjectUtils.nullSafe(nullObject, "safe"); - assertThat( safeObject).isEqualTo("safe"); + assertThat(safeObject).isEqualTo("safe"); var safeObject2 = DomainObjectUtils.nullSafe(noneNullObject, "safe"); - assertThat( safeObject2).isEqualTo(noneNullObject); + assertThat(safeObject2).isEqualTo(noneNullObject); } } diff --git a/src/test/java/org/eclipse/cargotracker/scenario/CargoLifecycleScenarioTest.java b/src/test/java/org/eclipse/cargotracker/scenario/CargoLifecycleScenarioTest.java index 2a599970..9ebe6088 100644 --- a/src/test/java/org/eclipse/cargotracker/scenario/CargoLifecycleScenarioTest.java +++ b/src/test/java/org/eclipse/cargotracker/scenario/CargoLifecycleScenarioTest.java @@ -821,5 +821,4 @@ public List fetchRoutesForSpecification(RouteSpecification routeSpeci } } } - } diff --git a/src/test/java/org/eclipse/cargotracker/scenario/SynchronousApplicationEventsStub.java b/src/test/java/org/eclipse/cargotracker/scenario/SynchronousApplicationEventsStub.java index c5ed7c41..95f6de13 100644 --- a/src/test/java/org/eclipse/cargotracker/scenario/SynchronousApplicationEventsStub.java +++ b/src/test/java/org/eclipse/cargotracker/scenario/SynchronousApplicationEventsStub.java @@ -12,8 +12,7 @@ @ApplicationScoped public class SynchronousApplicationEventsStub implements ApplicationEvents { - @Inject - Instance cargoInspectionServiceInstance; + @Inject Instance cargoInspectionServiceInstance; // no-args constructor required by CDI public SynchronousApplicationEventsStub() {} @@ -35,8 +34,7 @@ public void cargoHasArrived(Cargo cargo) { } @Override - public void receivedHandlingEventRegistrationAttempt( - HandlingEventRegistrationAttempt attempt) { + public void receivedHandlingEventRegistrationAttempt(HandlingEventRegistrationAttempt attempt) { System.out.println("EVENT: received handling event registration attempt"); } }