From: Zipeng WU Date: Tue, 10 May 2022 13:56:17 +0000 (+0200) Subject: SONAR-16364 fix rule description titles X-Git-Tag: 9.5.0.56709~153 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=88c7cab36bc79af4893593a75c7177c8e9dd7789;p=sonarqube.git SONAR-16364 fix rule description titles --- 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 13db9a72a63..0b78ff94321 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 @@ -50,14 +50,14 @@ public class RuleDescriptionFormatter { RESOURCES_SECTION_KEY); public static final Map HOTSPOT_SECTION_TITLES = Map.of( - ROOT_CAUSE_SECTION_KEY, "What's the risk ?", + ROOT_CAUSE_SECTION_KEY, "What is the risk?", ASSESS_THE_PROBLEM_SECTION_KEY, "Assess the risk", - HOW_TO_FIX_SECTION_KEY, "How can you fix it ?" + HOW_TO_FIX_SECTION_KEY, "How can you fix it?" ); public static final Map RULE_SECTION_TITLES = Map.of( - ROOT_CAUSE_SECTION_KEY, "Why is this an issue ?", - HOW_TO_FIX_SECTION_KEY, "How to fix it ?", + ROOT_CAUSE_SECTION_KEY, "Why is this an issue?", + HOW_TO_FIX_SECTION_KEY, "How to fix it?", RESOURCES_SECTION_KEY, "Resources" ); 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 260bb5ed4f6..ab79c311530 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 @@ -62,11 +62,11 @@ public class RuleDescriptionFormatterTest { String html = RuleDescriptionFormatter.getDescriptionAsHtml(rule); assertThat(html) .contains( - "

What's the risk ?

" + "

What is the risk?

" + "
Root is Root

" + "

Assess the risk

" + "
This is not a problem

" - + "

How can you fix it ?

" + + "

How can you fix it?

" + "
I don't want to fix

" ); } diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/rule/ws/ShowActionTest.java b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/rule/ws/ShowActionTest.java index 00d6bb05a42..5d5949263aa 100644 --- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/rule/ws/ShowActionTest.java +++ b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/rule/ws/ShowActionTest.java @@ -365,21 +365,21 @@ public class ShowActionTest { Rule resultRule = result.getRule(); assertThat(resultRule.getHtmlDesc()) .contains( - "

What's the risk ?

" + "

What is the risk?

" + "
Root is Root

" + "

Assess the risk

" + "
This is not a problem

" - + "

How can you fix it ?

" + + "

How can you fix it?

" + "
I don't want to fix

" ); assertThat(resultRule.getMdDesc()) .contains( - "

What's the risk ?

" + "

What is the risk?

" + "
Root is Root

" + "

Assess the risk

" + "
This is not a problem

" - + "

How can you fix it ?

" + + "

How can you fix it?

" + "
I don't want to fix

"); assertThat(resultRule.getDescriptionSectionsList())