From f5d7b41d9bb0a4e6db975cf4d3dc4bc7bb498339 Mon Sep 17 00:00:00 2001 From: Duarte Meneses Date: Thu, 4 Jun 2015 14:19:33 +0200 Subject: fix test when SONAR_USER_HOME env var is set --- .../src/test/java/org/sonar/home/cache/PersistentCacheBuilderTest.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sonar-home/src/test') diff --git a/sonar-home/src/test/java/org/sonar/home/cache/PersistentCacheBuilderTest.java b/sonar-home/src/test/java/org/sonar/home/cache/PersistentCacheBuilderTest.java index 027e2d68924..33418cd75ca 100644 --- a/sonar-home/src/test/java/org/sonar/home/cache/PersistentCacheBuilderTest.java +++ b/sonar-home/src/test/java/org/sonar/home/cache/PersistentCacheBuilderTest.java @@ -20,6 +20,7 @@ package org.sonar.home.cache; import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assume.*; import java.nio.file.Files; @@ -50,6 +51,8 @@ public class PersistentCacheBuilderTest { @Test public void read_system_env() { + assumeTrue(System.getenv("SONAR_USER_HOME") == null); + System.setProperty("user.home", temp.getRoot().getAbsolutePath()); PersistentCache cache = new PersistentCacheBuilder().build(); -- cgit v1.2.3