Map<String, String> sectionKeyToContent = getSectionKeyToContent(ruleDto);
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(ROOT_CAUSE_SECTION_KEY)).ifPresent(ruleBuilder::setRiskDescription);
+ Optional.ofNullable(sectionKeyToContent.get(ASSESS_THE_PROBLEM_SECTION_KEY)).ifPresent(ruleBuilder::setVulnerabilityDescription);
Optional.ofNullable(sectionKeyToContent.get(HOW_TO_FIX_SECTION_KEY)).ifPresent(ruleBuilder::setFixRecommendations);
responseBuilder.setRule(ruleBuilder.build());
}
Hotspots.ShowWsResponse response = newRequest(hotspot)
.executeProtobuf(Hotspots.ShowWsResponse.class);
- assertThat(response.getRule().getVulnerabilityDescription()).isEqualTo(rootCauseSection.getContent());
- assertThat(response.getRule().getRiskDescription()).isEqualTo(assesTheProblemSection.getContent());
+ assertThat(response.getRule().getRiskDescription()).isEqualTo(rootCauseSection.getContent());
+ assertThat(response.getRule().getVulnerabilityDescription()).isEqualTo(assesTheProblemSection.getContent());
assertThat(response.getRule().getFixRecommendations()).isEqualTo(howToFixSection.getContent());
}
Hotspots.ShowWsResponse response = newRequest(hotspot)
.executeProtobuf(Hotspots.ShowWsResponse.class);
- assertThat(response.getRule().getVulnerabilityDescription()).isEqualTo(rootCauseSection.getContent());
- assertThat(response.getRule().getRiskDescription()).isEqualTo(assesTheProblemSection.getContent());
+ assertThat(response.getRule().getRiskDescription()).isEqualTo(rootCauseSection.getContent());
+ assertThat(response.getRule().getVulnerabilityDescription()).isEqualTo(assesTheProblemSection.getContent());
assertThat(response.getRule().getFixRecommendations()).isEmpty();
}
RuleDescriptionSectionDto sectionDto = RuleDescriptionSectionDto.builder()
.uuid(uuidFactory.create())
- .key(ASSESS_THE_PROBLEM_SECTION_KEY)
+ .key(DEFAULT_KEY)
.content(description)
.build();