Beispiel #1
0
 @Test
 public void shouldReturnHasCodeOnNonFatal() {
   final Exception exception = new java.lang.Exception();
   final NonFatalException cause = NonFatalException.of(exception);
   assertThat(cause.hashCode()).isEqualTo(Objects.hashCode(exception));
 }
Beispiel #2
0
 @Test
 public void shouldReturnToStringOnNonFatal() {
   final Exception exception = new java.lang.Exception();
   final NonFatalException cause = NonFatalException.of(exception);
   assertThat(cause.toString()).isEqualTo("NonFatal(" + exception.toString() + ")");
 }
Beispiel #3
0
 @Test
 public void shouldDetectNonFatalException() throws Exception {
   final NonFatalException cause = NonFatalException.of(new Exception());
   assertThat(cause).isNotNull();
 }
Beispiel #4
0
 @Test
 public void shouldReturnAndNotThrowOnNonFatal() {
   final NonFatalException cause = NonFatalException.of(new Exception());
   assertThat(NonFatalException.of(cause)).isNotNull();
 }
Beispiel #5
0
 @Test(expected = Try.FatalException.class)
 public void shouldDetectFatalException() throws Exception {
   NonFatalException.of(new OutOfMemoryError());
 }