Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix token adapter instrumented tests
Upgrade Mockito from 2.23.0 to 2.24.0 to avoid the following issue: org.mockito.exceptions.base.MockitoException: Mockito cannot mock this class: class android.content.Context. Underlying exception : java.lang.IllegalArgumentException: On Android P, a class injection can only be applied to BaseDexClassLoader: net.bytebuddy.dynamic.loading.MultipleParentClassLoader@23f7dce Looking at Mockito 2.x release notes: https://github.com/mockito/mockito/blob/release/2.x/doc/release-notes/official.md - Previous issue may have been fixed in later 2.23.18 published on now unavailable Mockito Bintray repository. Consequently, move to 2.24.0 release available on Maven Central. - It seems that from 2.23.13 and androidx.test support added, tests are now launched in a dedicated instrumentation thread that does not prepare an Android Looper. But as Adapter class will instatiate an Android Handler, even if not needed for the tests, the following error is encountered: java.lang.RuntimeException: Can't create handler inside thread Thread[Instr: androidx.test.runner.AndroidJUnitRunner,5,main] that has not called Looper.prepare() Consequently, force the Looper to be prepared once before tests.
- Loading branch information