@Test(expectedExceptions = PropertiesNotAvailableException.class) public void testLoadPropertiesWhenFileNotFoundShouldThrowException() throws Exception { given(inputStreamFactory.createFileInputStream(configFile)).willThrow(new FileNotFoundException()); underTest.loadProperties(); }
public void loadProperties() { properties = propertiesFactory.createProperties(); try { checkPropertyFileArgument(configFile); loadExternalProperties(configFile, properties); propertyReader.setProperties(properties); logger.debug("Properties loaded from external configuration."); } catch (IOException e) { throw new PropertiesNotAvailableException("Configuration file " + configFile + " cannot be loaded", e); } }
PropertyLoader { public void loadProperties() { properties = propertiesFactory.createProperties(); try { checkPropertyFileArgument(configFile); loadExternalProperties(configFile, properties); propertyReader.setProperties(properties); logger.debug("Properties loaded from external configuration."); } catch (IOException e) { throw new PropertiesNotAvailableException("Configuration file " + configFile + " cannot be loaded", e); } } }
PropertyLoader { public void loadProperties() { properties = propertiesFactory.createProperties(); try { checkPropertyFileArgument(configFile); loadExternalProperties(configFile, properties); propertyReader.setProperties(properties); logger.debug("Properties loaded from external configuration."); } catch (IOException e) { throw new PropertiesNotAvailableException("Configuration file " + configFile + " cannot be loaded", e); } }  }
PropertyLoader { public void loadProperties() { properties = propertiesFactory.createProperties(); try { checkPropertyFileArgument(configFile); loadExternalProperties(configFile, properties); propertyReader.setProperties(properties); logger.debug("Properties loaded from external configuration."); } catch (IOException e) { throw new PropertiesNotAvailableException("Configuration file " + configFile + " cannot be loaded", e); } }  void loadProperties(); void loadValidationProperties(); }
PropertyLoader { public void loadProperties() { properties = propertiesFactory.createProperties(); try { checkPropertyFileArgument(configFile); loadExternalProperties(configFile, properties); propertyReader.setProperties(properties); logger.debug("Properties loaded from external configuration."); } catch (IOException e) { throw new PropertiesNotAvailableException("Configuration file " + configFile + " cannot be loaded", e); } }  void loadProperties(); void loadValidationProperties();  }