Просмотр исходного кода

Small test and javadoc improvments

peter_backlund 17 лет назад
Родитель
Сommit
32c8f04c34

+ 8
- 2
dddsample/tracking/core/src/main/java/se/citerus/dddsample/tracking/core/domain/model/cargo/Delivery.java Просмотреть файл

@@ -98,10 +98,16 @@ class Delivery extends ValueObjectSupport<Delivery> {
98 98
     }
99 99
   }
100 100
 
101
+  /**
102
+   * @return True if the cargo has been handled at least once since it was last routed
103
+   */
101 104
   boolean hasBeenHandledAfterRouting() {
102 105
     return hasBeenHandled() && !routedAfterHandling;
103 106
   }
104 107
 
108
+  /**
109
+   * @return True if the cargo has been handled at least once
110
+   */
105 111
   boolean hasBeenHandled() {
106 112
     return mostRecentHandlingActivity != null;
107 113
   }
@@ -116,7 +122,7 @@ class Delivery extends ValueObjectSupport<Delivery> {
116 122
    * </ul>
117 123
    *
118 124
    * @param itinerary itinerary
119
-   * @return <code>true</code> if the cargo has been misdirected,
125
+   * @return <code>true</code> if the cargo has been misdirected.
120 126
    */
121 127
   boolean isMisdirected(final Itinerary itinerary) {
122 128
     return hasBeenHandledAfterRouting() && !itinerary.isExpectedActivity(mostRecentPhysicalHandlingActivity);
@@ -157,9 +163,9 @@ class Delivery extends ValueObjectSupport<Delivery> {
157 163
   }
158 164
 
159 165
   /**
160
-   * @return True if the cargo is routed and not misdirected  @param itinerary
161 166
    * @param itinerary itinerary
162 167
    * @param routeSpecification route specification
168
+   * @return True if the cargo is routed and not misdirected
163 169
    */
164 170
   boolean isOnRoute(final Itinerary itinerary, final RouteSpecification routeSpecification) {
165 171
     return routingStatus(itinerary, routeSpecification) == ROUTED && !isMisdirected(itinerary);

+ 3
- 0
dddsample/tracking/core/src/test/java/se/citerus/dddsample/tracking/core/domain/model/cargo/DeliveryTest.java Просмотреть файл

@@ -164,4 +164,7 @@ public class DeliveryTest extends TestCase {
164 164
     assertEquals(IN_PORT, newDelivery.transportStatus());
165 165
   }
166 166
 
167
+  public void testEmptyCtor() {
168
+    new Delivery();
169
+  }
167 170
 }