I'm having an issue with mockito. I'm trying to us...
# test
p
I'm having an issue with mockito. I'm trying to use the inline mock maker (for Kotlin finals) but in some of the java tests it returns actual objects instead of mocks. Anybody observed this before?
o
Nobody answers, so time to place an ad. Just in case you dont know. Try http://mockk.io
p
Hmm, interesting 🤔
o
Join #mockk for support
d
Just a thought, are you maybe also using Powermock? I had problems running both
🚫 1
r
No it should never turn actual.
if you initlize it as a mock, there is no way it can turn into a actual . Although I did see, issues when put together with robolectric
e
Check your mocking setup
Ah wait
are you using spy?
if so then it will not work if the method is called within class or parent class
you’re defining spy around reference and should use that reference to see setup behaviour
however when you call this method within class it uses
this
which of course is not stubbed and will run real implementations
I hope it helps
p
Late update, I was confused because with bytebuddy it looks like the original object when it's a final object instead of having the special type the old mock maker made. So all good 🙂