Is there any way to emulate verifyNoInteractions f...
# mockk
g
Is there any way to emulate verifyNoInteractions from mockito? Because I found that I missed this verification method in some cases
o
Sorry for late reply, there is verifySequence / verifyAll that is doing same thing
g
So actually verifySequence/verifyAll verifies all invocations inside of block and if there are any other interactions will throw a verification error?
o
yes, with following detail: verifySequence will also take into the regard order and verifyAll will not
g
yeah, I got difference about order, it’s just not obvious that those operators also verify that no other interactions happened
Maybe make sense to add it exlicitly to docs otherwise it’s not obvious for me
I just thought that it shortcut for multiple verify calls
Anyway, thanks a lot for info
@oleksiyp One more question, can I somehow check that there is no interactions with mock. Now you must at least have one check inside of verifyOrder/verifyAll block
d
I think it's
verify(exactly = 0) { }
@gildor, there's a bunch of interesting params to verify you might find useful...
o
Or
verify { mock wasNot called }
:-)
g
Thanks. Dave, yeah, I use exactly param all the time, it's just not obvious that it will work like that. Isn't it inconsistent behavior verifyOrder throws an exception if no mock calls, but verify works properly?
Like
wasNot called
approach tho