diff options
author | Dejan Milisavljevic <130993898+dejan-milisavljevic-sonarsource@users.noreply.github.com> | 2024-09-18 14:03:50 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2024-09-18 20:02:59 +0000 |
commit | e55e29f6e2632c1eef4db2d659e685a50caa10a6 (patch) | |
tree | c178331b8d79e523a9c3bdbbc82f611781413dbc /sonar-scanner-engine/src/test/java/org | |
parent | 7fe4eae27f3b725ea08c79d5a0373596200a1627 (diff) | |
download | sonarqube-e55e29f6e2632c1eef4db2d659e685a50caa10a6.tar.gz sonarqube-e55e29f6e2632c1eef4db2d659e685a50caa10a6.zip |
SONAR-22951 Use 5 levels severities for Software Impact
Co-authored-by: Léo Geoffroy <leo.geoffroy@sonarsource.com>
Co-authored-by: Stanislav <31501873+stanislavhh@users.noreply.github.com>
Co-authored-by: Viktor Vorona <viktor.vorona@sonarsource.com>
Co-authored-by: OrlovAlexander <35396155+OrlovAlexander85@users.noreply.github.com>
Co-authored-by: stanislavh <stanislav.honcharov@sonarsource.com>
Diffstat (limited to 'sonar-scanner-engine/src/test/java/org')
-rw-r--r-- | sonar-scanner-engine/src/test/java/org/sonar/scanner/externalissue/ExternalIssueImporterTest.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/externalissue/ExternalIssueImporterTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/externalissue/ExternalIssueImporterTest.java index bdbd28fcdaa..e8ff234901d 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/externalissue/ExternalIssueImporterTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/externalissue/ExternalIssueImporterTest.java @@ -46,6 +46,7 @@ import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.sonar.api.issue.impact.Severity.BLOCKER; import static org.sonar.api.issue.impact.Severity.HIGH; import static org.sonar.api.issue.impact.Severity.LOW; import static org.sonar.api.issue.impact.SoftwareQuality.MAINTAINABILITY; @@ -109,7 +110,7 @@ public class ExternalIssueImporterTest { ExternalIssue output = context.allExternalIssues().iterator().next(); assertThat(output.engineId()).isEqualTo(RULE_ENGINE_ID); assertThat(output.ruleId()).isEqualTo(RULE_ID); - assertThat(output.severity()).isEqualTo(Severity.CRITICAL); //backmapped + assertThat(output.severity()).isEqualTo(Severity.BLOCKER); // backmapped assertThat(output.type()).isEqualTo(RuleType.VULNERABILITY); //backmapped assertThat(output.remediationEffort()).isNull(); assertThat(logs.logs(Level.INFO)).contains("Imported 1 issue in 1 file"); @@ -119,10 +120,10 @@ public class ExternalIssueImporterTest { assertThat(output1.ruleId()).isEqualTo(RULE_ID); assertThat(output1.name()).isEqualTo(RULE_NAME); assertThat(output1.engineId()).isEqualTo(RULE_ENGINE_ID); - assertThat(output1.severity()).isEqualTo(Severity.CRITICAL); //backmapped + assertThat(output1.severity()).isEqualTo(Severity.BLOCKER); // backmapped assertThat(output1.type()).isEqualTo(RuleType.VULNERABILITY); //backmapped assertThat(output1.cleanCodeAttribute()).isEqualTo(RULE_ATTRIBUTE); - assertThat(output1.defaultImpacts()).containsExactlyInAnyOrderEntriesOf(Map.of(SECURITY, HIGH, MAINTAINABILITY, LOW)); + assertThat(output1.defaultImpacts()).containsExactlyInAnyOrderEntriesOf(Map.of(SECURITY, BLOCKER, MAINTAINABILITY, LOW)); } @Test @@ -333,7 +334,7 @@ public class ExternalIssueImporterTest { private static ExternalIssueReport.Rule createRule() { - return createRule(RULE_ATTRIBUTE.name(), SECURITY.name(), HIGH.name()); + return createRule(RULE_ATTRIBUTE.name(), SECURITY.name(), BLOCKER.name()); } private static ExternalIssueReport.Rule createRule(String cleanCodeAttribute, String softwareQuality, String impactSeverity) { |