June 2017
Intermediate to advanced
400 pages
8h 44m
English
We've covered blockingSubscribe() and several blocking operators in this chapter so far. While you can use these blocking tools to do simple assertions, there is a much more comprehensive way to test reactive code than simply blocking for one or more values. After all, we should do more than test onNext() calls. We also have onComplete() and onError() events to account for! It also would be great to streamline testing other RxJava events, such as subscription, disposal, and cancellation.
So let's introduce the TestObserver and TestSubscriber, your two best friends in testing your RxJava applications.
TestObserver and TestSubscriber are a treasure trove of convenient methods to aid testing, many of which ...
Read now
Unlock full access