Having an error when testing RxJava code. It fils when I call AndroidSchedulers.mainThread() in ViewModel. Does anyone know how to deal with it?
Here is my stack trace:
java.lang.ExceptionInInitializerError
...
at com.cardsimulator.ui.MainViewModel.executeCommand(MainViewModel.java:56)
at com.cardsimulator.ui.MainViewModelTest.testExecuteCommand_NormalCommand(MainViewModelTest.java:54)
...
Caused by: java.lang.RuntimeException: Method getMainLooper in android.os.Looper not mocked. See http://g.co/androidstudio/not-mocked for details.