You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever isEqual(...) (and similar matchers) is called inside verify {} with mocked argument, it causes argument's toString() method verification.
val sut =Sut(mock, otherMock)
@Test
funtest() {
sut.process()
verify { mock.foo(isEqual(otherMock)) } // Assertion error - Expected otherMock.toString() but not called
}
It seems that isEqual(...) calls otherMock.toString() during ArgConstraint creation and it leads to unintended verification. I think it could be fixed by resolving ArgConstraint.description lazily.
P.S. I am not sure if this use case is fully valid, but I've encountered it inside my side project.
The text was updated successfully, but these errors were encountered:
Whenever isEqual(...) (and similar matchers) is called inside verify {} with mocked argument, it causes argument's toString() method verification.
It seems that isEqual(...) calls otherMock.toString() during ArgConstraint creation and it leads to unintended verification. I think it could be fixed by resolving ArgConstraint.description lazily.
P.S. I am not sure if this use case is fully valid, but I've encountered it inside my side project.
The text was updated successfully, but these errors were encountered: