Skip to content

Commit e8600fb

Browse files
committed
Initialize StaticApplicationContext in SpringFactory
StaticApplicationContext would throw an Exception due to a missing initialization step in SpringFactory's constructor. Calling stepDefContext.refresh() fixes the problem.
1 parent 93475e4 commit e8600fb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

spring/src/main/java/cucumber/runtime/java/spring/SpringFactory.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public class SpringFactory implements ObjectFactory {
1717

1818
public SpringFactory() {
1919
stepDefContext = new StaticApplicationContext();
20+
stepDefContext.refresh();
2021
appContext = new ClassPathXmlApplicationContext(new String[]{"context.xml"}, stepDefContext);
2122
}
2223

0 commit comments

Comments
 (0)