Search in sources :

Example 1 with PendingStepMethodGenerator

use of org.jbehave.core.steps.PendingStepMethodGenerator in project jbehave-core by jbehave.

the class StoryRunner method generatePendingStepMethods.

private void generatePendingStepMethods(RunContext context, List<Step> steps) {
    List<PendingStep> pendingSteps = new ArrayList<>();
    for (Step step : steps) {
        if (step instanceof PendingStep) {
            pendingSteps.add((PendingStep) step);
        }
    }
    if (!pendingSteps.isEmpty()) {
        PendingStepMethodGenerator generator = new PendingStepMethodGenerator(context.configuration().keywords());
        List<String> methods = new ArrayList<>();
        for (PendingStep pendingStep : pendingSteps) {
            if (!pendingStep.annotated()) {
                methods.add(generator.generateMethod(pendingStep));
            }
        }
        reporter.get().pendingMethods(methods);
    }
}
Also used : PendingStep(org.jbehave.core.steps.StepCreator.PendingStep) ArrayList(java.util.ArrayList) Step(org.jbehave.core.steps.Step) ParametrisedStep(org.jbehave.core.steps.StepCreator.ParametrisedStep) PendingStep(org.jbehave.core.steps.StepCreator.PendingStep) PendingStepMethodGenerator(org.jbehave.core.steps.PendingStepMethodGenerator)

Aggregations

ArrayList (java.util.ArrayList)1 PendingStepMethodGenerator (org.jbehave.core.steps.PendingStepMethodGenerator)1 Step (org.jbehave.core.steps.Step)1 ParametrisedStep (org.jbehave.core.steps.StepCreator.ParametrisedStep)1 PendingStep (org.jbehave.core.steps.StepCreator.PendingStep)1