Not able to import InstantTaskExecutorRule in my 'jUnit' test case even after adding 'core-testing' dependency - Android testing
问题 I am writing test cases for my LoginViewModel . Where I want to perform setValue() operation on my MutableLiveData . To avoid Method getMainLooper in android.os.Looper not mocked Exception I am trying to add the following Rule in my ViewModel file inside test folder . @Rule public InstantTaskExecutorRule mInstantTaskExecutorRule = new InstantTaskExecutorRule(); for that, I have added the following dependency: androidTestImplementation 'android.arch.core:core-testing:1.1.1' as dependency. But