ConfigManager extends ConfigLoader<D> { @Override public D loadConfig(Map<?, ?> props) throws InvalidConfigException { D newConfig = super.loadConfig(props); return setNewConfig(newConfig); } ConfigManager(String propPrefix, ConfigBuilder<D> dynConfigBuilder); @Override D loadConfig(Map<?, ?> props); @Override D setSetting(String settingName, Object value); @Override D loadConfigFromJson(Reader jsonReader); D getReadOnlyConfig(); D setNewConfig(D newConfig); final static String MODULE; final static Logger LOG; }
@Test(expectedExceptions=InvalidConfigException.class) public void testInvalidNestedProperty1() throws InvalidConfigException { Properties props = new Properties(); props.setProperty("com.linkedin.databus2.nestedConfig.inSetting", "1"); _configManager.loadConfig(props); }
@Test(expectedExceptions=InvalidConfigException.class) public void testInvalidNestedProperty2() throws InvalidConfigException { Properties props = new Properties(); props.setProperty("com.linkedin.databus2.nestdConfig.stringSetting", "1"); _configManager.loadConfig(props); }
@Test(expectedExceptions=InvalidConfigException.class) public void testInvalidNestedProperty3() throws InvalidConfigException { Properties props = new Properties(); props.setProperty("com.linkedin.databus2.lstConfig[1].stringSetting", "1"); _configManager.loadConfig(props); }
@Test(expectedExceptions=InvalidConfigException.class) public void testInvalidNestedProperty4() throws InvalidConfigException { Properties props = new Properties(); props.setProperty("com.linkedin.databus2.listSetting[1].inSetting", "1"); _configManager.loadConfig(props); }
@Test public void testIgnoreSetting() throws InvalidConfigException { Properties props = new Properties(); props.setProperty("com.linkedin.databs2.listSetting[1].stringSetting", "1"); _configManager.loadConfig(props); }