|
|
@@ -15,7 +15,6 @@ public class DeliveryTest extends TestCase {
|
|
15
|
15
|
private Cargo cargo = new Cargo(new TrackingId("XYZ"), HONGKONG, NEWYORK);
|
|
16
|
16
|
|
|
17
|
17
|
public void testEvensOrderedByTimeOccured() throws Exception {
|
|
18
|
|
-
|
|
19
|
18
|
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
|
20
|
19
|
HandlingEvent he1 = new HandlingEvent(cargo, df.parse("2010-01-03"), new Date(), HandlingEvent.Type.RECEIVE, NEWYORK);
|
|
21
|
20
|
HandlingEvent he2 = new HandlingEvent(cargo, df.parse("2010-01-01"), new Date(), HandlingEvent.Type.LOAD, NEWYORK, CM003);
|
|
|
@@ -54,21 +53,21 @@ public class DeliveryTest extends TestCase {
|
|
54
|
53
|
assertEquals(TransportStatus.CLAIMED, delivery.transportStatus());
|
|
55
|
54
|
}
|
|
56
|
55
|
|
|
57
|
|
- public void testCurrentLocation() throws Exception {
|
|
|
56
|
+ public void testLastKnownLocation() throws Exception {
|
|
58
|
57
|
Set<HandlingEvent> events = new HashSet<HandlingEvent>();
|
|
59
|
58
|
Delivery delivery = new Delivery(events);
|
|
60
|
59
|
|
|
61
|
|
- assertEquals(Location.UNKNOWN, delivery.currentLocation());
|
|
|
60
|
+ assertEquals(Location.UNKNOWN, delivery.lastKnownLocation());
|
|
62
|
61
|
|
|
63
|
62
|
events.add(new HandlingEvent(cargo, new Date(10), new Date(11), HandlingEvent.Type.RECEIVE, HAMBURG));
|
|
64
|
63
|
delivery = new Delivery(events);
|
|
65
|
64
|
|
|
66
|
|
- assertEquals(HAMBURG, delivery.currentLocation());
|
|
|
65
|
+ assertEquals(HAMBURG, delivery.lastKnownLocation());
|
|
67
|
66
|
|
|
68
|
67
|
events.add(new HandlingEvent(cargo, new Date(20), new Date(21), HandlingEvent.Type.LOAD, HAMBURG, CM003));
|
|
69
|
68
|
delivery = new Delivery(events);
|
|
70
|
69
|
|
|
71
|
|
- assertEquals(Location.UNKNOWN, delivery.currentLocation());
|
|
|
70
|
+ assertEquals(HAMBURG, delivery.lastKnownLocation());
|
|
72
|
71
|
}
|
|
73
|
72
|
|
|
74
|
73
|
}
|