Search in sources :

Example 1 with UnfinishedVerificationException

use of org.mockito.exceptions.misusing.UnfinishedVerificationException in project mockito by mockito.

the class FindingRedundantInvocationsInOrderTest method shouldValidateState.

@Test
public void shouldValidateState() throws Exception {
    //when
    InOrder inOrder = inOrder(mock);
    // mess up state
    verify(mock);
    //then
    try {
        inOrder.verifyNoMoreInteractions();
        fail();
    } catch (UnfinishedVerificationException e) {
    }
}
Also used : InOrder(org.mockito.InOrder) UnfinishedVerificationException(org.mockito.exceptions.misusing.UnfinishedVerificationException) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 InOrder (org.mockito.InOrder)1 UnfinishedVerificationException (org.mockito.exceptions.misusing.UnfinishedVerificationException)1