Search in sources :

Example 1 with WithContextHierarchyAnnotation

use of io.cucumber.spring.contexthierarchyconfig.WithContextHierarchyAnnotation in project cucumber-jvm by cucumber.

the class SpringFactoryTest method shouldRespectContextHierarchyInStepDefs.

@Test
void shouldRespectContextHierarchyInStepDefs() {
    final ObjectFactory factory = new SpringFactory();
    factory.addClass(WithContextHierarchyAnnotation.class);
    factory.start();
    WithContextHierarchyAnnotation stepdef = factory.getInstance(WithContextHierarchyAnnotation.class);
    factory.stop();
    assertThat(stepdef, is(notNullValue()));
    assertTrue(stepdef.isAutowired());
}
Also used : ObjectFactory(io.cucumber.core.backend.ObjectFactory) WithContextHierarchyAnnotation(io.cucumber.spring.contexthierarchyconfig.WithContextHierarchyAnnotation) Test(org.junit.jupiter.api.Test)

Aggregations

ObjectFactory (io.cucumber.core.backend.ObjectFactory)1 WithContextHierarchyAnnotation (io.cucumber.spring.contexthierarchyconfig.WithContextHierarchyAnnotation)1 Test (org.junit.jupiter.api.Test)1