diff options
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(); |