Skip to content

Commit

Permalink
chore: initial commit of ee10 migration
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions authored and hantsy committed Oct 22, 2023
1 parent c4d589f commit e105d12
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 :
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -821,5 +821,4 @@ public List<Itinerary> fetchRoutesForSpecification(RouteSpecification routeSpeci
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
@ApplicationScoped
public class SynchronousApplicationEventsStub implements ApplicationEvents {

@Inject
Instance<CargoInspectionService> cargoInspectionServiceInstance;
@Inject Instance<CargoInspectionService> cargoInspectionServiceInstance;

// no-args constructor required by CDI
public SynchronousApplicationEventsStub() {}
Expand All @@ -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");
}
}

0 comments on commit e105d12

Please sign in to comment.