use of com.netflix.archaius.api.config.SettableConfig in project iep by Netflix.
the class PlatformServiceModuleTest method runtime.
@Test
public void runtime() {
Key<SettableConfig> key = Key.get(SettableConfig.class, RuntimeLayer.class);
Injector injector = Guice.createInjector(testModule);
SettableConfig c1 = injector.getInstance(key);
SettableConfig c2 = injector.getInstance(key);
Assert.assertSame(c1, c2);
}
use of com.netflix.archaius.api.config.SettableConfig in project iep by Netflix.
the class ArchaiusModuleTest method getValueRuntime.
@Test
public void getValueRuntime() {
Key<SettableConfig> key = Key.get(SettableConfig.class, RuntimeLayer.class);
Injector injector = Guice.createInjector(testModule);
SettableConfig runtime = injector.getInstance(key);
Configuration root = injector.getInstance(IEP_CONFIG);
Assert.assertEquals("b", root.getString("a"));
Assert.assertEquals("dynamic", root.getString("c"));
runtime.setProperty("a", "runtime");
runtime.setProperty("c", "runtime");
Assert.assertEquals("runtime", root.getString("a"));
Assert.assertEquals("runtime", root.getString("c"));
runtime.clearProperty("a");
Assert.assertEquals("b", root.getString("a"));
Assert.assertEquals("runtime", root.getString("c"));
}
use of com.netflix.archaius.api.config.SettableConfig in project iep by Netflix.
the class PlatformServiceModuleTest method getValueRuntime.
@Test
public void getValueRuntime() {
Key<SettableConfig> key = Key.get(SettableConfig.class, RuntimeLayer.class);
Injector injector = Guice.createInjector(testModule);
SettableConfig runtime = injector.getInstance(key);
Config root = injector.getInstance(Config.class);
Assert.assertEquals("b", root.getString("a"));
Assert.assertEquals("dynamic", root.getString("c"));
runtime.setProperty("a", "runtime");
runtime.setProperty("c", "runtime");
Assert.assertEquals("runtime", root.getString("a"));
Assert.assertEquals("runtime", root.getString("c"));
runtime.clearProperty("a");
Assert.assertEquals("b", root.getString("a"));
Assert.assertEquals("runtime", root.getString("c"));
}
Aggregations