@Test public void testWhenConfigRepositoryHasError() throws Exception { when(configRepository.getConfig()).thenThrow(new RuntimeException("someError")); YamlConfigFile configFile = new YamlConfigFile(someNamespace, configRepository); assertFalse(configFile.hasContent()); assertNull(configFile.getContent()); assertEquals(ConfigSourceType.NONE, configFile.getSourceType()); Properties properties = configFile.asProperties(); assertTrue(properties.isEmpty()); }
@Override public Properties asProperties() { if (cachedProperties == null) { transformToProperties(); } return cachedProperties; }
YamlConfigFile extends PlainTextConfigFile implements PropertiesCompatibleConfigFile { @Override public Properties asProperties() { if (cachedProperties == null) { transformToProperties(); } return cachedProperties; } }
YamlConfigFile extends PlainTextConfigFile implements PropertiesCompatibleConfigFile { @Override public Properties asProperties() { if (cachedProperties == null) { transformToProperties(); } return cachedProperties; } YamlConfigFile(String namespace, ConfigRepository configRepository); }
YamlConfigFile extends PlainTextConfigFile implements PropertiesCompatibleConfigFile { @Override public Properties asProperties() { if (cachedProperties == null) { transformToProperties(); } return cachedProperties; } YamlConfigFile(String namespace, ConfigRepository configRepository); @Override ConfigFileFormat getConfigFileFormat(); @Override Properties asProperties(); }
YamlConfigFile extends PlainTextConfigFile implements PropertiesCompatibleConfigFile { @Override public Properties asProperties() { if (cachedProperties == null) { transformToProperties(); } return cachedProperties; } YamlConfigFile(String namespace, ConfigRepository configRepository); @Override ConfigFileFormat getConfigFileFormat(); @Override Properties asProperties();  }