Search in sources :

Example 1 with FooStepsWithDependency

use of org.jbehave.core.steps.needle.NeedleStepsFactoryBehaviour.FooStepsWithDependency in project jbehave-core by jbehave.

the class NeedleAnnotationBuilderBehaviour method shouldSupplyInjectors.

@Test
public void shouldSupplyInjectors() {
    final NeedleAnnotationBuilder builderAnnotated = new NeedleAnnotationBuilder(AnnotatedWithStepsWithDependency.class);
    final List<CandidateSteps> buildCandidateSteps = builderAnnotated.buildCandidateSteps();
    assertThatStepsInstancesAre(buildCandidateSteps, FooStepsWithDependency.class);
    final ValueGetter getter = ((FooStepsWithDependency) ((Steps) buildCandidateSteps.get(0)).instance()).getGetter();
    assertThat(getter, is(notNullValue()));
    assertThat((String) getter.getValue(), is(ValueGetter.VALUE));
}
Also used : FooStepsWithDependency(org.jbehave.core.steps.needle.NeedleStepsFactoryBehaviour.FooStepsWithDependency) CandidateSteps(org.jbehave.core.steps.CandidateSteps) ValueGetter(org.jbehave.core.steps.needle.ValueGetter) Test(org.junit.Test)

Aggregations

CandidateSteps (org.jbehave.core.steps.CandidateSteps)1 FooStepsWithDependency (org.jbehave.core.steps.needle.NeedleStepsFactoryBehaviour.FooStepsWithDependency)1 ValueGetter (org.jbehave.core.steps.needle.ValueGetter)1 Test (org.junit.Test)1