Search in sources :

Example 6 with GlobalSettings

use of org.sonar.scanner.bootstrap.GlobalSettings in project sonarqube by SonarSource.

the class ModuleSettingsTest method should_not_fail_when_accessing_secured_properties.

@Test
public void should_not_fail_when_accessing_secured_properties() {
    GlobalSettings globalSettings = newGlobalSettings(ImmutableMap.of("sonar.foo.secured", "bar"));
    ProjectRepositories projSettingsRepo = createSettings("struts-core", ImmutableMap.of("sonar.foo.license.secured", "bar2"));
    ProjectDefinition module = ProjectDefinition.create().setKey("struts-core");
    ModuleSettings moduleSettings = new ModuleSettings(globalSettings, module, projSettingsRepo, mode, mock(AnalysisContextReportPublisher.class));
    assertThat(moduleSettings.getString("sonar.foo.license.secured")).isEqualTo("bar2");
    assertThat(moduleSettings.getString("sonar.foo.secured")).isEqualTo("bar");
}
Also used : GlobalSettings(org.sonar.scanner.bootstrap.GlobalSettings) AnalysisContextReportPublisher(org.sonar.scanner.report.AnalysisContextReportPublisher) ProjectRepositories(org.sonar.scanner.repository.ProjectRepositories) ProjectDefinition(org.sonar.api.batch.bootstrap.ProjectDefinition) Test(org.junit.Test)

Aggregations

GlobalSettings (org.sonar.scanner.bootstrap.GlobalSettings)6 ProjectRepositories (org.sonar.scanner.repository.ProjectRepositories)5 Test (org.junit.Test)4 ProjectDefinition (org.sonar.api.batch.bootstrap.ProjectDefinition)4 AnalysisContextReportPublisher (org.sonar.scanner.report.AnalysisContextReportPublisher)4 Before (org.junit.Before)2 Properties (java.util.Properties)1 PropertyDefinitions (org.sonar.api.config.PropertyDefinitions)1 System2 (org.sonar.api.utils.System2)1 DefaultAnalysisMode (org.sonar.scanner.analysis.DefaultAnalysisMode)1 GlobalMode (org.sonar.scanner.bootstrap.GlobalMode)1 GlobalProperties (org.sonar.scanner.bootstrap.GlobalProperties)1