PropertyAccessorFileUtilities { public String getPropertyFileLocation() { return propertyFileDirAbsolutePath; } PropertyAccessorFileUtilities(); String getPropertyFileLocation(); String getPropertyFileLocation(String propertyFile); void setPropertyFileLocation(String propertyFileDirAbsolutePath); String getPropertyFileURL(); Properties loadPropertyFile(String propertyFilename); Properties loadPropertyFile(File propertyFile);  }
@Test public void testGetPropertyFileLocation() { PropertyAccessorFileUtilities fileUtilities = createPropertyAccessorFileUtilities(); String fileDir = fileUtilities.getPropertyFileLocation(); assertTrue(fileDir.endsWith(File.separator)); assertEquals(EXPECTED_PROPERTY_FILE_LOCATION, fileDir); }
@Test public void testGetPropertyFileLocation_WithFileName() { PropertyAccessorFileUtilities fileUtilities = createPropertyAccessorFileUtilities(); String fileLocation = fileUtilities.getPropertyFileLocation("gateway"); assertEquals(EXPECTED_PROPERTY_FILE_LOCATION + "gateway.properties", fileLocation); }
@Test public void testNoSystemVariableSet() { System.clearProperty("nhinc.properties.dir"); PropertyAccessorFileUtilities fileUtilities = new PropertyAccessorFileUtilities(); assertEquals("", fileUtilities.getPropertyFileLocation()); }