aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-engine/src/test/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-scanner-engine/src/test/java/org')
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/DefaultScannerWsClientTest.java10
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/GlobalConfigurationProviderTest.java4
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/GlobalTempFolderProviderTest.java12
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/PluginFilesTest.java2
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/ProcessedScannerPropertiesTest.java45
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/ScannerPropertiesTest.java65
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/ScannerWsClientProviderTest.java14
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/report/MetadataPublisherTest.java6
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ReportPublisherTest.java20
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/DefaultQualityProfileLoaderTest.java29
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/ProjectRepositoriesSupplierTest.java4
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/QualityProfileProviderTest.java4
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/settings/DefaultProjectSettingsLoaderTest.java4
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/ExternalProjectKeyAndOrganizationProviderTest.java93
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/ProjectReactorBuilderTest.java17
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/ScanPropertiesTest.java15
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/branch/ProjectBranchesProviderTest.java6
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/branch/ProjectPullRequestsProviderTest.java6
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/scm/ScmRevisionImplTest.java6
19 files changed, 117 insertions, 245 deletions
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/DefaultScannerWsClientTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/DefaultScannerWsClientTest.java
index 3578d8c4a65..e51054f190e 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/DefaultScannerWsClientTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/DefaultScannerWsClientTest.java
@@ -58,7 +58,7 @@ public class DefaultScannerWsClientTest {
logTester.setLevel(LoggerLevel.DEBUG);
DefaultScannerWsClient underTest = new DefaultScannerWsClient(wsClient, false, new GlobalAnalysisMode(
- new RawScannerProperties(Collections.emptyMap())));
+ new ScannerProperties(Collections.emptyMap())));
WsResponse result = underTest.call(request);
@@ -99,7 +99,7 @@ public class DefaultScannerWsClientTest {
WsResponse response = newResponse().setCode(401);
when(wsClient.wsConnector().call(request)).thenReturn(response);
- new DefaultScannerWsClient(wsClient, false, new GlobalAnalysisMode(new RawScannerProperties(Collections.emptyMap()))).call(request);
+ new DefaultScannerWsClient(wsClient, false, new GlobalAnalysisMode(new ScannerProperties(Collections.emptyMap()))).call(request);
}
@Test
@@ -111,7 +111,7 @@ public class DefaultScannerWsClientTest {
WsResponse response = newResponse().setCode(401);
when(wsClient.wsConnector().call(request)).thenReturn(response);
- new DefaultScannerWsClient(wsClient, /* credentials are configured */true, new GlobalAnalysisMode(new RawScannerProperties(Collections.emptyMap()))).call(request);
+ new DefaultScannerWsClient(wsClient, /* credentials are configured */true, new GlobalAnalysisMode(new ScannerProperties(Collections.emptyMap()))).call(request);
}
@Test
@@ -124,7 +124,7 @@ public class DefaultScannerWsClientTest {
.setCode(403);
when(wsClient.wsConnector().call(request)).thenReturn(response);
- new DefaultScannerWsClient(wsClient, true, new GlobalAnalysisMode(new RawScannerProperties(Collections.emptyMap()))).call(request);
+ new DefaultScannerWsClient(wsClient, true, new GlobalAnalysisMode(new ScannerProperties(Collections.emptyMap()))).call(request);
}
@Test
@@ -138,7 +138,7 @@ public class DefaultScannerWsClientTest {
.setContent("{\"errors\":[{\"msg\":\"Boo! bad request! bad!\"}]}");
when(wsClient.wsConnector().call(request)).thenReturn(response);
- new DefaultScannerWsClient(wsClient, true, new GlobalAnalysisMode(new RawScannerProperties(Collections.emptyMap()))).call(request);
+ new DefaultScannerWsClient(wsClient, true, new GlobalAnalysisMode(new ScannerProperties(Collections.emptyMap()))).call(request);
}
private MockWsResponse newResponse() {
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/GlobalConfigurationProviderTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/GlobalConfigurationProviderTest.java
index 2b57667e501..360c9138d50 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/GlobalConfigurationProviderTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/GlobalConfigurationProviderTest.java
@@ -41,12 +41,12 @@ public class GlobalConfigurationProviderTest {
public LogTester logTester = new LogTester();
GlobalServerSettings globalServerSettings;
- RawScannerProperties scannerProps;
+ ScannerProperties scannerProps;
@Before
public void prepare() {
globalServerSettings = mock(GlobalServerSettings.class);
- scannerProps = new RawScannerProperties(Collections.emptyMap());
+ scannerProps = new ScannerProperties(Collections.emptyMap());
}
@Test
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/GlobalTempFolderProviderTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/GlobalTempFolderProviderTest.java
index 3db5b63b450..652fedb8733 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/GlobalTempFolderProviderTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/GlobalTempFolderProviderTest.java
@@ -52,7 +52,7 @@ public class GlobalTempFolderProviderTest {
workingDir.delete();
TempFolder tempFolder = tempFolderProvider.provide(
- new RawScannerProperties(ImmutableMap.of(CoreProperties.GLOBAL_WORKING_DIRECTORY, workingDir.getAbsolutePath())));
+ new ScannerProperties(ImmutableMap.of(CoreProperties.GLOBAL_WORKING_DIRECTORY, workingDir.getAbsolutePath())));
tempFolder.newDir();
tempFolder.newFile();
assertThat(getCreatedTempDir(workingDir)).exists();
@@ -73,7 +73,7 @@ public class GlobalTempFolderProviderTest {
}
tempFolderProvider.provide(
- new RawScannerProperties(ImmutableMap.of(CoreProperties.GLOBAL_WORKING_DIRECTORY, workingDir.getAbsolutePath())));
+ new ScannerProperties(ImmutableMap.of(CoreProperties.GLOBAL_WORKING_DIRECTORY, workingDir.getAbsolutePath())));
// this also checks that all other temps were deleted
assertThat(getCreatedTempDir(workingDir)).exists();
@@ -87,7 +87,7 @@ public class GlobalTempFolderProviderTest {
File workingDir = new File(sonarHome, CoreProperties.GLOBAL_WORKING_DIRECTORY_DEFAULT_VALUE).getAbsoluteFile();
TempFolder tempFolder = tempFolderProvider.provide(
- new RawScannerProperties(ImmutableMap.of("sonar.userHome", sonarHome.getAbsolutePath())));
+ new ScannerProperties(ImmutableMap.of("sonar.userHome", sonarHome.getAbsolutePath())));
tempFolder.newDir();
tempFolder.newFile();
assertThat(getCreatedTempDir(workingDir)).exists();
@@ -110,7 +110,7 @@ public class GlobalTempFolderProviderTest {
File workingDir = new File(defaultSonarHome, CoreProperties.GLOBAL_WORKING_DIRECTORY_DEFAULT_VALUE).getAbsoluteFile();
try {
TempFolder tempFolder = tempFolderProvider.provide(
- new RawScannerProperties(Collections.emptyMap()));
+ new ScannerProperties(Collections.emptyMap()));
tempFolder.newDir();
tempFolder.newFile();
assertThat(getCreatedTempDir(workingDir)).exists();
@@ -124,7 +124,7 @@ public class GlobalTempFolderProviderTest {
public void dotWorkingDir() {
File sonarHome = temp.getRoot();
String globalWorkDir = ".";
- RawScannerProperties globalProperties = new RawScannerProperties(
+ ScannerProperties globalProperties = new ScannerProperties(
ImmutableMap.of("sonar.userHome", sonarHome.getAbsolutePath(), CoreProperties.GLOBAL_WORKING_DIRECTORY, globalWorkDir));
TempFolder tempFolder = tempFolderProvider.provide(globalProperties);
@@ -140,7 +140,7 @@ public class GlobalTempFolderProviderTest {
File symlink = temp.newFolder();
symlink.delete();
Files.createSymbolicLink(symlink.toPath(), realSonarHome.toPath());
- RawScannerProperties globalProperties = new RawScannerProperties(ImmutableMap.of("sonar.userHome", symlink.getAbsolutePath()));
+ ScannerProperties globalProperties = new ScannerProperties(ImmutableMap.of("sonar.userHome", symlink.getAbsolutePath()));
TempFolder tempFolder = tempFolderProvider.provide(globalProperties);
File newFile = tempFolder.newFile();
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/PluginFilesTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/PluginFilesTest.java
index dd6d43348bd..8bf01c1310b 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/PluginFilesTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/PluginFilesTest.java
@@ -73,7 +73,7 @@ public class PluginFilesTest {
@Before
public void setUp() throws Exception {
HttpConnector connector = HttpConnector.newBuilder().url(server.url("/").toString()).build();
- GlobalAnalysisMode analysisMode = new GlobalAnalysisMode(new RawScannerProperties(Collections.emptyMap()));
+ GlobalAnalysisMode analysisMode = new GlobalAnalysisMode(new ScannerProperties(Collections.emptyMap()));
DefaultScannerWsClient wsClient = new DefaultScannerWsClient(WsClientFactories.getDefault().newClient(connector), false, analysisMode);
userHome = temp.newFolder();
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/ProcessedScannerPropertiesTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/ProcessedScannerPropertiesTest.java
deleted file mode 100644
index c13d109b7ae..00000000000
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/ProcessedScannerPropertiesTest.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2020 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.scanner.bootstrap;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.junit.Test;
-import org.sonar.scanner.scan.EmptyExternalProjectKeyAndOrganization;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.entry;
-
-public class ProcessedScannerPropertiesTest {
- @Test
- public void test_copy_of_properties() {
- Map<String, String> map = new HashMap<>();
- map.put("foo", "bar");
-
- ProcessedScannerProperties underTest = new ProcessedScannerProperties(
- new RawScannerProperties(map),
- new EmptyExternalProjectKeyAndOrganization());
- assertThat(underTest.properties()).containsOnly(entry("foo", "bar"));
- assertThat(underTest.properties()).isNotSameAs(map);
-
- map.put("put", "after_copy");
- assertThat(underTest.properties()).hasSize(1);
- }
-}
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/ScannerPropertiesTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/ScannerPropertiesTest.java
new file mode 100644
index 00000000000..ce96f9d042e
--- /dev/null
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/ScannerPropertiesTest.java
@@ -0,0 +1,65 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2020 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.sonar.scanner.bootstrap;
+
+import com.google.common.collect.ImmutableMap;
+import org.junit.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
+public class ScannerPropertiesTest {
+
+ @Test
+ public void initialization() {
+ ImmutableMap<String, String> map = ImmutableMap.<String, String>builder()
+ .put("prop-1", "{b64}Zm9v")
+ .put("sonar.projectKey", "my-project")
+ .build();
+ ScannerProperties underTest = new ScannerProperties(map);
+
+ assertThat(underTest.getEncryption()).isNotNull();
+ assertThat(underTest.properties())
+ .containsEntry("prop-1", "foo")
+ .containsEntry("sonar.projectKey", "my-project");
+ assertThat(underTest.getProjectKey()).isEqualTo("my-project");
+ }
+
+ @Test
+ public void encryption_fail() {
+ ImmutableMap<String, String> map = ImmutableMap.<String, String>builder()
+ .put("prop-1", "{aes}Zm9vzxc")
+ .build();
+ assertThatThrownBy(() -> new ScannerProperties(map))
+ .isInstanceOf(IllegalStateException.class)
+ .hasMessageContaining("Fail to decrypt the property");
+ }
+
+ @Test
+ public void encryption_ok() {
+ ImmutableMap<String, String> map = ImmutableMap.<String, String>builder()
+ .put("prop-1", "{b64}Zm9v")
+ .build();
+ ScannerProperties underTest = new ScannerProperties(map);
+
+ assertThat(underTest.property("prop-1")).isEqualTo("foo");
+ }
+
+}
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/ScannerWsClientProviderTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/ScannerWsClientProviderTest.java
index 3aa081c7abd..cff5e326981 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/ScannerWsClientProviderTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/ScannerWsClientProviderTest.java
@@ -37,9 +37,9 @@ public class ScannerWsClientProviderTest {
@Test
public void provide_client_with_default_settings() {
- RawScannerProperties settings = new RawScannerProperties(new HashMap<>());
+ ScannerProperties settings = new ScannerProperties(new HashMap<>());
- DefaultScannerWsClient client = underTest.provide(settings, env, new GlobalAnalysisMode(new RawScannerProperties(Collections.emptyMap())), mock(System2.class));
+ DefaultScannerWsClient client = underTest.provide(settings, env, new GlobalAnalysisMode(new ScannerProperties(Collections.emptyMap())), mock(System2.class));
assertThat(client).isNotNull();
assertThat(client.baseUrl()).isEqualTo("http://localhost:9000/");
@@ -57,9 +57,9 @@ public class ScannerWsClientProviderTest {
props.put("sonar.login", "theLogin");
props.put("sonar.password", "thePassword");
props.put("sonar.ws.timeout", "42");
- RawScannerProperties settings = new RawScannerProperties(props);
+ ScannerProperties settings = new ScannerProperties(props);
- DefaultScannerWsClient client = underTest.provide(settings, env, new GlobalAnalysisMode(new RawScannerProperties(Collections.emptyMap())), mock(System2.class));
+ DefaultScannerWsClient client = underTest.provide(settings, env, new GlobalAnalysisMode(new ScannerProperties(Collections.emptyMap())), mock(System2.class));
assertThat(client).isNotNull();
HttpConnector httpConnector = (HttpConnector) client.wsConnector();
@@ -71,9 +71,9 @@ public class ScannerWsClientProviderTest {
public void build_singleton() {
System2 system = mock(System2.class);
- RawScannerProperties settings = new RawScannerProperties(new HashMap<>());
- DefaultScannerWsClient first = underTest.provide(settings, env, new GlobalAnalysisMode(new RawScannerProperties(Collections.emptyMap())), system);
- DefaultScannerWsClient second = underTest.provide(settings, env, new GlobalAnalysisMode(new RawScannerProperties(Collections.emptyMap())), system);
+ ScannerProperties settings = new ScannerProperties(new HashMap<>());
+ DefaultScannerWsClient first = underTest.provide(settings, env, new GlobalAnalysisMode(new ScannerProperties(Collections.emptyMap())), system);
+ DefaultScannerWsClient second = underTest.provide(settings, env, new GlobalAnalysisMode(new ScannerProperties(Collections.emptyMap())), system);
assertThat(first).isSameAs(second);
}
}
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/MetadataPublisherTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/MetadataPublisherTest.java
index 01a995dda20..4f91b85e291 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/MetadataPublisherTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/MetadataPublisherTest.java
@@ -53,7 +53,6 @@ import org.sonar.scanner.protocol.output.ScannerReportWriter;
import org.sonar.scanner.repository.ForkDateSupplier;
import org.sonar.scanner.rule.QProfile;
import org.sonar.scanner.rule.QualityProfiles;
-import org.sonar.scanner.scan.ScanProperties;
import org.sonar.scanner.scan.branch.BranchConfiguration;
import org.sonar.scanner.scan.branch.BranchType;
import org.sonar.scanner.scan.filesystem.InputComponentStore;
@@ -75,7 +74,6 @@ public class MetadataPublisherTest {
public TemporaryFolder temp = new TemporaryFolder();
private MetadataPublisher underTest;
- private final ScanProperties properties = mock(ScanProperties.class);
private final QualityProfiles qProfiles = mock(QualityProfiles.class);
private final ProjectInfo projectInfo = mock(ProjectInfo.class);
private final CpdSettings cpdSettings = mock(CpdSettings.class);
@@ -117,7 +115,7 @@ public class MetadataPublisherTest {
branches = mock(BranchConfiguration.class);
scmConfiguration = mock(ScmConfiguration.class);
when(scmConfiguration.provider()).thenReturn(scmProvider);
- underTest = new MetadataPublisher(projectInfo, inputModuleHierarchy, properties, qProfiles, cpdSettings,
+ underTest = new MetadataPublisher(projectInfo, inputModuleHierarchy, qProfiles, cpdSettings,
pluginRepository, branches, scmRevision, forkDateSupplier, componentStore, scmConfiguration);
}
@@ -176,7 +174,6 @@ public class MetadataPublisherTest {
@UseDataProvider("projectVersions")
public void write_project_version(@Nullable String projectVersion, String expected) throws Exception {
when(projectInfo.getProjectVersion()).thenReturn(Optional.ofNullable(projectVersion));
- when(properties.organizationKey()).thenReturn(Optional.of("SonarSource"));
File outputDir = temp.newFolder();
ScannerReportWriter writer = new ScannerReportWriter(outputDir);
@@ -203,7 +200,6 @@ public class MetadataPublisherTest {
@UseDataProvider("buildStrings")
public void write_buildString(@Nullable String buildString, String expected) throws Exception {
when(projectInfo.getBuildString()).thenReturn(Optional.ofNullable(buildString));
- when(properties.organizationKey()).thenReturn(Optional.of("SonarSource"));
File outputDir = temp.newFolder();
ScannerReportWriter writer = new ScannerReportWriter(outputDir);
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ReportPublisherTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ReportPublisherTest.java
index 211e1a062d3..460c3b507d5 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ReportPublisherTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ReportPublisherTest.java
@@ -25,7 +25,6 @@ import java.io.PipedOutputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
-import java.util.Optional;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -97,11 +96,9 @@ public class ReportPublisherTest {
@Test
public void dump_information_about_report_uploading() throws IOException {
- when(properties.organizationKey()).thenReturn(Optional.of("MyOrg"));
underTest.prepareAndDumpMetadata("TASK-123");
assertThat(readFileToString(properties.metadataFilePath().toFile(), StandardCharsets.UTF_8)).isEqualTo(
- "organization=MyOrg\n" +
"projectKey=org.sonarsource.sonarqube:sonarqube\n" +
"serverUrl=https://localhost\n" +
"serverVersion=6.4\n" +
@@ -249,8 +246,6 @@ public class ReportPublisherTest {
@Test
public void test_ws_parameters() throws Exception {
- when(properties.organizationKey()).thenReturn(Optional.of("MyOrg"));
-
WsResponse response = mock(WsResponse.class);
PipedOutputStream out = new PipedOutputStream();
@@ -268,16 +263,12 @@ public class ReportPublisherTest {
verify(wsClient).call(capture.capture());
WsRequest wsRequest = capture.getValue();
- assertThat(wsRequest.getParameters().getKeys()).containsOnly("organization", "projectKey");
- assertThat(wsRequest.getParameters().getValue("organization")).isEqualTo("MyOrg");
+ assertThat(wsRequest.getParameters().getKeys()).containsOnly("projectKey");
assertThat(wsRequest.getParameters().getValue("projectKey")).isEqualTo("org.sonarsource.sonarqube:sonarqube");
}
@Test
public void test_send_branches_characteristics() throws Exception {
- String orgName = "MyOrg";
- when(properties.organizationKey()).thenReturn(Optional.of(orgName));
-
String branchName = "feature";
when(branchConfiguration.branchName()).thenReturn(branchName);
when(branchConfiguration.branchType()).thenReturn(BRANCH);
@@ -299,8 +290,7 @@ public class ReportPublisherTest {
verify(wsClient).call(capture.capture());
WsRequest wsRequest = capture.getValue();
- assertThat(wsRequest.getParameters().getKeys()).hasSize(3);
- assertThat(wsRequest.getParameters().getValues("organization")).containsExactly(orgName);
+ assertThat(wsRequest.getParameters().getKeys()).hasSize(2);
assertThat(wsRequest.getParameters().getValues("projectKey")).containsExactly("org.sonarsource.sonarqube:sonarqube");
assertThat(wsRequest.getParameters().getValues("characteristic"))
.containsExactlyInAnyOrder("branch=" + branchName, "branchType=" + BRANCH.name());
@@ -308,9 +298,6 @@ public class ReportPublisherTest {
@Test
public void send_pull_request_characteristic() throws Exception {
- String orgName = "MyOrg";
- when(properties.organizationKey()).thenReturn(Optional.of(orgName));
-
String branchName = "feature";
String pullRequestId = "pr-123";
when(branchConfiguration.branchName()).thenReturn(branchName);
@@ -334,8 +321,7 @@ public class ReportPublisherTest {
verify(wsClient).call(capture.capture());
WsRequest wsRequest = capture.getValue();
- assertThat(wsRequest.getParameters().getKeys()).hasSize(3);
- assertThat(wsRequest.getParameters().getValues("organization")).containsExactly(orgName);
+ assertThat(wsRequest.getParameters().getKeys()).hasSize(2);
assertThat(wsRequest.getParameters().getValues("projectKey")).containsExactly("org.sonarsource.sonarqube:sonarqube");
assertThat(wsRequest.getParameters().getValues("characteristic"))
.containsExactlyInAnyOrder("pullRequest=" + pullRequestId);
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/DefaultQualityProfileLoaderTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/DefaultQualityProfileLoaderTest.java
index ae721b16148..5d1a4381a1b 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/DefaultQualityProfileLoaderTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/DefaultQualityProfileLoaderTest.java
@@ -23,7 +23,6 @@ import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.util.Optional;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
@@ -37,15 +36,14 @@ import org.sonarqube.ws.client.HttpException;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.when;
public class DefaultQualityProfileLoaderTest {
@Rule
public ExpectedException exception = ExpectedException.none();
- private DefaultScannerWsClient wsClient = mock(DefaultScannerWsClient.class);
- private ScanProperties properties = mock(ScanProperties.class);
- private DefaultQualityProfileLoader underTest = new DefaultQualityProfileLoader(properties, wsClient);
+ private final DefaultScannerWsClient wsClient = mock(DefaultScannerWsClient.class);
+ private final ScanProperties properties = mock(ScanProperties.class);
+ private final DefaultQualityProfileLoader underTest = new DefaultQualityProfileLoader(wsClient);
@Test
public void load_gets_all_profiles_for_specified_project() throws IOException {
@@ -62,14 +60,6 @@ public class DefaultQualityProfileLoaderTest {
}
@Test
- public void load_sets_organization_parameter_if_defined_in_settings() throws IOException {
- when(properties.organizationKey()).thenReturn(Optional.of("my-org"));
- prepareCallWithResults();
- underTest.load("foo");
- verifyCalledPath("/api/qualityprofiles/search.protobuf?project=foo&organization=my-org");
- }
-
- @Test
public void load_tries_default_if_no_profiles_found_for_project() throws IOException {
HttpException e = new HttpException("", 404, "{\"errors\":[{\"msg\":\"No project found with key 'foo'\"}]}");
WsTestUtil.mockException(wsClient, "/api/qualityprofiles/search.protobuf?project=foo", e);
@@ -82,19 +72,6 @@ public class DefaultQualityProfileLoaderTest {
}
@Test
- public void loadDefault_sets_organization_parameter_if_defined_in_settings() throws IOException {
- when(properties.organizationKey()).thenReturn(Optional.of("my-org"));
-
- HttpException e = new HttpException("", 404, "{\"errors\":[{\"msg\":\"No organization with key 'myorg'\"}]}");
- WsTestUtil.mockException(wsClient, "/api/qualityprofiles/search.protobuf?project=foo&organization=my-org", e);
- WsTestUtil.mockStream(wsClient, "/api/qualityprofiles/search.protobuf?defaults=true&organization=my-org", createStreamOfProfiles("qp"));
-
- underTest.load("foo");
-
- verifyCalledPath("/api/qualityprofiles/search.protobuf?defaults=true&organization=my-org");
- }
-
- @Test
public void load_throws_MessageException_if_no_profiles_are_available_for_specified_project() throws IOException {
prepareCallWithEmptyResults();
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/ProjectRepositoriesSupplierTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/ProjectRepositoriesSupplierTest.java
index cbb57e90116..ddba7a37d46 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/ProjectRepositoriesSupplierTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/ProjectRepositoriesSupplierTest.java
@@ -22,7 +22,7 @@ package org.sonar.scanner.repository;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
-import org.sonar.scanner.bootstrap.ProcessedScannerProperties;
+import org.sonar.scanner.bootstrap.ScannerProperties;
import org.sonar.scanner.scan.branch.BranchConfiguration;
import static java.util.Collections.emptyMap;
@@ -39,7 +39,7 @@ public class ProjectRepositoriesSupplierTest {
private ProjectRepositories project;
private ProjectRepositoriesLoader loader = mock(ProjectRepositoriesLoader.class);
- private ProcessedScannerProperties props = mock(ProcessedScannerProperties.class);
+ private ScannerProperties props = mock(ScannerProperties.class);
private BranchConfiguration branchConfiguration = mock(BranchConfiguration.class);
@Before
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/QualityProfileProviderTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/QualityProfileProviderTest.java
index 889210c73ff..39d0a8fd63a 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/QualityProfileProviderTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/QualityProfileProviderTest.java
@@ -27,7 +27,7 @@ import org.junit.Rule;
import org.junit.Test;
import org.sonar.api.utils.DateUtils;
import org.sonar.api.utils.log.LogTester;
-import org.sonar.scanner.bootstrap.ProcessedScannerProperties;
+import org.sonar.scanner.bootstrap.ScannerProperties;
import org.sonar.scanner.rule.QualityProfiles;
import org.sonarqube.ws.Qualityprofiles.SearchWsResponse.QualityProfile;
@@ -46,7 +46,7 @@ public class QualityProfileProviderTest {
private QualityProfilesProvider qualityProfileProvider;
private QualityProfileLoader loader = mock(QualityProfileLoader.class);
- private ProcessedScannerProperties props = mock(ProcessedScannerProperties.class);
+ private ScannerProperties props = mock(ScannerProperties.class);
private List<QualityProfile> response;
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/settings/DefaultProjectSettingsLoaderTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/settings/DefaultProjectSettingsLoaderTest.java
index 52d13e495d7..eaa4d669342 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/settings/DefaultProjectSettingsLoaderTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/settings/DefaultProjectSettingsLoaderTest.java
@@ -25,7 +25,7 @@ import java.io.PipedOutputStream;
import java.util.Map;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
-import org.sonar.scanner.bootstrap.ProcessedScannerProperties;
+import org.sonar.scanner.bootstrap.ScannerProperties;
import org.sonar.scanner.bootstrap.DefaultScannerWsClient;
import org.sonarqube.ws.Settings;
import org.sonarqube.ws.client.GetRequest;
@@ -41,7 +41,7 @@ import static org.mockito.Mockito.when;
public class DefaultProjectSettingsLoaderTest {
private DefaultScannerWsClient wsClient = mock(DefaultScannerWsClient.class);
- private ProcessedScannerProperties properties = mock(ProcessedScannerProperties.class);
+ private ScannerProperties properties = mock(ScannerProperties.class);
private DefaultProjectSettingsLoader underTest = new DefaultProjectSettingsLoader(wsClient, properties);
@Test
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/ExternalProjectKeyAndOrganizationProviderTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/ExternalProjectKeyAndOrganizationProviderTest.java
deleted file mode 100644
index 35aa8f0a4b4..00000000000
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/ExternalProjectKeyAndOrganizationProviderTest.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2020 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.scanner.scan;
-
-import java.util.Optional;
-import org.junit.Before;
-import org.junit.Test;
-import org.sonar.scanner.bootstrap.RawScannerProperties;
-
-import static java.util.Optional.of;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-public class ExternalProjectKeyAndOrganizationProviderTest {
-
- private ExternalProjectKeyAndOrganizationLoader loader = mock(ExternalProjectKeyAndOrganizationLoader.class);
- private RawScannerProperties rawProperties = mock(RawScannerProperties.class);
-
- private ExternalProjectKeyAndOrganizationProvider underTest = new ExternalProjectKeyAndOrganizationProvider();
-
- @Before
- public void setUp() {
- when(loader.load()).thenReturn(of(new ExternalProjectKeyAndOrganization() {
- @Override
- public Optional<String> getProjectKey() {
- return of("some_key");
- }
-
- @Override
- public Optional<String> getOrganization() {
- return of("organization_key");
- }
- }));
- }
-
- @Test
- public void does_nothing_when_key_autodetection_is_disabled() {
- when(rawProperties.property("sonar.keys_autodetection.disabled")).thenReturn("true");
-
- ExternalProjectKeyAndOrganization result = underTest.provide(rawProperties, loader);
-
- assertThat(result).isInstanceOf(EmptyExternalProjectKeyAndOrganization.class);
- }
-
- @Test
- public void by_default_attempts_to_autodetect_keys_if_external_key_loader_detected() {
- when(rawProperties.property("sonar.keys_autodetection.disabled")).thenReturn(null);
-
- ExternalProjectKeyAndOrganization result = underTest.provide(rawProperties, loader);
-
- assertThat(result).isNotInstanceOf(EmptyExternalProjectKeyAndOrganization.class);
- assertThat(result.getProjectKey()).isEqualTo(of("some_key"));
- assertThat(result.getOrganization()).isEqualTo(of("organization_key"));
- }
-
- @Test
- public void by_default_does_nothing_when_no_external_key_loader_detected() {
- when(rawProperties.property("sonar.keys_autodetection.disabled")).thenReturn(null);
-
- ExternalProjectKeyAndOrganization result = underTest.provide(rawProperties, null);
-
- assertThat(result).isInstanceOf(EmptyExternalProjectKeyAndOrganization.class);
- }
-
- @Test
- public void attempts_to_autodetect_keys_if_autodection_is_explicitly_enabled() {
- when(rawProperties.property("sonar.keys_autodetection.disabled")).thenReturn("false");
-
- ExternalProjectKeyAndOrganization result = underTest.provide(rawProperties, loader);
-
- assertThat(result).isNotInstanceOf(EmptyExternalProjectKeyAndOrganization.class);
- assertThat(result.getProjectKey()).isEqualTo(of("some_key"));
- assertThat(result.getOrganization()).isEqualTo(of("organization_key"));
- }
-}
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/ProjectReactorBuilderTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/ProjectReactorBuilderTest.java
index c3a38b15451..00c9cbbb134 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/ProjectReactorBuilderTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/ProjectReactorBuilderTest.java
@@ -37,8 +37,7 @@ import org.sonar.api.batch.bootstrap.ProjectReactor;
import org.sonar.api.notifications.AnalysisWarnings;
import org.sonar.api.utils.MessageException;
import org.sonar.api.utils.log.LogTester;
-import org.sonar.scanner.bootstrap.ProcessedScannerProperties;
-import org.sonar.scanner.bootstrap.RawScannerProperties;
+import org.sonar.scanner.bootstrap.ScannerProperties;
import static java.util.Collections.emptyMap;
import static java.util.Collections.singletonMap;
@@ -391,8 +390,7 @@ public class ProjectReactorBuilderTest {
@Test
public void shouldInitRootWorkDir() {
- ProjectReactorBuilder builder = new ProjectReactorBuilder(new ProcessedScannerProperties(
- new RawScannerProperties(emptyMap()), new EmptyExternalProjectKeyAndOrganization()),
+ ProjectReactorBuilder builder = new ProjectReactorBuilder(new ScannerProperties(emptyMap()),
mock(AnalysisWarnings.class));
File baseDir = new File("target/tmp/baseDir");
@@ -404,9 +402,7 @@ public class ProjectReactorBuilderTest {
@Test
public void shouldInitWorkDirWithCustomRelativeFolder() {
Map<String, String> props = singletonMap("sonar.working.directory", ".foo");
- ProjectReactorBuilder builder = new ProjectReactorBuilder(new ProcessedScannerProperties(
- new RawScannerProperties(props),
- new EmptyExternalProjectKeyAndOrganization()),
+ ProjectReactorBuilder builder = new ProjectReactorBuilder(new ScannerProperties(props),
mock(AnalysisWarnings.class));
File baseDir = new File("target/tmp/baseDir");
@@ -418,8 +414,7 @@ public class ProjectReactorBuilderTest {
@Test
public void shouldInitRootWorkDirWithCustomAbsoluteFolder() {
Map<String, String> props = singletonMap("sonar.working.directory", new File("src").getAbsolutePath());
- ProjectReactorBuilder builder = new ProjectReactorBuilder(new ProcessedScannerProperties(
- new RawScannerProperties(props), new EmptyExternalProjectKeyAndOrganization()),
+ ProjectReactorBuilder builder = new ProjectReactorBuilder(new ScannerProperties(props),
mock(AnalysisWarnings.class));
File baseDir = new File("target/tmp/baseDir");
@@ -475,9 +470,7 @@ public class ProjectReactorBuilderTest {
private ProjectDefinition loadProjectDefinition(String projectFolder) {
Map<String, String> props = loadProps(projectFolder);
- ProcessedScannerProperties bootstrapProps = new ProcessedScannerProperties(
- new RawScannerProperties(props),
- new EmptyExternalProjectKeyAndOrganization());
+ ScannerProperties bootstrapProps = new ScannerProperties(props);
ProjectReactor projectReactor = new ProjectReactorBuilder(bootstrapProps, mock(AnalysisWarnings.class)).execute();
return projectReactor.getRoot();
}
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/ScanPropertiesTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/ScanPropertiesTest.java
index 3e43e986ae9..af662b664b2 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/ScanPropertiesTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/ScanPropertiesTest.java
@@ -27,18 +27,18 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.rules.TemporaryFolder;
+import org.sonar.api.batch.fs.internal.DefaultInputProject;
import org.sonar.api.config.internal.MapSettings;
import org.sonar.api.utils.MessageException;
-import org.sonar.api.batch.fs.internal.DefaultInputProject;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public class ScanPropertiesTest {
- private MapSettings settings = new MapSettings();
- private DefaultInputProject project = mock(DefaultInputProject.class);
- private ScanProperties underTest = new ScanProperties(settings.asConfig(), project);
+ private final MapSettings settings = new MapSettings();
+ private final DefaultInputProject project = mock(DefaultInputProject.class);
+ private final ScanProperties underTest = new ScanProperties(settings.asConfig(), project);
@Rule
public TemporaryFolder temp = new TemporaryFolder();
@@ -55,7 +55,6 @@ public class ScanPropertiesTest {
@Test
public void defaults_if_no_setting_defined() {
assertThat(underTest.branch()).isEmpty();
- assertThat(underTest.organizationKey()).isEmpty();
assertThat(underTest.preloadFileMetadata()).isFalse();
assertThat(underTest.shouldKeepReport()).isFalse();
assertThat(underTest.metadataFilePath()).isEqualTo(project.getWorkDir().resolve("report-task.txt"));
@@ -63,12 +62,6 @@ public class ScanPropertiesTest {
}
@Test
- public void should_define_organization_key() {
- settings.setProperty("sonar.organization", "org");
- assertThat(underTest.organizationKey()).isEqualTo(Optional.of("org"));
- }
-
- @Test
public void should_define_branch_name() {
settings.setProperty("sonar.branch.name", "name");
assertThat(underTest.branch()).isEqualTo(Optional.of("name"));
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/branch/ProjectBranchesProviderTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/branch/ProjectBranchesProviderTest.java
index 4a9f1ae2d3e..3a0f8fc477e 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/branch/ProjectBranchesProviderTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/branch/ProjectBranchesProviderTest.java
@@ -21,7 +21,7 @@ package org.sonar.scanner.scan.branch;
import org.junit.Before;
import org.junit.Test;
-import org.sonar.scanner.bootstrap.ProcessedScannerProperties;
+import org.sonar.scanner.bootstrap.ScannerProperties;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
@@ -31,13 +31,13 @@ public class ProjectBranchesProviderTest {
private ProjectBranchesProvider provider = new ProjectBranchesProvider();
private ProjectBranchesLoader mockLoader;
private ProjectBranches mockBranches;
- private ProcessedScannerProperties scannerProperties;
+ private ScannerProperties scannerProperties;
@Before
public void setUp() {
mockLoader = mock(ProjectBranchesLoader.class);
mockBranches = mock(ProjectBranches.class);
- scannerProperties = mock(ProcessedScannerProperties.class);
+ scannerProperties = mock(ScannerProperties.class);
}
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/branch/ProjectPullRequestsProviderTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/branch/ProjectPullRequestsProviderTest.java
index 35a85869a3a..510d24bd2f7 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/branch/ProjectPullRequestsProviderTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/branch/ProjectPullRequestsProviderTest.java
@@ -21,7 +21,7 @@ package org.sonar.scanner.scan.branch;
import org.junit.Before;
import org.junit.Test;
-import org.sonar.scanner.bootstrap.ProcessedScannerProperties;
+import org.sonar.scanner.bootstrap.ScannerProperties;
import static java.util.Collections.emptyList;
import static org.assertj.core.api.Assertions.assertThat;
@@ -32,13 +32,13 @@ public class ProjectPullRequestsProviderTest {
private ProjectPullRequestsProvider provider = new ProjectPullRequestsProvider();
private ProjectPullRequestsLoader mockLoader;
private ProjectPullRequests pullRequests;
- private ProcessedScannerProperties scannerProperties;
+ private ScannerProperties scannerProperties;
@Before
public void setUp() {
mockLoader = mock(ProjectPullRequestsLoader.class);
pullRequests = new ProjectPullRequests(emptyList());
- scannerProperties = mock(ProcessedScannerProperties.class);
+ scannerProperties = mock(ScannerProperties.class);
}
@Test
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/scm/ScmRevisionImplTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/scm/ScmRevisionImplTest.java
index 16a02abfe65..37fbc99cd1a 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/scm/ScmRevisionImplTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/scm/ScmRevisionImplTest.java
@@ -24,7 +24,7 @@ import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
import org.junit.Test;
-import org.sonar.scanner.bootstrap.RawScannerProperties;
+import org.sonar.scanner.bootstrap.ScannerProperties;
import org.sonar.scanner.ci.CiConfiguration;
import org.sonar.scanner.fs.InputModuleHierarchy;
@@ -65,7 +65,7 @@ public class ScmRevisionImplTest {
when(scmConfiguration.provider().revisionId(any())).thenThrow(new UnsupportedOperationException("BOOM"));
InputModuleHierarchy moduleHierarchy = mock(InputModuleHierarchy.class, RETURNS_DEEP_STUBS);
- ScmRevisionImpl underTest = new ScmRevisionImpl(ciConfiguration, new RawScannerProperties(scannerConfiguration), scmConfiguration, moduleHierarchy);
+ ScmRevisionImpl underTest = new ScmRevisionImpl(ciConfiguration, new ScannerProperties(scannerConfiguration), scmConfiguration, moduleHierarchy);
assertThat(underTest.get()).isEmpty();
}
@@ -79,7 +79,7 @@ public class ScmRevisionImplTest {
when(scmConfiguration.provider().revisionId(any())).thenReturn(scmValue);
InputModuleHierarchy moduleHierarchy = mock(InputModuleHierarchy.class, RETURNS_DEEP_STUBS);
- ScmRevisionImpl underTest = new ScmRevisionImpl(ciConfiguration, new RawScannerProperties(scannerConfiguration), scmConfiguration, moduleHierarchy);
+ ScmRevisionImpl underTest = new ScmRevisionImpl(ciConfiguration, new ScannerProperties(scannerConfiguration), scmConfiguration, moduleHierarchy);
return underTest.get();
}
}