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);
}
Aggregations