kotlinmockitomockkmockk-verify

What is the analogue of Mockito.verifyZeroInteractions(obj) in the Mockk library?


I want to switch to Mockk, but i cant find analogue of this method in Mockk It doesn't work

verify (exactly = 0) { obj }

Solution

  • The way you are trying it, is missing the method or variable

    verify (exactly = 0) { obj.something }
    
    

    Using the exactly zero approach would require

    confirmVerified(obj)
    

    To be sure nothing else was called.

    The exact equivalent would be:

    verify { obj wasNot Called }