Search in sources :

Example 1 with WithSpringAnnotations

use of cucumber.runtime.java.spring.contextconfig.WithSpringAnnotations in project cucumber-jvm by cucumber.

the class SpringFactoryTest method shouldRespectCommonAnnotationsInStepDefs.

@Test
public void shouldRespectCommonAnnotationsInStepDefs() {
    final ObjectFactory factory = new SpringFactory();
    factory.addClass(WithSpringAnnotations.class);
    factory.start();
    WithSpringAnnotations stepdef = factory.getInstance(WithSpringAnnotations.class);
    factory.stop();
    assertNotNull(stepdef);
    assertTrue(stepdef.isAutowired());
}
Also used : WithSpringAnnotations(cucumber.runtime.java.spring.contextconfig.WithSpringAnnotations) ObjectFactory(cucumber.api.java.ObjectFactory) Test(org.junit.Test)

Example 2 with WithSpringAnnotations

use of cucumber.runtime.java.spring.contextconfig.WithSpringAnnotations in project cucumber-jvm by cucumber.

the class SpringFactoryTest method shouldRespectCustomPropertyPlaceholderConfigurer.

@Test
public void shouldRespectCustomPropertyPlaceholderConfigurer() {
    final ObjectFactory factory = new SpringFactory();
    factory.addClass(WithSpringAnnotations.class);
    factory.start();
    WithSpringAnnotations stepdef = factory.getInstance(WithSpringAnnotations.class);
    factory.stop();
    assertEquals("property value", stepdef.getProperty());
}
Also used : WithSpringAnnotations(cucumber.runtime.java.spring.contextconfig.WithSpringAnnotations) ObjectFactory(cucumber.api.java.ObjectFactory) Test(org.junit.Test)

Aggregations

ObjectFactory (cucumber.api.java.ObjectFactory)2 WithSpringAnnotations (cucumber.runtime.java.spring.contextconfig.WithSpringAnnotations)2 Test (org.junit.Test)2