use of org.mockito.internal.verification.api.VerificationDataInOrderImpl in project mockito by mockito.
the class NoMoreInteractionsTest method shouldVerifyInOrderMultipleInvoctions.
@Test
public void shouldVerifyInOrderMultipleInvoctions() {
//given
NoMoreInteractions n = new NoMoreInteractions();
Invocation i = new InvocationBuilder().seq(1).toInvocation();
Invocation i2 = new InvocationBuilder().seq(2).toInvocation();
//when
context.markVerified(i2);
//then no exception is thrown
n.verifyInOrder(new VerificationDataInOrderImpl(context, asList(i, i2), null));
}
use of org.mockito.internal.verification.api.VerificationDataInOrderImpl in project mockito by mockito.
the class NoMoreInteractionsTest method shouldVerifyInOrderAndPass.
@Test
public void shouldVerifyInOrderAndPass() {
//given
NoMoreInteractions n = new NoMoreInteractions();
Invocation i = new InvocationBuilder().toInvocation();
context.markVerified(i);
assertTrue(context.isVerified(i));
//when
n.verifyInOrder(new VerificationDataInOrderImpl(context, asList(i), null));
//then no exception is thrown
}
use of org.mockito.internal.verification.api.VerificationDataInOrderImpl in project mockito by mockito.
the class NoMoreInteractionsTest method shouldVerifyInOrderMultipleInvoctionsAndThrow.
@Test
public void shouldVerifyInOrderMultipleInvoctionsAndThrow() {
//given
NoMoreInteractions n = new NoMoreInteractions();
Invocation i = new InvocationBuilder().seq(1).toInvocation();
Invocation i2 = new InvocationBuilder().seq(2).toInvocation();
try {
//when
n.verifyInOrder(new VerificationDataInOrderImpl(context, asList(i, i2), null));
fail();
} catch (VerificationInOrderFailure e) {
}
}
use of org.mockito.internal.verification.api.VerificationDataInOrderImpl in project mockito by mockito.
the class MockitoCore method verifyNoMoreInteractionsInOrder.
public void verifyNoMoreInteractionsInOrder(List<Object> mocks, InOrderContext inOrderContext) {
mockingProgress().validateState();
VerificationDataInOrder data = new VerificationDataInOrderImpl(inOrderContext, VerifiableInvocationsFinder.find(mocks), null);
VerificationModeFactory.noMoreInteractions().verifyInOrder(data);
}
use of org.mockito.internal.verification.api.VerificationDataInOrderImpl in project mockito by mockito.
the class InOrderWrapper method verify.
public void verify(VerificationData data) {
List<Invocation> invocations = VerifiableInvocationsFinder.find(inOrder.getMocksToBeVerifiedInOrder());
VerificationDataInOrderImpl dataInOrder = new VerificationDataInOrderImpl(inOrder, invocations, data.getTarget());
mode.verifyInOrder(dataInOrder);
}
Aggregations