@Test public void shouldBuildEmptyStepsListIfAnnotationOrAnnotatedValuesNotPresent() { final AnnotationBuilder builderNotAnnotated = new NeedleAnnotationBuilder(NotAnnotated.class); assertThatStepsInstancesAre(builderNotAnnotated.buildCandidateSteps()); final AnnotationBuilder builderAnnotatedWithoutLocations = new NeedleAnnotationBuilder(AnnotatedWithoutInjectors.class); assertThatStepsInstancesAre(builderAnnotatedWithoutLocations.buildCandidateSteps()); }
@Test public void shouldBuildStepsList() { final AnnotationBuilder builderAnnotated = new NeedleAnnotationBuilder(AnnotatedMultipleSteps.class); final List<CandidateSteps> actual = builderAnnotated.buildCandidateSteps(); assertThatStepsInstancesAre(actual, FooStepsWithDependency.class, FooSteps.class); }
@Test public void shouldBuildCandidateStepsFromAnnotationsUsingNeedle() { final AnnotationBuilder builderAnnotated = new NeedleAnnotationBuilder(AnnotatedUsingNeedle.class); final Configuration configuration = builderAnnotated.buildConfiguration(); assertTrue(builderAnnotated.buildCandidateSteps(configuration).isEmpty()); }
@Test public void shouldBuildCandidateStepsFromAnnotationsUsingStepsAndGuiceAndConverters() { final AnnotationBuilder builderAnnotated = new NeedleAnnotationBuilder(AnnotatedUsingConfigureAndNeedleConverters.class); final Configuration configuration = builderAnnotated.buildConfiguration(); assertThatStepsInstancesAre( builderAnnotated.buildCandidateSteps(configuration), FooSteps.class); }