Skip to content

Commit bd0bf8f

Browse files
committed
Now looks for properties file in home dir first and then project dir (#311).
1 parent a62fa83 commit bd0bf8f

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/test/java/org/gitlab4j/api/HelperUtils.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,17 @@ public class HelperUtils {
1111
private static Properties testProperties;
1212
static {
1313

14-
// Get the maven basedir, we use it to locate the properties for the unit tests
15-
String basedir = (String) System.getProperties().get("basedir");
16-
17-
// If we are performing a release in target/checkout, trim off the target/checkout directory from basedir
18-
if (basedir != null && (basedir.endsWith("target/checkout") || basedir.endsWith("target\\checkout"))) {
19-
basedir = basedir.substring(0, basedir.length() - 15);
20-
}
21-
2214
File propertiesFile = new File((String) System.getProperties().get("user.home"), "test-gitlab4j.properties");
2315
if (!propertiesFile.exists()) {
16+
17+
// Get the maven basedir, we use it to locate the properties for the unit tests
18+
String basedir = (String) System.getProperties().get("basedir");
19+
20+
// If we are performing a release in target/checkout, trim off the target/checkout directory from basedir
21+
if (basedir != null && (basedir.endsWith("target/checkout") || basedir.endsWith("target\\checkout"))) {
22+
basedir = basedir.substring(0, basedir.length() - 15);
23+
}
24+
2425
propertiesFile = new File(basedir, "src/test/gitlab/test-gitlab4j.properties");
2526
}
2627

0 commit comments

Comments
 (0)