All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fitbur.mockito.internal.creation.instance.DefaultInstantiatorProvider Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
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;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy