|
|
@@ -1,15 +1,14 @@
|
|
1
|
1
|
package se.citerus.dddsample.repository;
|
|
2
|
2
|
|
|
3
|
|
-import java.util.HashMap;
|
|
4
|
|
-import java.util.Map;
|
|
5
|
|
-
|
|
6
|
3
|
import org.springframework.dao.DataRetrievalFailureException;
|
|
7
|
|
-
|
|
8
|
4
|
import se.citerus.dddsample.domain.Cargo;
|
|
9
|
5
|
import se.citerus.dddsample.domain.HandlingEvent;
|
|
10
|
6
|
import se.citerus.dddsample.domain.Location;
|
|
11
|
7
|
import se.citerus.dddsample.domain.TrackingId;
|
|
12
|
8
|
|
|
|
9
|
+import java.util.HashMap;
|
|
|
10
|
+import java.util.Map;
|
|
|
11
|
+
|
|
13
|
12
|
/**
|
|
14
|
13
|
* CargoRepositoryInMem implement the CargoRepository interface but is a test
|
|
15
|
14
|
* class not intended for usage in real application.
|
|
|
@@ -29,11 +28,11 @@ public class CargoRepositoryInMem implements CargoRepository {
|
|
29
|
28
|
}
|
|
30
|
29
|
|
|
31
|
30
|
public Cargo find(TrackingId trackingId) {
|
|
32
|
|
- if (trackingId.id().equalsIgnoreCase("DAE")){
|
|
|
31
|
+ if (trackingId.toString().equalsIgnoreCase("DAE")){
|
|
33
|
32
|
throw new DataRetrievalFailureException("Network failure. Please try again");
|
|
34
|
33
|
}
|
|
35
|
34
|
|
|
36
|
|
- return cargoDb.get(trackingId.id());
|
|
|
35
|
+ return cargoDb.get(trackingId.toString());
|
|
37
|
36
|
}
|
|
38
|
37
|
|
|
39
|
38
|
public void save(Cargo cargo) {
|