Reputation:
I.m using a mockk library in kotlin, and in tests, I have the following exception:
java.lang.RuntimeException: Method getStackTraceString in android.util.Log not mocked. See http://g.co/androidstudio/not-mocked for details.
I can't find a solution for that.
Upvotes: 5
Views: 4430
Reputation: 8422
You have to add
testOptions {
unitTests.returnDefaultValues = true
}
in android
section in your build.gradle
file. It will mock some call to Android platform. Please note that it just return default values.
In the new gradle plugin this property was renamed to isReturnDefaultValues
.
Upvotes: 20