use of se.jbee.inject.config.Globals in project silk by jbee.
the class TestExample1Binds method constructorArgumentsCanBePassedToBootstrappingUsingPresets.
@Test
public void constructorArgumentsCanBePassedToBootstrappingUsingPresets() {
Properties props = new Properties();
props.put("x", "abc");
props.put("y", 12);
Presets presets = Presets.EMPTY.preset(Properties.class, props);
Globals globals = Globals.STANDARD.presets(presets);
Injector injector = Bootstrap.injector(Example1Module1.class, globals);
MyClass obj = injector.resolve(Dependency.dependency(MyClass.class));
assertEquals(12, obj.twelve);
assertEquals("abc", obj.abc);
}
use of se.jbee.inject.config.Globals in project silk by jbee.
the class TestMultipleOptionChoicesBinds method thatMultipleOptionChoicesArePossible.
@Test
public void thatMultipleOptionChoicesArePossible() {
Options options = Options.STANDARD.chosen(Choices.A, Choices.D);
Globals globals = Globals.STANDARD.options(options);
Injector injector = Bootstrap.injector(RootBundle.class, globals);
assertEqualSets(new String[] { "A", "D" }, injector.resolve(dependency(String[].class)));
}