@Test public void testGetPropertyNamesWithNullProp() { when(configRepository.getConfig()).thenReturn(null); DefaultConfig defaultConfig = new DefaultConfig(someNamespace, configRepository); Set<String> propertyNames = defaultConfig.getPropertyNames(); assertEquals(Collections.emptySet(), propertyNames); }
@Override public Set<String> getPropertyNames() { Properties properties = m_configProperties.get(); if (properties == null) { return Collections.emptySet(); } return stringPropertyNames(properties); }
DefaultConfig extends AbstractConfig implements RepositoryChangeListener { @Override public Set<String> getPropertyNames() { Properties properties = m_configProperties.get(); if (properties == null) { return Collections.emptySet(); } return stringPropertyNames(properties); } }
DefaultConfig extends AbstractConfig implements RepositoryChangeListener { @Override public Set<String> getPropertyNames() { Properties properties = m_configProperties.get(); if (properties == null) { return Collections.emptySet(); } return stringPropertyNames(properties); } DefaultConfig(String namespace, ConfigRepository configRepository); }
DefaultConfig extends AbstractConfig implements RepositoryChangeListener { @Override public Set<String> getPropertyNames() { Properties properties = m_configProperties.get(); if (properties == null) { return Collections.emptySet(); } return stringPropertyNames(properties); } DefaultConfig(String namespace, ConfigRepository configRepository); @Override String getProperty(String key, String defaultValue); @Override Set<String> getPropertyNames(); @Override ConfigSourceType getSourceType(); @Override synchronized void onRepositoryChange(String namespace, Properties newProperties); }
DefaultConfig extends AbstractConfig implements RepositoryChangeListener { @Override public Set<String> getPropertyNames() { Properties properties = m_configProperties.get(); if (properties == null) { return Collections.emptySet(); } return stringPropertyNames(properties); } DefaultConfig(String namespace, ConfigRepository configRepository); @Override String getProperty(String key, String defaultValue); @Override Set<String> getPropertyNames(); @Override ConfigSourceType getSourceType(); @Override synchronized void onRepositoryChange(String namespace, Properties newProperties);  }