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

net.thucydides.jbehave.ThucydidesCandidateSteps Maven / Gradle / Ivy

The newest version!
package net.thucydides.jbehave;

import ch.lambdaj.function.convert.Converter;
import org.jbehave.core.annotations.ScenarioType;
import org.jbehave.core.configuration.Configuration;
import org.jbehave.core.steps.BeforeOrAfterStep;
import org.jbehave.core.steps.CandidateSteps;
import org.jbehave.core.steps.StepCandidate;

import java.util.List;

import static ch.lambdaj.Lambda.convert;

public class ThucydidesCandidateSteps implements CandidateSteps {
    private final CandidateSteps candidateSteps;

    public ThucydidesCandidateSteps(CandidateSteps candidateSteps) {
        this.candidateSteps = candidateSteps;
    }

    public List listCandidates() {
        return convert(candidateSteps.listCandidates(), toThucydidesStepCandidates());
    }

    private Converter toThucydidesStepCandidates() {
        return new Converter() {
            public StepCandidate convert(StepCandidate stepCandidate) {
                return new ThucydidesStepCandidate(stepCandidate);
            }
        };
    }

    public List listBeforeOrAfterStories() {
        return candidateSteps.listBeforeOrAfterStories();
    }

    public List listBeforeOrAfterStory(boolean givenStory) {
        return candidateSteps.listBeforeOrAfterStory(givenStory);
    }

    public List listBeforeOrAfterScenario(ScenarioType type) {
        return candidateSteps.listBeforeOrAfterScenario(type);
    }

    public Configuration configuration() {
        return candidateSteps.configuration();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy