AFAICT, there's not much difference between using cucumber-glue
scope and instantiating member variables in step classes other than where the instantiation code resides.
For example, using cucumber-glue
scope:
@Configuration
public class MyConfiguration {
@Bean
@Scope("cucumber-glue")
public MyContext myContext() {
return new MyContext();
}
}
@SpringBootTest
public class MySteps {
@Autowired
private MyContext myContext;
}
versus member variables:
@SpringBootTest
public class MySteps {
private final MyContext myContext = new MyContext();
}
Are there other differences I'm missing?