My previous articles [1], [2] highlighted the importance of overriding the default Scheduler for certain RxJava operators to help ensure the validity of your tests and I also presented the Scheduler Injection pattern as a means of achieving this.

However, manually performing this can be error prone. You need to…

In my previous article, I described how the RxAndroidPlugins APIs for RxJava 2 can be used to override Schedulers to create a suitable execution environment for JVM-based unit tests.

As I hinted, that’s not your only option. In this follow-up, I will describe another possibility; Scheduler Injection and we’ll see…

RxAndroid now supports RxJava 2, and with it, a new set of APIs for overriding Schedulers. In this post, I’ll explain these APIs, their motivation and show you how to use them to address a common Android unit testing problem.

But first, a bit of background

In both RxJava 1 and 2, Schedulers are used to…

Peter Tackage


Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store