How to use mockkStatic on an overriding function #1141
Unanswered
TSAI-HSIAO-HAN
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have two overriding function in object
Helper,getAccountInfo(): StringandgetAccountInfo(id: String): String.I want to use mockkStatic on getAccountInfo(id: String) by calling
mockkStatic(Helper::getAccountInfo), however, Android Studio will show message 'Overload resolution ambiguity. All these functions match'.I tried to specify by using reference by
val f: (String) -> String = Helper::getAccountInfoand passed inmockkStatic(f)which did not work. How should I specify the function in this case?Beta Was this translation helpful? Give feedback.
All reactions