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
-
I have two overriding function in object
Helper
,getAccountInfo(): String
andgetAccountInfo(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::getAccountInfo
and 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