aboutsummaryrefslogtreecommitdiffstats
path: root/it/src/test/java/com/sonarsource/scanner
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2024-05-06 15:48:11 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2024-05-07 13:04:55 +0200
commitf2df80dbd277ffa97d2d43f8e44368944d3e1e4b (patch)
tree23762f8e8f545df1ec65da0e910a7ca98888da0e /it/src/test/java/com/sonarsource/scanner
parent3f3dfbe7907f6e2c0efe2d1b2a515db234cb65da (diff)
downloadsonar-scanner-cli-f2df80dbd277ffa97d2d43f8e44368944d3e1e4b.tar.gz
sonar-scanner-cli-f2df80dbd277ffa97d2d43f8e44368944d3e1e4b.zip
Update to the latest scanner-java-library
Diffstat (limited to 'it/src/test/java/com/sonarsource/scanner')
-rw-r--r--it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java16
-rw-r--r--it/src/test/java/com/sonarsource/scanner/it/SonarScannerTestSuite.java2
2 files changed, 6 insertions, 12 deletions
diff --git a/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java b/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java
index 8055d82..d6b9bf7 100644
--- a/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java
+++ b/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java
@@ -164,17 +164,14 @@ public class ScannerTest extends ScannerTestCase {
@Test
public void should_use_environment_prop() {
SonarScanner build = newScanner(new File("projects/simple-sample"))
- .setEnvironmentVariable("SONAR_HOST_URL", "http://from-env.org");
+ .setEnvironmentVariable("SONAR_HOST_URL", "http://www.google.com/404");
BuildRunner runner = new BuildRunner(orchestrator.getConfiguration());
BuildResult buildResult = runner.runQuietly(null, build);
assertThat(buildResult.isSuccess()).isFalse();
assertThat(buildResult.getLogs())
- .containsAnyOf(
- "No such host is known (from-env.org)", // Windows
- "from-env.org: Name or service not known" // Linux
- );
+ .contains("Error status returned by url [http://www.google.com/404/api/v2/analysis/version]: 404");
}
@Test
@@ -192,18 +189,15 @@ public class ScannerTest extends ScannerTestCase {
public void should_fail_if_unable_to_connect() {
SonarScanner build = newScanner(new File("projects/simple-sample"))
//env property should be overridden
- .setEnvironmentVariable("SONAR_HOST_URL", "http://from-env.org")
- .setProperty("sonar.host.url", "http://foo");
+ .setEnvironmentVariable("SONAR_HOST_URL", "http://www.google.com")
+ .setProperty("sonar.host.url", "http://www.google.com/404");
BuildResult result = orchestrator.executeBuildQuietly(build);
// expect build failure
assertThat(result.isSuccess()).isFalse();
// with the following message
assertThat(result.getLogs())
- .containsAnyOf(
- "No such host is known (foo)", // Windows
- "foo: No address associated with hostname" // Linux
- );
+ .contains("Error status returned by url [http://www.google.com/404/api/v2/analysis/version]: 404");
}
// SONARPLUGINS-3574
diff --git a/it/src/test/java/com/sonarsource/scanner/it/SonarScannerTestSuite.java b/it/src/test/java/com/sonarsource/scanner/it/SonarScannerTestSuite.java
index e3222a5..8d4df88 100644
--- a/it/src/test/java/com/sonarsource/scanner/it/SonarScannerTestSuite.java
+++ b/it/src/test/java/com/sonarsource/scanner/it/SonarScannerTestSuite.java
@@ -38,7 +38,7 @@ public class SonarScannerTestSuite {
private static OrchestratorRule createOrchestrator() {
String sonarVersion = System
- .getProperty("sonar.runtimeVersion", "LATEST_RELEASE[9.9]");
+ .getProperty("sonar.runtimeVersion", "DEV");
return OrchestratorRule.builderEnv()
.useDefaultAdminCredentialsForBuilds(true)
.setSonarVersion(sonarVersion)