@Test(expectedExceptions = PropertiesNotAvailableException.class) public void testLoadPropertiesWhenProgramArgumentEmptyShouldThrowException() { Whitebox.setInternalState(underTest, "configFile", ""); underTest.loadProperties(); }
public Properties loadProperties(final String configFile) { Properties properties = new Properties(); try { checkPropertyFileArgument(configFile); InputStream inputStream = new FileInputStream(configFile); properties.load(inputStream); logger.debug("Properties loaded from external configuration."); } catch (IOException e) { throw new PropertiesNotAvailableException("Configuration file " + configFile + " cannot be loaded", e); } return properties; }
PropertyLoader { public Properties loadProperties(final String configFile) { Properties properties = new Properties(); try { checkPropertyFileArgument(configFile); InputStream inputStream = new FileInputStream(configFile); properties.load(inputStream); logger.debug("Properties loaded from external configuration."); } catch (IOException e) { throw new PropertiesNotAvailableException("Configuration file " + configFile + " cannot be loaded", e); } return properties; } }
PropertyLoader { public Properties loadProperties(final String configFile) { Properties properties = new Properties(); try { checkPropertyFileArgument(configFile); InputStream inputStream = new FileInputStream(configFile); properties.load(inputStream); logger.debug("Properties loaded from external configuration."); } catch (IOException e) { throw new PropertiesNotAvailableException("Configuration file " + configFile + " cannot be loaded", e); } return properties; }  }
PropertyLoader { public Properties loadProperties(final String configFile) { Properties properties = new Properties(); try { checkPropertyFileArgument(configFile); InputStream inputStream = new FileInputStream(configFile); properties.load(inputStream); logger.debug("Properties loaded from external configuration."); } catch (IOException e) { throw new PropertiesNotAvailableException("Configuration file " + configFile + " cannot be loaded", e); } return properties; }  Properties loadProperties(final String configFile); void loadProperties(); }
PropertyLoader { public Properties loadProperties(final String configFile) { Properties properties = new Properties(); try { checkPropertyFileArgument(configFile); InputStream inputStream = new FileInputStream(configFile); properties.load(inputStream); logger.debug("Properties loaded from external configuration."); } catch (IOException e) { throw new PropertiesNotAvailableException("Configuration file " + configFile + " cannot be loaded", e); } return properties; }  Properties loadProperties(final String configFile); void loadProperties();  }