Package | Description |
---|---|
org.mockito |
Mockito is a mock library for java - see Mockito class for for usage.
|
org.mockito.verification |
Modifier and Type | Method and Description |
---|---|
static VerificationMode |
Mockito.atLeast(int minNumberOfInvocations)
Allows at-least-x verification.
|
static VerificationMode |
Mockito.atLeastOnce()
Allows at-least-once verification.
|
static VerificationMode |
Mockito.atMost(int maxNumberOfInvocations)
Allows at-most-x verification.
|
static VerificationMode |
Mockito.calls(int wantedNumberOfInvocations)
Allows non-greedy verification in order.
|
static VerificationMode |
Mockito.description(String description)
Adds a description to be printed if verification fails.
|
static VerificationMode |
Mockito.never()
Alias to
times(0) , see Mockito.times(int) |
static VerificationMode |
Mockito.only()
Allows checking if given method was the only one invoked.
|
static VerificationMode |
Mockito.times(int wantedNumberOfInvocations)
Allows verifying exact number of invocations.
|
Modifier and Type | Method and Description |
---|---|
T |
BDDMockito.Then.should(InOrder inOrder,
VerificationMode mode) |
T |
BDDMockito.Then.should(VerificationMode mode) |
<T> T |
InOrder.verify(T mock,
VerificationMode mode)
Verifies interaction in order.
|
static <T> T |
Mockito.verify(T mock,
VerificationMode mode)
Verifies certain behavior happened at least once / exact number of times / never.
|
Modifier and Type | Class and Description |
---|---|
class |
VerificationWrapper<WrapperType extends VerificationMode> |
Modifier and Type | Interface and Description |
---|---|
interface |
VerificationAfterDelay
VerificationAfterDelay is a
VerificationMode that allows combining existing verification modes with an initial delay, e.g. |
interface |
VerificationWithTimeout
VerificationWithTimeout is a
VerificationMode that allows combining existing verification modes with 'timeout'. |
Modifier and Type | Class and Description |
---|---|
class |
After
See the javadoc for
VerificationAfterDelay |
class |
Timeout
See the javadoc for
VerificationWithTimeout |
class |
VerificationWrapper<WrapperType extends VerificationMode> |
class |
VerificationWrapperInOrderWrapper |
Modifier and Type | Field and Description |
---|---|
protected WrapperType |
VerificationWrapper.wrappedVerification |
Modifier and Type | Method and Description |
---|---|
VerificationMode |
VerificationWrapper.atLeast(int minNumberOfInvocations) |
VerificationMode |
VerificationAfterDelay.atLeast(int minNumberOfInvocations)
Verifies that there is are least N invocations during the given period.
|
VerificationMode |
VerificationWithTimeout.atLeast(int minNumberOfInvocations)
Allows at-least-x verification within given timeout.
|
VerificationMode |
VerificationWrapper.atLeastOnce() |
VerificationMode |
VerificationAfterDelay.atLeastOnce()
Verifies that there is at least 1 invocation during the given period.
|
VerificationMode |
VerificationWithTimeout.atLeastOnce()
Allows at-least-once verification within given timeout.
|
VerificationMode |
VerificationWrapper.atMost(int maxNumberOfInvocations) |
VerificationMode |
VerificationAfterDelay.atMost(int maxNumberOfInvocations)
Verifies that there is are most N invocations during the given period.
|
VerificationMode |
Timeout.atMost(int maxNumberOfInvocations) |
protected abstract VerificationMode |
VerificationWrapper.copySelfWithNewVerificationMode(VerificationMode verificationMode) |
protected VerificationMode |
After.copySelfWithNewVerificationMode(VerificationMode verificationMode) |
protected VerificationMode |
Timeout.copySelfWithNewVerificationMode(VerificationMode newVerificationMode) |
VerificationMode |
VerificationWrapperInOrderWrapper.description(String description) |
VerificationMode |
After.description(String description) |
VerificationMode |
VerificationMode.description(String description)
Description will be prepended to the assertion error if verification fails.
|
VerificationMode |
Timeout.description(String description) |
VerificationMode |
VerificationStrategy.maybeVerifyLazily(VerificationMode mode)
Possibly wrap the given VerificationMode and return a wrapping
VerificationMode instead.
|
VerificationMode |
VerificationWrapper.never() |
VerificationMode |
VerificationAfterDelay.never()
Allows verification that there are no invocations at any point during the given period.
|
VerificationMode |
Timeout.never() |
VerificationMode |
VerificationWrapper.only() |
VerificationMode |
VerificationAfterDelay.only()
Verifies that there the given method is invoked and is the only method invoked.
|
VerificationMode |
VerificationWithTimeout.only()
Allows checking if given method was the only one invoked.
|
VerificationMode |
VerificationWrapper.times(int wantedNumberOfInvocations) |
VerificationMode |
VerificationAfterDelay.times(int wantedNumberOfInvocations)
Verifies that there are exactly N invocations during the given period.
|
VerificationMode |
VerificationWithTimeout.times(int wantedNumberOfInvocations)
Allows verifying exact number of invocations within given timeout
|
Modifier and Type | Method and Description |
---|---|
protected abstract VerificationMode |
VerificationWrapper.copySelfWithNewVerificationMode(VerificationMode verificationMode) |
protected VerificationMode |
After.copySelfWithNewVerificationMode(VerificationMode verificationMode) |
protected VerificationMode |
Timeout.copySelfWithNewVerificationMode(VerificationMode newVerificationMode) |
VerificationMode |
VerificationStrategy.maybeVerifyLazily(VerificationMode mode)
Possibly wrap the given VerificationMode and return a wrapping
VerificationMode instead.
|
Constructor and Description |
---|
After(long delayMillis,
VerificationMode verificationMode)
See the javadoc for
VerificationAfterDelay |
Timeout(long millis,
VerificationMode delegate)
See the javadoc for
VerificationWithTimeout |