diff --git a/rxandroid/src/test/java/io/reactivex/rxjava3/android/plugins/RxAndroidPluginsNoRobolectricTest.java b/rxandroid/src/test/java/io/reactivex/rxjava3/android/plugins/RxAndroidPluginsNoRobolectricTest.java new file mode 100644 index 00000000..ff2a55ee --- /dev/null +++ b/rxandroid/src/test/java/io/reactivex/rxjava3/android/plugins/RxAndroidPluginsNoRobolectricTest.java @@ -0,0 +1,22 @@ +package io.reactivex.rxjava3.android.plugins; + +import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers; +import io.reactivex.rxjava3.android.testutil.EmptyScheduler; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import static org.junit.Assert.assertSame; + +public final class RxAndroidPluginsNoRobolectricTest { + @Before @After + public void setUpAndTearDown() { + RxAndroidPlugins.reset(); + } + + @Test public void mainThreadSchedulerCanBeReplaced() { + EmptyScheduler emptyScheduler = new EmptyScheduler(); + RxAndroidPlugins.setMainThreadSchedulerHandler(scheduler -> emptyScheduler); + assertSame(emptyScheduler, AndroidSchedulers.mainThread()); + } +}