Package org.mockito.verification
Interface VerificationAfterDelay
-
- All Superinterfaces:
VerificationMode
- All Known Implementing Classes:
After
public interface VerificationAfterDelay extends VerificationMode
VerificationAfterDelay is aVerificationMode
that allows combining existing verification modes with an initial delay, e.g.
This is similar toverify(mock, after(100).atMost(5)).foo(); verify(mock, after(100).never()).bar(); verify(mock, after(200).atLeastOnce()).baz();
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)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method 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
atMostOnce()
Verifies that there is most 1 invocation 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.-
Methods inherited from interface org.mockito.verification.VerificationMode
description, verify
-
-
-
-
Method Detail
-
times
VerificationMode times(int wantedNumberOfInvocations)
Verifies that there are exactly N invocations during the given period. This will wait the full period given.
-
never
VerificationMode never()
Allows verification that there are no invocations at any point during the given period. This will wait the full period given, unless an invocation occurs (in which case there will be immediate failure)
-
atLeastOnce
VerificationMode atLeastOnce()
Verifies that there is at least 1 invocation during the given period. This will wait the full period given.
-
atLeast
VerificationMode atLeast(int minNumberOfInvocations)
Verifies that there is are least N invocations during the given period. This will wait the full period given.
-
atMostOnce
VerificationMode atMostOnce()
Verifies that there is most 1 invocation during the given period. This will wait the full period given, unless too many invocations occur (in which case there will be an immediate failure)
-
atMost
VerificationMode atMost(int maxNumberOfInvocations)
Verifies that there is are most N invocations during the given period. This will wait the full period given, unless too many invocations occur (in which case there will be an immediate failure)
-
only
VerificationMode only()
Verifies that there the given method is invoked and is the only method invoked. This will wait the full period given, unless another method is invoked (in which case there will be an immediate failure)
-
-