org.mockito.verification
public interface VerificationAfterDelay extends VerificationMode
VerificationMode
that allows combining existing verification modes with an initial delay, e.g.
verify(mock, after(100).atMost(5)).foo();
verify(mock, after(100).never()).bar();
verify(mock, after(200).atLeastOnce()).baz();
This is similar to timeout()
except the assertion will not terminate until either the condition is
definitively failed, or the full time has elapsed (whereas timeout() will also stop if the conditions is true at any point, as is
typically the case with never() etc initially).
See examples in javadoc for Mockito.verify(Object, VerificationMode)
Modifier and Type | Method and Description |
---|---|
VerificationMode |
atLeast(int minNumberOfInvocations)
Verifies that there is are least N invocations during the given period.
|
VerificationMode |
atLeastOnce()
Verifies that there is at least 1 invocation during the given period.
|
VerificationMode |
atMost(int maxNumberOfInvocations)
Verifies that there is are most N invocations during the given period.
|
VerificationMode |
never()
Allows verification that there are no invocations at any point during the given period.
|
VerificationMode |
only()
Verifies that there the given method is invoked and is the only method invoked.
|
VerificationMode |
times(int wantedNumberOfInvocations)
Verifies that there are exactly N invocations during the given period.
|
description, verify
VerificationMode times(int wantedNumberOfInvocations)
VerificationMode never()
VerificationMode atLeastOnce()
VerificationMode atLeast(int minNumberOfInvocations)
VerificationMode atMost(int maxNumberOfInvocations)
VerificationMode only()