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

net.thucydides.core.steps.SharedInstancesByDefaultStepCreationStrategy Maven / Gradle / Ivy

package net.thucydides.core.steps;

public class SharedInstancesByDefaultStepCreationStrategy implements StepLibraryCreationStrategy {
    private final StepFactory stepFactory;
    private final StepsAnnotatedField stepsField;

    public SharedInstancesByDefaultStepCreationStrategy(StepFactory stepFactory, StepsAnnotatedField stepsField) {
        this.stepFactory = stepFactory;
        this.stepsField = stepsField;
    }

    @Override
    public  T initiateStepsFor(Class scenarioStepsClass) {
        return (stepsField.isUniqueInstance()) ?
                stepFactory.getNewStepLibraryFor(scenarioStepsClass) :
                stepFactory.getSharedStepLibraryFor(scenarioStepsClass);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy