io.mstream.trader.commons.test.guice.AbstractTestInjector Maven / Gradle / Ivy
package io.mstream.trader.commons.test.guice;
import com.google.inject.Injector;
import com.google.inject.Module;
import com.google.inject.Stage;
import cucumber.api.guice.CucumberModules;
import cucumber.runtime.java.guice.InjectorSource;
import static com.google.inject.Guice.createInjector;
public abstract class AbstractTestInjector implements InjectorSource {
private final Module testModule;
protected AbstractTestInjector(Module testModule) {
this.testModule = testModule;
}
@Override
public Injector getInjector() {
return createInjector(
Stage.PRODUCTION,
CucumberModules.SCENARIO,
new CommonsModule(),
testModule
);
}
}