@Test public void override() { Properties props = new Properties(); props.setProperty("iep.test.which-config", "dynamic"); props.setProperty("a", "foo"); props.setProperty("netflix.iep.override", "iep.test.which-config=override\nb=[1]"); DynamicConfigService service = newService(); service.updateDynamicConfig(props); Assert.assertFalse(manager.get().hasPath("netflix.iep.override")); Assert.assertEquals("override", manager.get().getString("iep.test.which-config")); Assert.assertEquals("foo", manager.get().getString("a")); Assert.assertEquals(Collections.singletonList(1), manager.get().getIntList("b")); }
void updateDynamicConfig(Properties props) { final String overrideKey = "netflix.iep.override"; if (props.containsKey(overrideKey)) { Config override = ConfigFactory.parseString(props.getProperty(overrideKey)); props.remove(overrideKey); Config config = override.withFallback(ConfigFactory.parseProperties(props)); ConfigManager.dynamicConfigManager().setOverrideConfig(config); } else { Config config = ConfigFactory.parseProperties(props); ConfigManager.dynamicConfigManager().setOverrideConfig(config); } }
DynamicConfigService extends AbstractService { void updateDynamicConfig(Properties props) { final String overrideKey = "netflix.iep.override"; if (props.containsKey(overrideKey)) { Config override = ConfigFactory.parseString(props.getProperty(overrideKey)); props.remove(overrideKey); Config config = override.withFallback(ConfigFactory.parseProperties(props)); ConfigManager.dynamicConfigManager().setOverrideConfig(config); } else { Config config = ConfigFactory.parseProperties(props); ConfigManager.dynamicConfigManager().setOverrideConfig(config); } } }
DynamicConfigService extends AbstractService { void updateDynamicConfig(Properties props) { final String overrideKey = "netflix.iep.override"; if (props.containsKey(overrideKey)) { Config override = ConfigFactory.parseString(props.getProperty(overrideKey)); props.remove(overrideKey); Config config = override.withFallback(ConfigFactory.parseProperties(props)); ConfigManager.dynamicConfigManager().setOverrideConfig(config); } else { Config config = ConfigFactory.parseProperties(props); ConfigManager.dynamicConfigManager().setOverrideConfig(config); } } @Inject  DynamicConfigService(Registry registry, Config config); }
DynamicConfigService extends AbstractService { void updateDynamicConfig(Properties props) { final String overrideKey = "netflix.iep.override"; if (props.containsKey(overrideKey)) { Config override = ConfigFactory.parseString(props.getProperty(overrideKey)); props.remove(overrideKey); Config config = override.withFallback(ConfigFactory.parseProperties(props)); ConfigManager.dynamicConfigManager().setOverrideConfig(config); } else { Config config = ConfigFactory.parseProperties(props); ConfigManager.dynamicConfigManager().setOverrideConfig(config); } } @Inject  DynamicConfigService(Registry registry, Config config);  }
DynamicConfigService extends AbstractService { void updateDynamicConfig(Properties props) { final String overrideKey = "netflix.iep.override"; if (props.containsKey(overrideKey)) { Config override = ConfigFactory.parseString(props.getProperty(overrideKey)); props.remove(overrideKey); Config config = override.withFallback(ConfigFactory.parseProperties(props)); ConfigManager.dynamicConfigManager().setOverrideConfig(config); } else { Config config = ConfigFactory.parseProperties(props); ConfigManager.dynamicConfigManager().setOverrideConfig(config); } } @Inject  DynamicConfigService(Registry registry, Config config);   }