diff --git a/maven-projects/info/src/test/java/org/apache/graphar/info/TestUtil.java b/maven-projects/info/src/test/java/org/apache/graphar/info/TestUtil.java index e1ebf6f68..c50dd564e 100644 --- a/maven-projects/info/src/test/java/org/apache/graphar/info/TestUtil.java +++ b/maven-projects/info/src/test/java/org/apache/graphar/info/TestUtil.java @@ -94,16 +94,14 @@ public static void checkTestData() { // Always try to find test data freshly to avoid stale cached values String testDataPath = null; - // 1. First try environment variable GAR_TEST_DATA + // Try environment variable GAR_TEST_DATA or system property testDataPath = System.getenv("GAR_TEST_DATA"); - - // 2. Try system property (for custom paths) - if (testDataPath == null) { + if (testDataPath == null || testDataPath.isEmpty()) { testDataPath = System.getProperty("gar.test.data"); } - // 3. Default to project root testing directory - if (testDataPath == null) { + // Default to project root testing directory if nothing is set + if (testDataPath == null || testDataPath.isEmpty()) { String[] possiblePaths = { "../../testing", // from info module to project root "../testing", // from maven-projects to project root