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

mithuroy

06/25/2017, 5:29 AM
org.mockito.exceptions.base.MockitoException: Cannot mock/spy class com.mithuroy.mvparchitecture.LoginService Mockito cannot mock/spy following: - final classes - anonymous classes - primitive types
m

mgaetan89

06/25/2017, 7:05 AM
Your problem is exactly what your error says: your class is final (it's the default in Kotlin). Here is the solution https://github.com/mockito/mockito/wiki/What%27s-new-in-Mockito-2#unmockable
m

mithuroy

06/26/2017, 3:46 PM
Hey Thanks a lot you solved the problem