Ver código fonte

Minor clean-up.

Patrik Fredriksson 18 anos atrás
pai
commit
4bb12bf2a4

+ 11
- 14
dddsample/src/test/java/se/citerus/dddsample/domain/ItineraryTest.java Ver arquivo

@@ -7,16 +7,19 @@ import java.util.Date;
7 7
 import java.util.List;
8 8
 
9 9
 public class ItineraryTest extends TestCase {
10
+  private final Location shanghai = new Location(new UnLocode("CN", "SHA"), "Shanghai");
11
+  private final Location rotterdam = new Location(new UnLocode("NL", "RTM"), "Rotterdam");
12
+  private final Location goteborg = new Location(new UnLocode("SE", "GOT"), "Goteborg");
13
+  private final Location hangzhou = new Location(new UnLocode("CN", "HGH"), "Hangzhou");
14
+  private final Location nyc = new Location(new UnLocode("US", "NYC"), "New York");
15
+  private final Location longBeach = new Location(new UnLocode("US", "LGB"), "Long Beach");
16
+  private final CarrierMovement abc = new CarrierMovement(new CarrierMovementId("ABC"), shanghai, rotterdam);
17
+  private final CarrierMovement def = new CarrierMovement(new CarrierMovementId("DEF"), rotterdam, goteborg);
18
+  private final CarrierMovement ghi = new CarrierMovement(new CarrierMovementId("GHI"), rotterdam, nyc);
19
+  private final CarrierMovement jkl = new CarrierMovement(new CarrierMovementId("JKL"), shanghai, longBeach);
10 20
 
11 21
   public void testCargoOnTrack() throws Exception {
12 22
 
13
-    Location shanghai = new Location(new UnLocode("CN", "SHA"), "Shanghai");
14
-    Location rotterdam = new Location(new UnLocode("NL", "RTM"), "Rotterdam");
15
-    Location goteborg = new Location(new UnLocode("SE", "GOT"), "Goteborg");
16
-    Location hangzhou = new Location(new UnLocode("CN", "HGH"), "Hangzhou");
17
-    Location nyc = new Location(new UnLocode("US", "NYC"), "New York");
18
-    Location longBeach = new Location(new UnLocode("US", "LGB"), "Long Beach");
19
-
20 23
     Cargo cargo = new Cargo(new TrackingId("CARGO1")); //Immutable things go into the constructor
21 24
 
22 25
     //Mutable things in setters
@@ -29,11 +32,6 @@ public class ItineraryTest extends TestCase {
29 32
        new Leg(new CarrierMovementId("DEF"), rotterdam, goteborg)
30 33
     );
31 34
 
32
-    CarrierMovement abc = new CarrierMovement(new CarrierMovementId("ABC"), shanghai, rotterdam);
33
-    CarrierMovement def = new CarrierMovement(new CarrierMovementId("DEF"), rotterdam, goteborg);
34
-    CarrierMovement ghi = new CarrierMovement(new CarrierMovementId("GHI"), rotterdam, nyc);
35
-    CarrierMovement jkl = new CarrierMovement(new CarrierMovementId("JKL"), shanghai, longBeach);
36
-
37 35
     //Happy path
38 36
     HandlingEvent event = new HandlingEvent(cargo, new Date(), new Date(), HandlingEvent.Type.RECEIVE, shanghai);
39 37
     assertTrue(itinerary.isExpected(event));
@@ -54,7 +52,6 @@ public class ItineraryTest extends TestCase {
54 52
     assertTrue(itinerary.isExpected(event));
55 53
 
56 54
     //Customs event changes nothing
57
-    //TODO: Is this OK?
58 55
     event = new HandlingEvent(cargo, new Date(), new Date(), HandlingEvent.Type.CUSTOMS, goteborg);
59 56
     assertTrue(itinerary.isExpected(event));
60 57
 
@@ -76,7 +73,7 @@ public class ItineraryTest extends TestCase {
76 73
   }
77 74
 
78 75
   public void testNextExpectedEvent() throws Exception {
79
-    
76
+
80 77
   }
81 78
 
82 79
   public void testCreateItinerary() throws Exception {