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

carmelo.iriti

12/18/2017, 2:14 PM
Hi everyone! anyone knows if it is possible to mock a kotlin function with mockito?
a

Alexander Khyzhun

12/18/2017, 2:19 PM
why not?
s

sindrenm

12/18/2017, 2:23 PM
Since Kotlin classes and functions are closed by default and Mockito uses inheritance to mock and stub. However, there are ways to make it work. You might want to have a look at mockito-kotlin: https://github.com/nhaarman/mockito-kotlin
c

carmelo.iriti

12/18/2017, 2:48 PM
@sindrenm thank you a lot!! 🤓
Hi @Alexander Khyzhun, I was asking if it is possible
@Alexander Khyzhun, if you have the answer, please could you share it?
r

radityagumay

12/20/2017, 1:46 AM
I am using mockito. And have no problem with it.
18 Views