com.fitbur.mockito.internal.creation.instance.DefaultInstantiatorProvider Maven / Gradle / Ivy
package com.fitbur.mockito.internal.creation.instance;
import com.fitbur.mockito.mock.MockCreationSettings;
import com.fitbur.mockito.plugins.InstantiatorProvider;
public class DefaultInstantiatorProvider implements InstantiatorProvider {
private final static Instantiator INSTANCE = new ObjenesisInstantiator();
public Instantiator getInstantiator(MockCreationSettings settings) {
if (settings != null && settings.isUsingConstructor()) {
return new ConstructorInstantiator(settings.getOuterClassInstance());
} else {
return INSTANCE;
}
}
}