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

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

There is a newer version: 4.2.8
Show newest version
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 - 2024 Weber Informatics LLC | Privacy Policy