use of org.mockito.plugins.MockitoLogger in project mockito by mockito.
the class DefaultMockitoSessionBuilder method startMocking.
@Override
public MockitoSession startMocking() {
// Configure default values
List<Object> effectiveTestClassInstances;
String effectiveName;
if (testClassInstances.isEmpty()) {
effectiveTestClassInstances = emptyList();
effectiveName = this.name == null ? "<Unnamed Session>" : this.name;
} else {
effectiveTestClassInstances = new ArrayList<>(testClassInstances);
Object lastTestClassInstance = testClassInstances.get(testClassInstances.size() - 1);
effectiveName = this.name == null ? lastTestClassInstance.getClass().getName() : this.name;
}
Strictness effectiveStrictness = this.strictness == null ? Strictness.STRICT_STUBS : this.strictness;
MockitoLogger logger = this.logger == null ? Plugins.getMockitoLogger() : new MockitoLoggerAdapter(this.logger);
return new DefaultMockitoSession(effectiveTestClassInstances, effectiveName, effectiveStrictness, logger);
}
Aggregations