diff options
author | Aurelien <100427063+aurelien-poscia-sonarsource@users.noreply.github.com> | 2022-04-28 15:10:35 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-05-06 20:02:43 +0000 |
commit | 5cea1b86e42b9b71bd289ee35d4b376cb62e51c4 (patch) | |
tree | 7d9b79f624d732275d037980322b68b3345e3696 /server/sonar-server-common/src | |
parent | 6bb200a692f7a200c0ca27900c24c8c89982e521 (diff) | |
download | sonarqube-5cea1b86e42b9b71bd289ee35d4b376cb62e51c4.tar.gz sonarqube-5cea1b86e42b9b71bd289ee35d4b376cb62e51c4.zip |
SONAR-16302 Renamed RULE_DESC_SECTIONS.DESCRIPTION to RULE_DESC_SECTIONS.CONTENT and corresponding java objects
Diffstat (limited to 'server/sonar-server-common/src')
2 files changed, 6 insertions, 6 deletions
diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/rule/RuleDescriptionFormatter.java b/server/sonar-server-common/src/main/java/org/sonar/server/rule/RuleDescriptionFormatter.java index f4a61eec7cd..0bfb7851a1a 100644 --- a/server/sonar-server-common/src/main/java/org/sonar/server/rule/RuleDescriptionFormatter.java +++ b/server/sonar-server-common/src/main/java/org/sonar/server/rule/RuleDescriptionFormatter.java @@ -71,9 +71,9 @@ public class RuleDescriptionFormatter { "Rule " + descriptionFormat + " contains section(s) but has no format set"); switch (nonNullDescriptionFormat) { case MARKDOWN: - return Markdown.convertToHtml(ruleDescriptionSectionDto.getDescription()); + return Markdown.convertToHtml(ruleDescriptionSectionDto.getContent()); case HTML: - return ruleDescriptionSectionDto.getDescription(); + return ruleDescriptionSectionDto.getContent(); default: throw new IllegalStateException(format("Rule description section format '%s' is unknown for rule key '%s'", descriptionFormat, ruleKey)); } diff --git a/server/sonar-server-common/src/test/java/org/sonar/server/rule/RuleDescriptionFormatterTest.java b/server/sonar-server-common/src/test/java/org/sonar/server/rule/RuleDescriptionFormatterTest.java index 25e492ebb80..e550548cbdf 100644 --- a/server/sonar-server-common/src/test/java/org/sonar/server/rule/RuleDescriptionFormatterTest.java +++ b/server/sonar-server-common/src/test/java/org/sonar/server/rule/RuleDescriptionFormatterTest.java @@ -48,7 +48,7 @@ public class RuleDescriptionFormatterTest { public void getHtmlDescriptionAsIs() { RuleDefinitionDto rule = new RuleDefinitionDto().setDescriptionFormat(RuleDto.Format.HTML).addRuleDescriptionSectionDto(HTML_SECTION); String html = RuleDescriptionFormatter.getDescriptionAsHtml(rule); - assertThat(html).isEqualTo(HTML_SECTION.getDescription()); + assertThat(html).isEqualTo(HTML_SECTION.getContent()); } @Test @@ -69,10 +69,10 @@ public class RuleDescriptionFormatterTest { @Test public void getHtmlDescriptionForRuleForIndexingDtoAsIs() { Set<RuleDescriptionSectionDto> sectionsDtos = Sets.newHashSet( - createDefaultRuleDescriptionSection("uuid", HTML_SECTION.getDescription())); + createDefaultRuleDescriptionSection("uuid", HTML_SECTION.getContent())); RuleForIndexingDto rule = createRuleForIndexingDto(sectionsDtos, RuleDto.Format.HTML); String html = RuleDescriptionFormatter.getDescriptionAsHtml(rule); - assertThat(html).isEqualTo(HTML_SECTION.getDescription()); + assertThat(html).isEqualTo(HTML_SECTION.getContent()); } @Test @@ -85,7 +85,7 @@ public class RuleDescriptionFormatterTest { @Test public void handleNullDescriptionFormatForRuleForIndexingDto() { Set<RuleDescriptionSectionDto> sectionsDtos = Sets.newHashSet( - createDefaultRuleDescriptionSection("uuid", HTML_SECTION.getDescription())); + createDefaultRuleDescriptionSection("uuid", HTML_SECTION.getContent())); RuleForIndexingDto rule = createRuleForIndexingDto(sectionsDtos, null); String result = RuleDescriptionFormatter.getDescriptionAsHtml(rule); assertThat(result).isNull(); |