use of org.mockito.internal.creation.MockSettingsImpl in project mockito by mockito.
the class MockHandlerImplTest method should_remove_verification_mode_even_when_invalid_matchers.
@Test
public void should_remove_verification_mode_even_when_invalid_matchers() throws Throwable {
// given
Invocation invocation = new InvocationBuilder().toInvocation();
@SuppressWarnings("rawtypes") MockHandlerImpl<?> handler = new MockHandlerImpl(new MockSettingsImpl());
mockingProgress().verificationStarted(VerificationModeFactory.atLeastOnce());
handler.matchersBinder = new MatchersBinder() {
public InvocationMatcher bindMatchers(ArgumentMatcherStorage argumentMatcherStorage, Invocation invocation) {
throw new InvalidUseOfMatchersException();
}
};
try {
// when
handler.handle(invocation);
// then
fail();
} catch (InvalidUseOfMatchersException ignored) {
}
assertNull(mockingProgress().pullVerificationMode());
}
Aggregations