mockito-kotlin
mockito-kotlin copied to clipboard
spy call real method for doReturn when
trafficstars
It's unexpected because:
val someObject = Mockito.spy(SomeClass(dependency1, dependency2))
// ...
Mockito.doReturn(someResult).`when`(someObject).someMethod(param1)
Does not call the real someMethod
Or is this library's spy is intended to work differently from Mockito's spy? 🤔
@ericntw Sounds like a duplicate of either #319 or #369. What's the output of your test?
Check answer here.