|
|
@@ -77,7 +77,7 @@ public class CargoLifecycleScenarioTest {
|
|
77
|
77
|
loadInNewYork();
|
|
78
|
78
|
checkDeliveryAfterLoadInNewYork();
|
|
79
|
79
|
|
|
80
|
|
- unloadInStockholmOffOf(v200);
|
|
|
80
|
+ unloadInStockholmOffOf(pacific2);
|
|
81
|
81
|
checkDeliveryAfterUnloadInStockholm();
|
|
82
|
82
|
|
|
83
|
83
|
customsInStockholm();
|
|
|
@@ -88,7 +88,7 @@ public class CargoLifecycleScenarioTest {
|
|
88
|
88
|
}
|
|
89
|
89
|
|
|
90
|
90
|
private void unloadInLongBeach() throws CannotCreateHandlingEventException {
|
|
91
|
|
- createHandlingEventAndUpdateAggregates(toDate("2009-03-06"), v100, LONGBEACH, UNLOAD);
|
|
|
91
|
+ createHandlingEventAndUpdateAggregates(toDate("2009-03-06"), pacific1, LONGBEACH, UNLOAD);
|
|
92
|
92
|
}
|
|
93
|
93
|
|
|
94
|
94
|
private void checkDeliveryAfterUnloadInLongBeach() {
|
|
|
@@ -98,25 +98,25 @@ public class CargoLifecycleScenarioTest {
|
|
98
|
98
|
assertThat(cargo.lastKnownLocation(), is(LONGBEACH));
|
|
99
|
99
|
assertThat(cargo.transportStatus(), is(IN_PORT));
|
|
100
|
100
|
assertFalse(cargo.isMisdirected());
|
|
101
|
|
- assertThat(cargo.nextExpectedActivity(), is(new HandlingActivity(LOAD, LONGBEACH, v250)));
|
|
|
101
|
+ assertThat(cargo.nextExpectedActivity(), is(new HandlingActivity(LOAD, LONGBEACH, continental1)));
|
|
102
|
102
|
}
|
|
103
|
103
|
|
|
104
|
104
|
private void loadInLongBeach() throws CannotCreateHandlingEventException {
|
|
105
|
|
- createHandlingEventAndUpdateAggregates(toDate("2009-03-07"), v250, LONGBEACH, LOAD);
|
|
|
105
|
+ createHandlingEventAndUpdateAggregates(toDate("2009-03-07"), continental1, LONGBEACH, LOAD);
|
|
106
|
106
|
}
|
|
107
|
107
|
|
|
108
|
108
|
private void checkDeliveryAfterLoadInLongBeach() {
|
|
109
|
109
|
Cargo cargo = cargoRepository.find(trackingId);
|
|
110
|
110
|
|
|
111
|
|
- assertThat(cargo.currentVoyage(), is(v250));
|
|
|
111
|
+ assertThat(cargo.currentVoyage(), is(continental1));
|
|
112
|
112
|
assertThat(cargo.lastKnownLocation(), is(LONGBEACH));
|
|
113
|
113
|
assertThat(cargo.transportStatus(), is(ONBOARD_CARRIER));
|
|
114
|
114
|
assertFalse(cargo.isMisdirected());
|
|
115
|
|
- assertThat(cargo.nextExpectedActivity(), is(new HandlingActivity(UNLOAD, NEWYORK, v250)));
|
|
|
115
|
+ assertThat(cargo.nextExpectedActivity(), is(new HandlingActivity(UNLOAD, NEWYORK, continental1)));
|
|
116
|
116
|
}
|
|
117
|
117
|
|
|
118
|
118
|
private void unloadInNewYork() throws CannotCreateHandlingEventException {
|
|
119
|
|
- createHandlingEventAndUpdateAggregates(toDate("2009-03-08"), v250, NEWYORK, UNLOAD);
|
|
|
119
|
+ createHandlingEventAndUpdateAggregates(toDate("2009-03-08"), continental1, NEWYORK, UNLOAD);
|
|
120
|
120
|
}
|
|
121
|
121
|
|
|
122
|
122
|
private void checkDeliveryAfterUnloadInNewYork() {
|
|
|
@@ -125,22 +125,22 @@ public class CargoLifecycleScenarioTest {
|
|
125
|
125
|
assertThat(cargo.currentVoyage(), is(NONE));
|
|
126
|
126
|
assertThat(cargo.lastKnownLocation(), is(NEWYORK));
|
|
127
|
127
|
assertThat(cargo.transportStatus(), is(IN_PORT));
|
|
128
|
|
- assertThat(cargo.nextExpectedActivity(), is(new HandlingActivity(LOAD, NEWYORK, v200)));
|
|
|
128
|
+ assertThat(cargo.nextExpectedActivity(), is(new HandlingActivity(LOAD, NEWYORK, pacific2)));
|
|
129
|
129
|
assertFalse(cargo.isMisdirected());
|
|
130
|
130
|
}
|
|
131
|
131
|
|
|
132
|
132
|
private void loadInNewYork() throws CannotCreateHandlingEventException {
|
|
133
|
|
- createHandlingEventAndUpdateAggregates(toDate("2009-03-10"), v200, NEWYORK, LOAD);
|
|
|
133
|
+ createHandlingEventAndUpdateAggregates(toDate("2009-03-10"), pacific2, NEWYORK, LOAD);
|
|
134
|
134
|
}
|
|
135
|
135
|
|
|
136
|
136
|
private void checkDeliveryAfterLoadInNewYork() {
|
|
137
|
137
|
Cargo cargo = cargoRepository.find(trackingId);
|
|
138
|
138
|
|
|
139
|
|
- assertThat(cargo.currentVoyage(), is(v200));
|
|
|
139
|
+ assertThat(cargo.currentVoyage(), is(pacific2));
|
|
140
|
140
|
assertThat(cargo.lastKnownLocation(), is(NEWYORK));
|
|
141
|
141
|
assertThat(cargo.transportStatus(), is(ONBOARD_CARRIER));
|
|
142
|
142
|
assertFalse(cargo.isMisdirected());
|
|
143
|
|
- assertThat(cargo.nextExpectedActivity(), is(new HandlingActivity(UNLOAD, STOCKHOLM, v200)));
|
|
|
143
|
+ assertThat(cargo.nextExpectedActivity(), is(new HandlingActivity(UNLOAD, STOCKHOLM, pacific2)));
|
|
144
|
144
|
}
|
|
145
|
145
|
|
|
146
|
146
|
@Test
|
|
|
@@ -239,23 +239,23 @@ public class CargoLifecycleScenarioTest {
|
|
239
|
239
|
}
|
|
240
|
240
|
|
|
241
|
241
|
public void loadInHongkong() throws CannotCreateHandlingEventException {
|
|
242
|
|
- createHandlingEventAndUpdateAggregates(toDate("2009-03-03"), v100, HONGKONG, LOAD);
|
|
|
242
|
+ createHandlingEventAndUpdateAggregates(toDate("2009-03-03"), pacific1, HONGKONG, LOAD);
|
|
243
|
243
|
}
|
|
244
|
244
|
|
|
245
|
245
|
private void checkDeliveryAfterLoadInHongKong() {
|
|
246
|
246
|
// Check current state - should be ok
|
|
247
|
247
|
Cargo cargo = cargoRepository.find(trackingId);
|
|
248
|
248
|
|
|
249
|
|
- assertThat(cargo.currentVoyage(), is(v100));
|
|
|
249
|
+ assertThat(cargo.currentVoyage(), is(pacific1));
|
|
250
|
250
|
assertThat(cargo.lastKnownLocation(), is(HONGKONG));
|
|
251
|
251
|
assertThat(cargo.transportStatus(), is(ONBOARD_CARRIER));
|
|
252
|
|
- assertThat(cargo.nextExpectedActivity(), is(new HandlingActivity(UNLOAD, LONGBEACH, v100)));
|
|
|
252
|
+ assertThat(cargo.nextExpectedActivity(), is(new HandlingActivity(UNLOAD, LONGBEACH, pacific1)));
|
|
253
|
253
|
assertFalse(cargo.isMisdirected());
|
|
254
|
254
|
}
|
|
255
|
255
|
|
|
256
|
256
|
public void unloadInTokyo() throws CannotCreateHandlingEventException {
|
|
257
|
257
|
// Cargo is now (incorrectly) unloaded in Tokyo
|
|
258
|
|
- createHandlingEventAndUpdateAggregates(toDate("2009-03-05"), v100, TOKYO, UNLOAD);
|
|
|
258
|
+ createHandlingEventAndUpdateAggregates(toDate("2009-03-05"), pacific1, TOKYO, UNLOAD);
|
|
259
|
259
|
}
|
|
260
|
260
|
|
|
261
|
261
|
private void checkDeliveryAfterUnloadInTokyo() {
|
|
|
@@ -445,9 +445,9 @@ public class CargoLifecycleScenarioTest {
|
|
445
|
445
|
// Hongkong - NYC - Chicago - Stockholm, initial routing
|
|
446
|
446
|
return Arrays.asList(
|
|
447
|
447
|
new Itinerary(Arrays.asList(
|
|
448
|
|
- new Leg(v100, HONGKONG, LONGBEACH, toDate("2009-03-03"), toDate("2009-03-09")),
|
|
449
|
|
- new Leg(v250, LONGBEACH, NEWYORK, toDate("2009-03-10"), toDate("2009-03-14")),
|
|
450
|
|
- new Leg(v200, NEWYORK, STOCKHOLM, toDate("2009-03-07"), toDate("2009-03-11"))
|
|
|
448
|
+ new Leg(pacific1, HONGKONG, LONGBEACH, toDate("2009-03-03"), toDate("2009-03-09")),
|
|
|
449
|
+ new Leg(continental1, LONGBEACH, NEWYORK, toDate("2009-03-10"), toDate("2009-03-14")),
|
|
|
450
|
+ new Leg(pacific2, NEWYORK, STOCKHOLM, toDate("2009-03-07"), toDate("2009-03-11"))
|
|
451
|
451
|
))
|
|
452
|
452
|
);
|
|
453
|
453
|
} else {
|