aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-server-common/src
diff options
context:
space:
mode:
authorAurelien <100427063+aurelien-poscia-sonarsource@users.noreply.github.com>2022-04-28 15:10:35 +0200
committersonartech <sonartech@sonarsource.com>2022-05-06 20:02:43 +0000
commit5cea1b86e42b9b71bd289ee35d4b376cb62e51c4 (patch)
tree7d9b79f624d732275d037980322b68b3345e3696 /server/sonar-server-common/src
parent6bb200a692f7a200c0ca27900c24c8c89982e521 (diff)
downloadsonarqube-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')
-rw-r--r--server/sonar-server-common/src/main/java/org/sonar/server/rule/RuleDescriptionFormatter.java4
-rw-r--r--server/sonar-server-common/src/test/java/org/sonar/server/rule/RuleDescriptionFormatterTest.java8
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();