|
|
@@ -37,6 +37,7 @@ import org.apache.commons.lang.SystemUtils; |
|
|
|
import org.junit.Before; |
|
|
|
import org.junit.Rule; |
|
|
|
import org.junit.Test; |
|
|
|
import org.junit.rules.ExpectedException; |
|
|
|
import org.junit.rules.TemporaryFolder; |
|
|
|
|
|
|
|
public class ConfTest { |
|
|
@@ -44,6 +45,9 @@ public class ConfTest { |
|
|
|
@Rule |
|
|
|
public TemporaryFolder temp = new TemporaryFolder(); |
|
|
|
|
|
|
|
@Rule |
|
|
|
public ExpectedException exception = ExpectedException.none(); |
|
|
|
|
|
|
|
Map<String, String> env = new HashMap<>(); |
|
|
|
Properties args = new Properties(); |
|
|
|
Logs logs = new Logs(System.out, System.err); |
|
|
@@ -131,6 +135,14 @@ public class ConfTest { |
|
|
|
assertThat(props.getProperty("sonar.key2")).isEqualTo("v3"); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void shouldFailWithInvalidEnvironmentProperties() throws IOException { |
|
|
|
env.put("SONARQUBE_SCANNER_PARAMS", "{sonar.key1: \"v1\", \"sonar.key2\" : \"v2\"}"); |
|
|
|
exception.expect(IllegalStateException.class); |
|
|
|
exception.expectMessage("JSON"); |
|
|
|
conf.properties(); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void shouldSupportDeepModuleConfigurationInRoot() throws Exception { |
|
|
|
Path projectHome = Paths.get(getClass().getResource("ConfTest/shouldSupportDeepModuleConfigurationInRoot/project").toURI()); |