Search in sources :

Example 1 with BellyStepdefs

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

the class SpringFactoryTest method shouldGiveUsNewStepInstancesForEachScenario.

@Test
public void shouldGiveUsNewStepInstancesForEachScenario() {
    final ObjectFactory factory = new SpringFactory();
    factory.addClass(BellyStepdefs.class);
    // Scenario 1
    factory.start();
    final BellyStepdefs o1 = factory.getInstance(BellyStepdefs.class);
    factory.stop();
    // Scenario 2
    factory.start();
    final BellyStepdefs o2 = factory.getInstance(BellyStepdefs.class);
    factory.stop();
    assertNotNull(o1);
    assertNotNull(o2);
    assertNotSame(o1, o2);
}
Also used : ObjectFactory(cucumber.api.java.ObjectFactory) BellyStepdefs(cucumber.runtime.java.spring.contextconfig.BellyStepdefs) Test(org.junit.Test)

Aggregations

ObjectFactory (cucumber.api.java.ObjectFactory)1 BellyStepdefs (cucumber.runtime.java.spring.contextconfig.BellyStepdefs)1 Test (org.junit.Test)1