Merge pull request #683 from hapifhir/normalized-java-home-tests

Fix JAVA_HOME tests with trailing slashes
This commit is contained in:
dotasek 2021-12-06 18:27:19 -05:00 committed by GitHub
commit 2b4f3f3d18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -0,0 +1,2 @@
Other changes:
* Fix trailing slashes for JAVA_HOME tests

View File

@ -22,17 +22,20 @@ class UtilitiesTest {
public static final String TEST_TXT = "test.txt";
private static final String getNormalizedJavaHomeDir() {
return System.getenv("JAVA_HOME") == null ? null : Paths.get(System.getenv("JAVA_HOME")).normalize().toString();
}
public static final String LINUX_TEMP_DIR = "/tmp/";
public static final String LINUX_USER_DIR = System.getProperty("user.home") + "/";
public static final String LINUX_JAVA_HOME = System.getenv("JAVA_HOME") + "/";
public static final String LINUX_JAVA_HOME = getNormalizedJavaHomeDir() + "/";
public static final String WIN_TEMP_DIR = "c:\\temp\\";
public static final String WIN_USER_DIR = System.getProperty("user.home") + "\\";
public static final String WIN_JAVA_HOME = System.getenv("JAVA_HOME") + "\\";
public static final String WIN_JAVA_HOME = getNormalizedJavaHomeDir() + "\\";
public static final String OSX_USER_DIR = System.getProperty("user.home") + "/";
public static final String OSX_JAVA_HOME = System.getenv("JAVA_HOME") == null ? null : Paths.get(System.getenv("JAVA_HOME")).normalize().toString() + "/";
public static final String OSX_JAVA_HOME = getNormalizedJavaHomeDir() + "/";
@Test
@DisplayName("Test Utilities.path maps temp directory correctly")
public void testTempDirPath() throws IOException {