Created
October 6, 2019 16:46
-
-
Save talosdev/54d8a9f5af7ed369abb5be26ddd1d2ab to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Test | |
| fun `hot observable to single with firstOrError`() { | |
| val observable = Observable.fromIterable<Int>((1..5).toList()) | |
| .doOnNext { println("Source observable emitting $it") } | |
| .publish() | |
| val single = observable.firstOrError() | |
| .doOnSuccess { println("Single succeeded with value: $it") } | |
| val testObserver = single.test() | |
| observable.connect() | |
| testObserver.await() | |
| testObserver.apply { | |
| assertComplete() | |
| assertValue(1) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment