@Test public void invalidStream() throws Exception { InputStream input = mock(InputStream.class); when(input.read(any())).thenThrow(new IOException()); assertThatThrownBy(() -> loader.load(input)).isInstanceOf(IOException.class); }
@Override public Configuration load(File file) throws FileNotFoundException { if (!file.exists()) { throw new FileNotFoundException("The given file does not exist"); } return new LightbendConfiguration(ConfigFactory.parseFile(file)); }
LightbendConfigurationLoader implements ConfigurationLoader { @Override public Configuration load(File file) throws FileNotFoundException { if (!file.exists()) { throw new FileNotFoundException("The given file does not exist"); } return new LightbendConfiguration(ConfigFactory.parseFile(file)); } }
LightbendConfigurationLoader implements ConfigurationLoader { @Override public Configuration load(File file) throws FileNotFoundException { if (!file.exists()) { throw new FileNotFoundException("The given file does not exist"); } return new LightbendConfiguration(ConfigFactory.parseFile(file)); }  }
LightbendConfigurationLoader implements ConfigurationLoader { @Override public Configuration load(File file) throws FileNotFoundException { if (!file.exists()) { throw new FileNotFoundException("The given file does not exist"); } return new LightbendConfiguration(ConfigFactory.parseFile(file)); }  @Override Configuration load(File file); @Override Configuration load(InputStream input); }
LightbendConfigurationLoader implements ConfigurationLoader { @Override public Configuration load(File file) throws FileNotFoundException { if (!file.exists()) { throw new FileNotFoundException("The given file does not exist"); } return new LightbendConfiguration(ConfigFactory.parseFile(file)); }  @Override Configuration load(File file); @Override Configuration load(InputStream input);  }