ConfigManager extends ConfigLoader<D> { @Override public D setSetting(String settingName, Object value) throws InvalidConfigException { D newConfig = super.setSetting(settingName, value); 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 testInvalidSimpleProperty() throws InvalidConfigException { _configManager.setSetting("com.linkedin.databus2.inSetting", 3); }
@Test public void testStringPropertyTrimming() throws Exception { DynamicConfig config = _configManager.setSetting("com.linkedin.databus2.nestedConfig.stringSetting", " text to trim "); assertEquals("trimmed value", "text to trim", config.getNestedConfig().getStringSetting()); }