so i have a test like this:
verify {
function.send(
withArg { assertEquals(expected, actual) },
withArg { assertEquals(expected, actual) })
}
and i'm wondering how can i easily see in stacktrace why the result was - (the diff between expected and actual object)
[1]: argument: ...responseCode=0003, usdAmount=12), matcher: matcher\<Transaction\>(), result: -
[2]: argument: CHARGEBACK, matcher: matcher\<Reason\>(), result: +
Stack trace:
io.mockk.impl.InternalPlatform.captureStackTrace (InternalPlatform.kt:125)
io.mockk.impl.stub.MockKStub.handleInvocation (MockKStub.kt:250)
...
i already added settings as doc says:
stackTracesOnVerify=true
stackTracesAlignment=left
Depending on your exact case, you might be able to use capturing slots while verifying the calls. This would allow you to do the assertions outside of the
verifyblock:Note that, inside the
verifyblock, this will now be equivalent to matchingfunction.send(any(), any()), which could change the result when your actualverifyblock is more complicated (for example, matching multiple calls of thesendfunction)