Make test not fail when JENKINS_URL is set
@@ -9,6 +9,7 @@ import jenkins.security.ApiTokenProperty;
import jenkins.security.apitoken.ApiTokenTestHelper;
import org.apache.commons.io.FileUtils;
+import org.junit.Assume;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -25,6 +26,8 @@ import java.util.HashMap;
import java.util.Map;
import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertThat;
@@ -59,6 +62,7 @@ public class CLIEnvVarTest {
@Test
public void testWithoutSOptionAndWithoutJENKINS_URL() throws Exception {
+ Assume.assumeThat(System.getenv("JENKINS_URL"), is(nullValue())); // TODO instead remove it from the process env?
assertNotEquals(0, launch("java",
"-Duser.home=" + home,
"-jar", jar.getAbsolutePath(),
