Is there a way to create automatic answers (with d...
# test
s
Is there a way to create automatic answers (with default returns) for a mocked object using mockk?
o
Not sure I understand exactly what you want
s
I'm mocking an object which is passed to an API. All i need to verify is if any method is invoked on that object.
o
You mean mock all functions together
s
Yeah, without hand coding answers{} for all functions of that class
o
There is relaxed mocks
May be that one
s
Ah, great, let me try that
o
But actually mock itself should require to provide answers only for what is actually called
Relaxed mock just make even this optional
s
Yeah, with relaxed, i got it working
o
Great
s
I was verifying a function returning an int
with relaxed, i don't even need to provide an answer for that
Thanks
o
Welcome