Unit Testing Arraymap Throws Method Put In Android.util.arraymap Not Mocked
I am trying to unit test a method that uses array map and I keep getting the following exception: java.lang.RuntimeException: Method put in android.util.ArrayMap not mocked. See ht
Solution 1:
Worked for me, make sure its in the correct part of the build.gradle
android {
...
testOptions {
unitTests.returnDefaultValues = true
}
}
Solution 2:
As @ShadowFlame stated on above comment I used array map support "androidx.collection.ArrayMap" instead of "android.util.ArrayMap" and it works fine.
Post a Comment for "Unit Testing Arraymap Throws Method Put In Android.util.arraymap Not Mocked"