org.mockito.verification
public interface VerificationMode
verify(mock, times(5)).someMethod("was called five times");
verify(mock, never()).someMethod("was never called");
verify(mock, atLeastOnce()).someMethod("was called at least once");
verify(mock, atLeast(2)).someMethod("was called at least twice");
verify(mock, atMost(3)).someMethod("was called at most 3 times");
times(1) is the default and can be omitted
See examples in javadoc for Mockito.verify(Object, VerificationMode)
Modifier and Type | Method and Description |
---|---|
VerificationMode |
description(String description)
Description will be prepended to the assertion error if verification fails.
|
void |
verify(VerificationData data)
Performs the verification
|
void verify(VerificationData data)
VerificationMode description(String description)
description
- The custom failure message