diff options
author | Matteo Mara <matteo.mara@sonarsource.com> | 2025-01-07 09:40:40 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2025-01-07 20:03:30 +0000 |
commit | 635557837555213b931c015f8ced9dd77000c6cc (patch) | |
tree | c153652869cb861cf9542694672ada5bd0c3f7d0 | |
parent | 8497758d1bc48ce2f4683af8c890d3fd2ccf6912 (diff) | |
download | sonarqube-635557837555213b931c015f8ced9dd77000c6cc.tar.gz sonarqube-635557837555213b931c015f8ced9dd77000c6cc.zip |
SONAR-24126 Fix issues turning QG red
2 files changed, 8 insertions, 7 deletions
diff --git a/sonar-scanner-engine/src/it/java/org/sonar/scanner/mediumtest/properties/UnsupportedPropertiesMediumIT.java b/sonar-scanner-engine/src/it/java/org/sonar/scanner/mediumtest/properties/UnsupportedPropertiesMediumIT.java index b787a6a887c..32d63ef33a0 100644 --- a/sonar-scanner-engine/src/it/java/org/sonar/scanner/mediumtest/properties/UnsupportedPropertiesMediumIT.java +++ b/sonar-scanner-engine/src/it/java/org/sonar/scanner/mediumtest/properties/UnsupportedPropertiesMediumIT.java @@ -72,12 +72,13 @@ class UnsupportedPropertiesMediumIT { void scanProjectWithBranch() throws IOException { prepareContent(); - assertThatThrownBy(() -> tester.newAnalysis() + ScannerMediumTester.AnalysisBuilder analysisBuilder = tester.newAnalysis() .properties(ImmutableMap.<String, String>builder() .putAll(commonProps) .put("sonar.branch", "branch") - .build()) - .execute()) + .build()); + + assertThatThrownBy(analysisBuilder::execute) .isInstanceOf(MessageException.class) .hasMessage("The 'sonar.branch' parameter is no longer supported. You should stop using it. " + "Branch analysis is available in Developer Edition and above. See https://www.sonarsource.com/plans-and-pricing/developer/ for more information."); @@ -87,12 +88,13 @@ class UnsupportedPropertiesMediumIT { void scanProjectWithPassword() throws IOException { prepareContent(); - assertThatThrownBy(() -> tester.newAnalysis() + ScannerMediumTester.AnalysisBuilder analysisBuilder = tester.newAnalysis() .properties(ImmutableMap.<String, String>builder() .putAll(commonProps) .put("sonar.password", "anything") - .build()) - .execute()) + .build()); + + assertThatThrownBy(analysisBuilder::execute) .isInstanceOf(MessageException.class) .hasMessage("The property 'sonar.password' is no longer supported. Please pass a token with the 'sonar.token' property instead."); } diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/SpringScannerContainer.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/SpringScannerContainer.java index 5efc94ba584..4681f65883c 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/SpringScannerContainer.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/SpringScannerContainer.java @@ -28,7 +28,6 @@ import org.sonar.api.batch.rule.CheckFactory; import org.sonar.api.batch.sensor.issue.internal.DefaultNoSonarFilter; import org.sonar.api.config.PropertyDefinition; import org.sonar.api.scan.filesystem.PathResolver; -import org.sonar.api.utils.MessageException; import org.sonar.core.extension.CoreExtensionsInstaller; import org.sonar.core.metric.ScannerMetrics; import org.sonar.core.platform.SpringComponentContainer; |