@Test void getListShouldReturnEmptyListWhenKeyNotFound() throws Exception { assertThat(testee.getConfiguration("a").getList("notExistKey")) .isEmpty(); }
public Configuration getConfiguration(String fileName) throws FileNotFoundException, ConfigurationException { Preconditions.checkArgument(!Strings.isNullOrEmpty(fileName)); File file = getConfigurationFile(fileName) .orElseThrow(() -> new FileNotFoundException(fileName)); return getConfiguration(file); }
PropertiesProvider { public Configuration getConfiguration(String fileName) throws FileNotFoundException, ConfigurationException { Preconditions.checkArgument(!Strings.isNullOrEmpty(fileName)); File file = getConfigurationFile(fileName) .orElseThrow(() -> new FileNotFoundException(fileName)); return getConfiguration(file); } }
PropertiesProvider { public Configuration getConfiguration(String fileName) throws FileNotFoundException, ConfigurationException { Preconditions.checkArgument(!Strings.isNullOrEmpty(fileName)); File file = getConfigurationFile(fileName) .orElseThrow(() -> new FileNotFoundException(fileName)); return getConfiguration(file); } @Inject  PropertiesProvider(FileSystem fileSystem, ConfigurationPath configurationPrefix); }
PropertiesProvider { public Configuration getConfiguration(String fileName) throws FileNotFoundException, ConfigurationException { Preconditions.checkArgument(!Strings.isNullOrEmpty(fileName)); File file = getConfigurationFile(fileName) .orElseThrow(() -> new FileNotFoundException(fileName)); return getConfiguration(file); } @Inject  PropertiesProvider(FileSystem fileSystem, ConfigurationPath configurationPrefix); Configuration getConfigurations(String... filenames); Configuration getConfiguration(String fileName); }
PropertiesProvider { public Configuration getConfiguration(String fileName) throws FileNotFoundException, ConfigurationException { Preconditions.checkArgument(!Strings.isNullOrEmpty(fileName)); File file = getConfigurationFile(fileName) .orElseThrow(() -> new FileNotFoundException(fileName)); return getConfiguration(file); } @Inject  PropertiesProvider(FileSystem fileSystem, ConfigurationPath configurationPrefix); Configuration getConfigurations(String... filenames); Configuration getConfiguration(String fileName);  }