any() from Kotlin Mockito library crash with the following code
The Test Class
import com.nhaarman.mockito_kotlin.any
import com.nha
The library relies on the reflection to instantiate an object of a given type to be used as mockito "Any" object.
It might not be possible for those classes which have non-trivial constructors. Response
is one of them.
If you could get an instance of Response
somehow, you can use it instead like:
verify(injectedObject).settingDependentObject(Mockito.any() ?: someResponse)