public interface VerificationCollector
extends org.junit.rules.TestRule
byteReturningMethod() does not block
verifying against the simpleMethod(). After the test is run, a report is generated stating all
collect verification failures.
@Rule
public VerificationCollector collector = MockitoJUnit.collector();
@Test
public void should_fail() {
IMethods methods = mock(IMethods.class);
collector.verify(methods).byteReturningMethod();
collector.verify(methods).simpleMethod();
}
| Modifier and Type | Method and Description |
|---|---|
void |
collectAndReport()
Collect all lazily verified behaviour.
|
<T> T |
verify(T mock)
Lazily verify certain behaviour happened once.
|
<T> T |
verify(T mock,
VerificationMode mode)
Lazily verify certain behaviour happened at least once / exact number of times / never.
|
<T> T verify(T mock)
T - The type of the mockmock - to be verifiedMockito.verify(Object)<T> T verify(T mock,
VerificationMode mode)
T - The type of the mockmock - to be verifiedmode - times(x), atLeastOnce() or never()Mockito.verify(Object, VerificationMode)void collectAndReport()
throws MockitoAssertionError
MockitoAssertionError - If there were failed verifications