use of io.cucumber.spring.contextconfig.BellyStepDefinitions in project cucumber-jvm by cucumber.
the class SpringFactoryTest method shouldGiveUsNewStepInstancesForEachScenario.
@Test
void shouldGiveUsNewStepInstancesForEachScenario() {
final ObjectFactory factory = new SpringFactory();
factory.addClass(BellyStepDefinitions.class);
// Scenario 1
factory.start();
final BellyStepDefinitions o1 = factory.getInstance(BellyStepDefinitions.class);
factory.stop();
// Scenario 2
factory.start();
final BellyStepDefinitions o2 = factory.getInstance(BellyStepDefinitions.class);
factory.stop();
assertAll(() -> assertThat(o1, is(notNullValue())), () -> assertThat(o2, is(notNullValue())), () -> assertThat(o1, is(not(equalTo(o2)))), () -> assertThat(o2, is(not(equalTo(o1)))));
}
Aggregations