Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class RxJavaExceptionTestingTest {
private RxJavaExceptionTesting exceptionTesting;
@Before
public void initialize(){
exceptionTesting = new RxJavaExceptionTesting();
}
@Test
public void foo1() throws Exception {
exceptionTesting.foo1()
.test()
.assertNoErrors();
}
@Test
public void foo2() throws Exception {
exceptionTesting.foo2()
.test()
.assertError(MyException.class)
.assertError(new MyException());
}
@Test
public void foo3() throws Exception {
exceptionTesting.foo3()
.test()
.assertError(MyException.class)
.assertError(throwable -> "This is a custom exception.".equals(throwable.getMessage()));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment