-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #596 from ReactiveX/jw/fix-non-robolectric/2022-11-09
Add the test
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
...src/test/java/io/reactivex/rxjava3/android/plugins/RxAndroidPluginsNoRobolectricTest.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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()); | ||
} | ||
} |