I use mockk for unit testing in Kotlin (Android).
I want to verify that a function is called:
verify { obj.callSomething("param1", Param2("A", "B")) }
In this case Param2
is a generated Java class that doesn't override equals
method so that the verification is always fail.
I've tried to use match
but the failure message is simply not helpful.
verify { obj.callSomething("param1", match { it.a == "A" && it.b == "B" }) }
Is there a better or correct way to do this?