public void verify(VerificationData data) { List<Invocation> invocations = data.getAllInvocations(); InvocationMatcher wanted = data.getWanted(); InvocationsFinder finder = new InvocationsFinder(); List<Invocation> found = finder.findInvocations(invocations, wanted); int foundSize = found.size(); if (foundSize > maxNumberOfInvocations) { new Reporter().wantedAtMostX(maxNumberOfInvocations, foundSize); } invocationMarker.markVerified(found, wanted); }
@SuppressWarnings("unchecked") public void verify(VerificationData data) { Invocation unverified = new InvocationsFinder().findFirstUnverified(data.getAllInvocations()); if (unverified != null) { new Reporter().noMoreInteractionsWanted(unverified, (List) data.getAllInvocations()); } }
public void verifyInOrder(VerificationDataInOrder data) { List<Invocation> invocations = data.getAllInvocations(); Invocation unverified = new InvocationsFinder().findFirstUnverifiedInOrder(data.getOrderingContext(), invocations); if (unverified != null) { new Reporter().noMoreInteractionsWantedInOrder(unverified); } }
@Override public void verify(final VerificationData data) { InvocationsFinder finder = new InvocationsFinder(); List<Invocation> actualInvocations = finder.findInvocations(data.getAllInvocations(), data.getWanted()); if (actualInvocations.size() != 1) { throw new MockitoException("This verifier can only be used with 1 invocation, got " + actualInvocations.size()); } Invocation invocation = actualInvocations.get(0); arguments = invocation.getArguments(); invocation.markVerified(); }
public MissingInvocationChecker() { this(new InvocationsFinder(), new Reporter()); }
MissingInvocationChecker(InvocationsFinder finder, Reporter reporter) { this.finder = finder; this.reporter = reporter; }
public NumberOfInvocationsInOrderChecker() { this(new InvocationsFinder(), new Reporter()); }
NumberOfInvocationsInOrderChecker(InvocationsFinder finder, Reporter reporter) { this.finder = finder; this.reporter = reporter; }
public NumberOfInvocationsChecker() { this(new Reporter(), new InvocationsFinder()); }
NumberOfInvocationsChecker(Reporter reporter, InvocationsFinder finder) { this.reporter = reporter; this.finder = finder; }
public MissingInvocationInOrderChecker() { this(new InvocationsFinder(), new Reporter()); }
MissingInvocationInOrderChecker(InvocationsFinder finder, Reporter reporter) { this.finder = finder; this.reporter = reporter; }
public NonGreedyNumberOfInvocationsInOrderChecker() { this(new InvocationsFinder(), new Reporter(), new InvocationMarker()); }
NonGreedyNumberOfInvocationsInOrderChecker(InvocationsFinder finder, Reporter reporter, InvocationMarker marker ) { this.finder = finder; this.reporter = reporter; this.marker = marker; }