Hi all! Could somebody please explain what this er...
# mockk
d
Hi all! Could somebody please explain what this error means?
io.mockk.MockKException: Failed matching mocking signature for\n\nleft matchers: [any(), any(), any()]
Version 1.8.9 Code:
every { clientFactory.invoke(any(), any(), any()) } returns client
clientFactory
is factory function which returns the object of client.
Also if I specify exact arguments in function I receive
io.mockk.MockKException: Missing calls inside every { ... } block.
l
Are you sure client factory is mocked?
👍 1
d
Yes, previously it went to real execution instead of mocking. As I know mockk does not use real execution, am I right?
Hm, checked again. I'm not sure that it's mocked....
l
You can only use
every { XX }
when XX is mocked
If you want some of it mocked and some of it real impl, you can use
spykk
instead
d
Yes, I know that... It's surprise to me that object is not mocked...
l
Happens to all of us 😛
Did it work again?
d
Nope... I'm injecting mockk using Spring and test configuration because i'm testing spring controller...
OMG. I don't know what has changed. But now it's working... Thank you @LeoColman! 🙂
l
😄