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

net.serenitybdd.jbehave.SerenityCandidateSteps Maven / Gradle / Ivy

There is a newer version: 1.46.0
Show newest version
package net.serenitybdd.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 SerenityCandidateSteps implements CandidateSteps {
    private final CandidateSteps candidateSteps;

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

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

    private Converter toSerenityStepCandidates() {
        return new Converter() {
            public StepCandidate convert(StepCandidate stepCandidate) {
                return new SerenityStepCandidate(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