Exemple #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));
 }
Exemple #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() + ")");
 }
Exemple #3
0
 @Test
 public void shouldDetectNonFatalException() throws Exception {
   final NonFatalException cause = NonFatalException.of(new Exception());
   assertThat(cause).isNotNull();
 }
Exemple #4
0
 @Test
 public void shouldReturnAndNotThrowOnNonFatal() {
   final NonFatalException cause = NonFatalException.of(new Exception());
   assertThat(NonFatalException.of(cause)).isNotNull();
 }
Exemple #5
0
 @Test(expected = Try.FatalException.class)
 public void shouldDetectFatalException() throws Exception {
   NonFatalException.of(new OutOfMemoryError());
 }