public class VerificationOverTimeImpl extends Object implements VerificationMode
Constructor and Description |
---|
VerificationOverTimeImpl(long pollingPeriodMillis,
long durationMillis,
VerificationMode delegate,
boolean returnOnSuccess)
Create this verification mode, to be used to verify invocation ongoing data later.
|
VerificationOverTimeImpl(long pollingPeriodMillis,
VerificationMode delegate,
boolean returnOnSuccess,
Timer timer)
Create this verification mode, to be used to verify invocation ongoing data later.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
canRecoverFromFailure(VerificationMode verificationMode) |
VerificationOverTimeImpl |
copyWithVerificationMode(VerificationMode verificationMode) |
VerificationMode |
description(String description)
Description will be prepended to the assertion error if verification fails.
|
void |
verify(VerificationData data)
Verify the given ongoing verification data, and confirm that it satisfies the delegate verification mode
before the full duration has passed.
|
public VerificationOverTimeImpl(long pollingPeriodMillis, long durationMillis, VerificationMode delegate, boolean returnOnSuccess)
pollingPeriodMillis
- The frequency to poll delegate.verify(), to check whether the delegate has been satisfieddurationMillis
- The max time to wait (in millis) for the delegate verification mode to be satisfieddelegate
- The verification mode to delegate overall success or failure toreturnOnSuccess
- Whether to immediately return successfully once the delegate is satisfied (as in
VerificationWithTimeout
, or to only return once
the delegate is satisfied and the full duration has passed (as in
VerificationAfterDelay
).public VerificationOverTimeImpl(long pollingPeriodMillis, VerificationMode delegate, boolean returnOnSuccess, Timer timer)
pollingPeriodMillis
- The frequency to poll delegate.verify(), to check whether the delegate has been satisfieddelegate
- The verification mode to delegate overall success or failure toreturnOnSuccess
- Whether to immediately return successfully once the delegate is satisfied (as in
VerificationWithTimeout
, or to only return once
the delegate is satisfied and the full duration has passed (as in
VerificationAfterDelay
).timer
- Checker of whether the duration of the verification is still acceptablepublic void verify(VerificationData data)
AtMost
).
If it is satisfied before the full duration has passed, behaviour is dependent on the returnOnSuccess parameter
given in the constructor. If true, this verification mode is immediately satisfied once the delegate is. If
false, this verification mode is not satisfied until the delegate is satisfied and the full time has passed.verify
in interface VerificationMode
MockitoAssertionError
- if the delegate verification mode does not succeed before the timeoutprotected boolean canRecoverFromFailure(VerificationMode verificationMode)
public VerificationOverTimeImpl copyWithVerificationMode(VerificationMode verificationMode)
public VerificationMode description(String description)
VerificationMode
description
in interface VerificationMode
description
- The custom failure message