Skip to content

Commit

Permalink
Assert new sonar.token warning
Browse files Browse the repository at this point in the history
  • Loading branch information
mary-georgiou-sonarsource committed Mar 20, 2023
1 parent b73e652 commit 79f3bc6
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions its/src/test/java/com/sonar/it/shared/ScannerCliTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,17 @@ public void givenTestHtmlCode_whenScannerForCliIsUsed_doesNotLogCsharpWarning()
.setProperty("sonar.cs.file.suffixes=", ".no_extension");
BuildResult result = ORCHESTRATOR.executeBuild(scanner);

assertThat(result.getLogsLines(l -> l.contains("WARN"))).isEmpty();
TestUtils.verifyNoGuiWarnings(ORCHESTRATOR, result);

if (ORCHESTRATOR.getServer().version().isGreaterThanOrEquals(10, 0)) {
// The assertion of the warning regarding 'sonar.token' is temporary, until the `sonar.token` parameter will be fully supported.
assertThat(result.getLogsLines(l -> l.contains("WARN"))).containsExactlyInAnyOrder(
"WARN: The properties 'sonar.login' and 'sonar.password' are deprecated. They will not be supported in the future. Please instead use the 'sonar.token' parameter."
);
}
else {
assertThat(result.getLogsLines(l -> l.contains("WARN"))).isEmpty();
TestUtils.verifyNoGuiWarnings(ORCHESTRATOR, result);
}
}

private SonarScanner getSonarScanner(String projectKey, String projectDir) {
Expand Down

0 comments on commit 79f3bc6

Please sign in to comment.