@Test public void testWhenHasContent() throws Exception { Properties someProperties = new Properties(); String key = ConfigConsts.CONFIG_FILE_CONTENT_KEY; String someContent = "someKey: 'someValue'"; someProperties.setProperty(key, someContent); someSourceType = ConfigSourceType.LOCAL; Properties yamlProperties = new Properties(); yamlProperties.setProperty("someKey", "someValue"); when(configRepository.getConfig()).thenReturn(someProperties); when(configRepository.getSourceType()).thenReturn(someSourceType); when(yamlParser.yamlToProperties(someContent)).thenReturn(yamlProperties); YamlConfigFile configFile = new YamlConfigFile(someNamespace, configRepository); assertSame(someContent, configFile.getContent()); assertSame(yamlProperties, configFile.asProperties()); }
@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();  }