File tree Expand file tree Collapse file tree 1 file changed +1
-6
lines changed
src/test/java/org/soujava/demos/mongodb/config Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Original file line number Diff line number Diff line change 44import org .jboss .weld .environment .se .Weld ;
55import org .jboss .weld .environment .se .WeldContainer ;
66
7- import java .util .HashMap ;
8- import java .util .Map ;
9-
107public class WeldCucumberObjectFactory implements ObjectFactory {
118
129 private Weld weld ;
1310 private WeldContainer container ;
14- private final Map <Class <?>, Object > instances = new HashMap <>();
1511
1612 @ Override
1713 public void start () {
@@ -24,7 +20,6 @@ public void stop() {
2420 if (weld != null ) {
2521 weld .shutdown ();
2622 }
27- instances .clear ();
2823 }
2924
3025 @ Override
@@ -34,6 +29,6 @@ public boolean addClass(Class<?> stepClass) {
3429
3530 @ Override
3631 public <T > T getInstance (Class <T > type ) {
37- return (T ) instances . computeIfAbsent ( type , c -> container .select (type ).get () );
32+ return (T ) container .select (type ).get ();
3833 }
3934}
You can’t perform that action at this time.
0 commit comments