Search in sources :

Example 1 with Try

use of cyclops.control.Try in project cyclops by aol.

the class SuccessTest method testFlattenFailure.

@Test
public void testFlattenFailure() {
    FileNotFoundException error = new FileNotFoundException();
    assertThat(Try.<Try<Integer, FileNotFoundException>, FileNotFoundException>success(Try.failure(error)).to(Try::flatten), equalTo(Try.failure(error)));
}
Also used : FileNotFoundException(java.io.FileNotFoundException) Try(cyclops.control.Try) Test(org.junit.Test)

Aggregations

Try (cyclops.control.Try)1 FileNotFoundException (java.io.FileNotFoundException)1 Test (org.junit.Test)1