https://kotlinlang.org logo
#android
Title
# android
p

Pascal How

02/11/2018, 11:14 PM
Hi, has anyone tried to mock extension functions with mockito? Internally extension functions are converted to static methods so mockito cannot mock these. Then there is possibly PowerMock or we can provide an interface where the class that implements it, has a method wrapping the call to the extension function. Any suggestions?
d

dave08

02/12/2018, 3:16 AM
If you really need to you can do it with mockK.io (I didn't try...)
p

Pascal How

02/12/2018, 11:13 AM
Thanks. I had a great discussion with Andrey Mischenko in the next thread if you want a follow up 😄 We talked about this library as well
👍🏼 1
3 Views