org.mockito.junit
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);
verify(methods).byteReturningMethod();
verify(methods).simpleMethod();
}
Modifier and Type | Method and Description |
---|---|
VerificationCollector |
assertLazily()
Enforce all verifications are performed lazily.
|
void |
collectAndReport()
Collect all lazily verified behaviour.
|
void collectAndReport() throws MockitoAssertionError
MockitoAssertionError
- If there were failed verificationsVerificationCollector assertLazily()