Eliminate use of environment variables
[yangtools.git] / yang / yang-maven-plugin-it / src / test / java / org / opendaylight / yangtools / yang2sources / plugin / it / YangToSourcesPluginTestIT.java
index 770e32781228aed569418229b1360b12396b861b..9ade2fdc6e4e5320281f452bc0c41b8dd13fc5ca 100644 (file)
@@ -28,16 +28,6 @@ import org.junit.Test;
 
 public class YangToSourcesPluginTestIT {
 
-    private static String GLOBAL_SETTINGS_OVERRIDE;
-    private static String USER_SETTINGS_OVERRIDE;
-
-    @BeforeClass
-    public static void setupClass() {
-        // OpenDaylight Jenkins does not have settings at the default path, pick file locations from environment
-        GLOBAL_SETTINGS_OVERRIDE = System.getenv("GLOBAL_SETTINGS_FILE");
-        USER_SETTINGS_OVERRIDE = System.getenv("SETTINGS_FILE");
-    }
-
     // TODO Test yang files in transitive dependencies
 
     @Test
@@ -132,16 +122,11 @@ public class YangToSourcesPluginTestIT {
         if (ignoreF) {
             verifier.addCliOption("-fn");
         }
-        if (GLOBAL_SETTINGS_OVERRIDE != null) {
-            verifier.addCliOption("-gs");
-            verifier.addCliOption(GLOBAL_SETTINGS_OVERRIDE);
-        } else if (getEffectiveSettingsXML().isPresent()) {
+
+               final Optional<String> maybeSettings = getEffectiveSettingsXML();
+               if (maybeSettings.isPresent()) {
             verifier.addCliOption("-gs");
-            verifier.addCliOption(getEffectiveSettingsXML().get());
-        }
-        if (USER_SETTINGS_OVERRIDE != null) {
-            verifier.addCliOption("-s");
-            verifier.addCliOption(USER_SETTINGS_OVERRIDE);
+            verifier.addCliOption(maybeSettings.get());
         }
         verifier.setMavenDebug(true);
         verifier.executeGoal("generate-sources");