@Test public void overrideSubstitution() { Properties props = new Properties(); props.setProperty("netflix.iep.override", "value=${includes.a}\"_\"${includes.b}"); DynamicConfigService service = newService(); service.updateDynamicConfig(props); Assert.assertEquals("abc_def:foo", manager.get().getString("value")); }
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);   }