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