Browse Source

Use more concise AssertJ assertions.

Mohamed Gara 9 years ago
parent
commit
8594660526

+ 1
- 4
src/test/java/se/citerus/dddsample/domain/model/cargo/DeliveryTest.java View File

@@ -27,10 +27,7 @@ public class DeliveryTest extends TestCase {
27 27
 
28 28
     List<HandlingEvent> orderEvents = dh.history();
29 29
     assertThat(orderEvents).hasSize(4);
30
-    assertThat(orderEvents.get(0)).isSameAs(he2);
31
-    assertThat(orderEvents.get(1)).isSameAs(he4);
32
-    assertThat(orderEvents.get(2)).isSameAs(he1);
33
-    assertThat(orderEvents.get(3)).isSameAs(he3);
30
+    assertThat(orderEvents).containsExactly(he2, he4, he1, he3);
34 31
   }
35 32
 
36 33
   public void testCargoStatusFromLastHandlingEvent() {

+ 1
- 1
src/test/java/se/citerus/dddsample/domain/model/handling/HandlingEventTest.java View File

@@ -88,7 +88,7 @@ public class HandlingEventTest extends TestCase {
88 88
   public void testParseTypeIllegal() throws Exception {
89 89
     try {
90 90
       valueOf("NOT_A_HANDLING_EVENT_TYPE");
91
-      assertThat(false).as("Expected IllegaArgumentException to be thrown").isTrue();
91
+      fail("Expected IllegaArgumentException to be thrown");
92 92
     } catch (IllegalArgumentException e) {
93 93
       // All's well
94 94
     }