Esempio n. 1
0
 @Test
 public void equalityOfNullsFail() {
   try {
     assertThat((Long) null).isEqualTo(5);
     fail("Should have thrown");
   } catch (AssertionError e) {
     assertThat(e.getMessage()).contains("Not true that <null> is equal to <5>");
   }
   try {
     assertThat(5).isEqualTo((Integer) null);
     fail("Should have thrown");
   } catch (AssertionError e) {
     assertThat(e.getMessage()).contains("Not true that <5> is equal to <null>");
   }
 }