Search in sources :

Example 1 with ParametrisedStep

use of org.jbehave.core.steps.StepCreator.ParametrisedStep in project jbehave-core by jbehave.

the class StepCreatorBehaviour method shouldDescribeStepToReporterBeforeExecutingParametrisedStep.

@Test
public void shouldDescribeStepToReporterBeforeExecutingParametrisedStep() throws IntrospectionException {
    // Given
    SomeSteps stepsInstance = new SomeSteps();
    InjectableStepsFactory stepsFactory = new InstanceStepsFactory(new MostUsefulConfiguration(), stepsInstance);
    StepCreator stepCreator = new StepCreator(stepsInstance.getClass(), stepsFactory, stepsContext, null, new ParameterControls(), null, new SilentStepMonitor());
    StoryReporter storyReporter = mock(StoryReporter.class);
    // When
    Method method = SomeSteps.methodFor("aMethod");
    ((ParametrisedStep) stepCreator.createParametrisedStep(method, "When I run", "I run", null)).describeTo(storyReporter);
    // Then
    verify(storyReporter).beforeStep("When I run");
}
Also used : StoryReporter(org.jbehave.core.reporters.StoryReporter) ParametrisedStep(org.jbehave.core.steps.StepCreator.ParametrisedStep) MostUsefulConfiguration(org.jbehave.core.configuration.MostUsefulConfiguration) Method(java.lang.reflect.Method) Test(org.junit.Test)

Aggregations

Method (java.lang.reflect.Method)1 MostUsefulConfiguration (org.jbehave.core.configuration.MostUsefulConfiguration)1 StoryReporter (org.jbehave.core.reporters.StoryReporter)1 ParametrisedStep (org.jbehave.core.steps.StepCreator.ParametrisedStep)1 Test (org.junit.Test)1