Mockito provides argument matchers and argument captors for flexibly stubbing or verifying method calls.
Mockito.verify()
, Mockito.when()
, Stubber.when()
and BDDMockito.given()
each have overloads
with and without argument matchers.
However, if argument matchers or captors are used only on some of the parameters, all the parameters need to have matchers as well, otherwise an
InvalidUseOfMatchersException
will be thrown.
This rule consequently raises an issue every time matchers are not used on all the parameters of a stubbed/verified method.