Commit ebb10cb3 authored by Greg Messner's avatar Greg Messner
Browse files

Now supports special chars in the test properties file.

No related merge requests found
Showing with 3 additions and 3 deletions
+3 -3
...@@ -3,7 +3,7 @@ package org.gitlab4j.api; ...@@ -3,7 +3,7 @@ package org.gitlab4j.api;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStreamReader;
import java.util.Properties; import java.util.Properties;
public class HelperUtils { public class HelperUtils {
...@@ -25,7 +25,7 @@ public class HelperUtils { ...@@ -25,7 +25,7 @@ public class HelperUtils {
// Load the base test properties from "src/test/resources/test-gitlab4j.properties" // Load the base test properties from "src/test/resources/test-gitlab4j.properties"
File propertiesFile = new File(basedir, "src/test/resources/test-gitlab4j.properties"); File propertiesFile = new File(basedir, "src/test/resources/test-gitlab4j.properties");
if (propertiesFile.exists()) { if (propertiesFile.exists()) {
try (InputStream input = new FileInputStream(propertiesFile)) { try (InputStreamReader input = new InputStreamReader(new FileInputStream(propertiesFile))) {
testProperties.load(input); testProperties.load(input);
System.out.format("Loaded base test properties from: %n%s%n", propertiesFile.getAbsolutePath()); System.out.format("Loaded base test properties from: %n%s%n", propertiesFile.getAbsolutePath());
propertiesLoaded = true; propertiesLoaded = true;
...@@ -37,7 +37,7 @@ public class HelperUtils { ...@@ -37,7 +37,7 @@ public class HelperUtils {
// Now load the overriding test properties if found in the user's home directory // Now load the overriding test properties if found in the user's home directory
propertiesFile = new File((String) System.getProperties().get("user.home"), "test-gitlab4j.properties"); propertiesFile = new File((String) System.getProperties().get("user.home"), "test-gitlab4j.properties");
if (propertiesFile.exists()) { if (propertiesFile.exists()) {
try (InputStream input = new FileInputStream(propertiesFile)) { try (InputStreamReader input = new InputStreamReader(new FileInputStream(propertiesFile))) {
testProperties.load(input); testProperties.load(input);
System.out.format("Loaded overriding test properties from: %n%s%n", propertiesFile.getAbsolutePath()); System.out.format("Loaded overriding test properties from: %n%s%n", propertiesFile.getAbsolutePath());
propertiesLoaded = true; propertiesLoaded = true;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment