use of org.mockito.session.MockitoSessionLogger in project mockito by mockito.
the class DefaultMockitoSessionBuilderTest method uses_logger_and_strictness.
@Test
public void uses_logger_and_strictness() {
TestClass testClass = new TestClass();
final List<String> hints = new ArrayList<String>();
MockitoSession session = new DefaultMockitoSessionBuilder().initMocks(testClass).strictness(WARN).logger(new MockitoSessionLogger() {
@Override
public void log(String hint) {
hints.add(hint);
}
}).startMocking();
when(testClass.set.add(1)).thenReturn(true);
session.finishMocking();
assertFalse(hints.isEmpty());
}
Aggregations