Skip to content

Commit

Permalink
PLUGINAPI-122 Standard severities need to be mapped to all the five i…
Browse files Browse the repository at this point in the history
…mpact severities
  • Loading branch information
zipengwu committed Feb 27, 2025
1 parent dc2df61 commit 2868298
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Changelog
## 11.2
* Standard Severity BLOCKER is now mapped to Software Quality Impact Severity BLOCKER
* Standard Severity INFO is now mapped to Software Quality Impact Severity INFO

## 11.1
* Remove deprecation on `status` values `TO_REVIEW`, `REVIEWED` and related usages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,15 @@ public static String convertToDeprecatedSeverity(Severity severity) {
public static Severity convertToImpactSeverity(String ruleSeverity) {
switch (ruleSeverity) {
case BLOCKER:
return Severity.BLOCKER;
case CRITICAL:
return Severity.HIGH;
case MAJOR:
return Severity.MEDIUM;
case MINOR:
case INFO:
return Severity.LOW;
case INFO:
return Severity.INFO;
default:
throw new IllegalStateException("This severity value " + ruleSeverity + " is illegal.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,17 +152,17 @@ public void convertToSeverity_givenMinor_returnLow() {
}

@Test
public void convertToSeverity_givenInfo_returnLow() {
public void convertToSeverity_givenInfo_returnInfo() {
Severity severity = ImpactMapper.convertToImpactSeverity("INFO");

assertThat(severity).isEqualTo(LOW);
assertThat(severity).isEqualTo(INFO);
}

@Test
public void convertToSeverity_givenBlocker_returnHigh() {
public void convertToSeverity_givenBlocker_returnBlock() {
Severity severity = ImpactMapper.convertToImpactSeverity("BLOCKER");

assertThat(severity).isEqualTo(HIGH);
assertThat(severity).isEqualTo(BLOCKER);
}

@Test
Expand Down

0 comments on commit 2868298

Please sign in to comment.