diff options
2 files changed, 3 insertions, 3 deletions
diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/hotspot/ws/ShowAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/hotspot/ws/ShowAction.java index 0658ce71649..44d5df3186f 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/hotspot/ws/ShowAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/hotspot/ws/ShowAction.java @@ -182,7 +182,7 @@ public class ShowAction implements HotspotsWsAction { .setVulnerabilityProbability(sqCategory.getVulnerability().name()); Map<String, String> sectionKeyToContent = getSectionKeyToContent(ruleDto); - Optional.ofNullable(sectionKeyToContent.get(DEFAULT_KEY)).ifPresent(ruleBuilder::setVulnerabilityDescription); + Optional.ofNullable(sectionKeyToContent.get(DEFAULT_KEY)).ifPresent(ruleBuilder::setRiskDescription); Optional.ofNullable(sectionKeyToContent.get(ROOT_CAUSE_SECTION_KEY)).ifPresent(ruleBuilder::setVulnerabilityDescription); Optional.ofNullable(sectionKeyToContent.get(ASSESS_THE_PROBLEM_SECTION_KEY)).ifPresent(ruleBuilder::setRiskDescription); Optional.ofNullable(sectionKeyToContent.get(HOW_TO_FIX_SECTION_KEY)).ifPresent(ruleBuilder::setFixRecommendations); diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/hotspot/ws/ShowActionTest.java b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/hotspot/ws/ShowActionTest.java index 7e4146efb2c..1cc2d5d8a0c 100644 --- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/hotspot/ws/ShowActionTest.java +++ b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/hotspot/ws/ShowActionTest.java @@ -488,8 +488,8 @@ public class ShowActionTest { Hotspots.ShowWsResponse response = newRequest(hotspot) .executeProtobuf(Hotspots.ShowWsResponse.class); - assertThat(response.getRule().getVulnerabilityDescription()).isEqualTo(introductionSection.getContent()); - assertThat(response.getRule().getRiskDescription()).isEmpty(); + assertThat(response.getRule().getRiskDescription()).isEqualTo(introductionSection.getContent()); + assertThat(response.getRule().getVulnerabilityDescription()).isEmpty(); assertThat(response.getRule().getFixRecommendations()).isEmpty(); } |