Skip to content

Instantly share code, notes, and snippets.

@deepakazad
Created June 28, 2017 02:57
Show Gist options
  • Save deepakazad/e3c66f4d90078d8df990ec8a3f5c9156 to your computer and use it in GitHub Desktop.
Save deepakazad/e3c66f4d90078d8df990ec8a3f5c9156 to your computer and use it in GitHub Desktop.
RxJava: Maybe To Single
@Test
public void testEmptyMaybeToSingle1() {
Maybe.empty()
.flatMapSingle(o -> Single.just("result"))
.test()
.assertError(NoSuchElementException.class);
}
@Test
public void testEmptyMaybeToSingle2() {
Maybe.empty()
.toSingle()
.test()
.assertError(NoSuchElementException.class);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment