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
correctly flags any unexpected (unchecked) interactions after lastCheck
incorrectly ignores any unexpected (unchecked) interactions before lastCheck
Example
The following example illustrates how the placement of verifyNoMoreInteractions changes the behavior. (note the example is written in kotlin, but the affected library is mockito-core)
inOrder.verifyNoMoreInteractions() is different than Mockito.verifyNoMoreInteractions(). Take a look at the Javadoc. If the Javadoc is not clear, please submit a PR ;-)
The
verifyNoMoreInteractions
method has an expectation that if will flag unexpected (unchecked) interactions on the related mocks. For Example:verifyNoMoreInteractions(mocks)
However, when it is used with an
inOrder
context, the code does not behave as expected:Example
The following example illustrates how the placement of
verifyNoMoreInteractions
changes the behavior. (note the example is written in kotlin, but the affected library is mockito-core)Suggestions
Perhaps the [re-use of] method name causes some confusion in expectation:
verifyNoMoreInteractions
vs.verifyNoOtherInteractions
vs.inOrder.verifyLastInteraction
vs.inOrder.verifyNoOtherInteractions
Checklist
Note that some configuration are impossible to mock via Mockito
(same as any question on stackoverflow.com)
The text was updated successfully, but these errors were encountered: