diff options
author | Zipeng WU <zipeng.wu@sonarsource.com> | 2022-08-23 12:00:38 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-08-23 20:03:04 +0000 |
commit | 903624e1b3eb08402ad803ab15963dc10fbf4367 (patch) | |
tree | 25dcf50bc404623efdfc6e6c3139ee4e82662227 /server/sonar-webserver-core | |
parent | c9fb60ec6c7c7b1625e6da53268c7eaa21526d70 (diff) | |
download | sonarqube-903624e1b3eb08402ad803ab15963dc10fbf4367.tar.gz sonarqube-903624e1b3eb08402ad803ab15963dc10fbf4367.zip |
Comply key validation of sonar-plugin-api
Diffstat (limited to 'server/sonar-webserver-core')
3 files changed, 11 insertions, 11 deletions
diff --git a/server/sonar-webserver-core/src/test/java/org/sonar/server/rule/AdvancedRuleDescriptionSectionsGeneratorTest.java b/server/sonar-webserver-core/src/test/java/org/sonar/server/rule/AdvancedRuleDescriptionSectionsGeneratorTest.java index b2c4425606a..f007aff95dd 100644 --- a/server/sonar-webserver-core/src/test/java/org/sonar/server/rule/AdvancedRuleDescriptionSectionsGeneratorTest.java +++ b/server/sonar-webserver-core/src/test/java/org/sonar/server/rule/AdvancedRuleDescriptionSectionsGeneratorTest.java @@ -52,14 +52,14 @@ public class AdvancedRuleDescriptionSectionsGeneratorTest { private static final RuleDescriptionSection SECTION_1 = new RuleDescriptionSectionBuilder().sectionKey(HOW_TO_FIX_SECTION_KEY).htmlContent(HTML_CONTENT).build(); private static final RuleDescriptionSection SECTION_2 = new RuleDescriptionSectionBuilder().sectionKey(ROOT_CAUSE_SECTION_KEY).htmlContent(HTML_CONTENT + "2").build(); - private static final Context CONTEXT_1 = new Context("CTX_1", "ctx 1 display name"); + private static final Context CONTEXT_1 = new Context("ctx_1", "ctx 1 display name"); private static final RuleDescriptionSection SECTION_3_WITH_CTX_1 = new RuleDescriptionSectionBuilder() .sectionKey(RESOURCES_SECTION_KEY) .htmlContent(HTML_CONTENT) .context(CONTEXT_1) .build(); - private static final Context CONTEXT_2 = new Context("CTX_2", "ctx 2 display name"); + private static final Context CONTEXT_2 = new Context("ctx_2", "ctx 2 display name"); private static final RuleDescriptionSection SECTION_3_WITH_CTX_2 = new RuleDescriptionSectionBuilder() .sectionKey(RESOURCES_SECTION_KEY) .htmlContent(HTML_CONTENT + "2") diff --git a/server/sonar-webserver-core/src/test/java/org/sonar/server/rule/RegisterRulesTest.java b/server/sonar-webserver-core/src/test/java/org/sonar/server/rule/RegisterRulesTest.java index 58e48f4d2cc..2204e065f67 100644 --- a/server/sonar-webserver-core/src/test/java/org/sonar/server/rule/RegisterRulesTest.java +++ b/server/sonar-webserver-core/src/test/java/org/sonar/server/rule/RegisterRulesTest.java @@ -745,10 +745,10 @@ public class RegisterRulesTest { public void update_several_rule_descriptions() { system.setNow(DATE1.getTime()); - RuleDescriptionSection section1context1 = createRuleDescriptionSection(HOW_TO_FIX_SECTION_KEY, "section1 ctx1 content", "CTX_1"); - RuleDescriptionSection section1context2 = createRuleDescriptionSection(HOW_TO_FIX_SECTION_KEY, "section1 ctx2 content", "CTX_2"); - RuleDescriptionSection section2context1 = createRuleDescriptionSection(RESOURCES_SECTION_KEY, "section2 content", "CTX_1"); - RuleDescriptionSection section2context2 = createRuleDescriptionSection(RESOURCES_SECTION_KEY,"section2 ctx2 content", "CTX_2"); + RuleDescriptionSection section1context1 = createRuleDescriptionSection(HOW_TO_FIX_SECTION_KEY, "section1 ctx1 content", "ctx_1"); + RuleDescriptionSection section1context2 = createRuleDescriptionSection(HOW_TO_FIX_SECTION_KEY, "section1 ctx2 content", "ctx_2"); + RuleDescriptionSection section2context1 = createRuleDescriptionSection(RESOURCES_SECTION_KEY, "section2 content", "ctx_1"); + RuleDescriptionSection section2context2 = createRuleDescriptionSection(RESOURCES_SECTION_KEY,"section2 ctx2 content", "ctx_2"); RuleDescriptionSection section3noContext = createRuleDescriptionSection(ASSESS_THE_PROBLEM_SECTION_KEY, "section3 content", null); RuleDescriptionSection section4noContext = createRuleDescriptionSection(ROOT_CAUSE_SECTION_KEY, "section4 content", null); execute(context -> { @@ -765,10 +765,10 @@ public class RegisterRulesTest { repo.done(); }); - RuleDescriptionSection section1context2updated = createRuleDescriptionSection(HOW_TO_FIX_SECTION_KEY, "section1 ctx2 updated content", "CTX_2"); + RuleDescriptionSection section1context2updated = createRuleDescriptionSection(HOW_TO_FIX_SECTION_KEY, "section1 ctx2 updated content", "ctx_2"); RuleDescriptionSection section2updatedWithoutContext = createRuleDescriptionSection(RESOURCES_SECTION_KEY, section2context1.getHtmlContent(), null); - RuleDescriptionSection section4updatedWithContext1 = createRuleDescriptionSection(ROOT_CAUSE_SECTION_KEY, section4noContext.getHtmlContent(), "CTX_1"); - RuleDescriptionSection section4updatedWithContext2 = createRuleDescriptionSection(ROOT_CAUSE_SECTION_KEY, section4noContext.getHtmlContent(), "CTX_2"); + RuleDescriptionSection section4updatedWithContext1 = createRuleDescriptionSection(ROOT_CAUSE_SECTION_KEY, section4noContext.getHtmlContent(), "ctx_1"); + RuleDescriptionSection section4updatedWithContext2 = createRuleDescriptionSection(ROOT_CAUSE_SECTION_KEY, section4noContext.getHtmlContent(), "ctx_2"); system.setNow(DATE2.getTime()); execute(context -> { NewRepository repo = context.createRepository("fake", "java"); diff --git a/server/sonar-webserver-core/src/test/java/org/sonar/server/rule/RuleDescriptionSectionsGeneratorsTest.java b/server/sonar-webserver-core/src/test/java/org/sonar/server/rule/RuleDescriptionSectionsGeneratorsTest.java index 03ad1283b71..bd595f39e87 100644 --- a/server/sonar-webserver-core/src/test/java/org/sonar/server/rule/RuleDescriptionSectionsGeneratorsTest.java +++ b/server/sonar-webserver-core/src/test/java/org/sonar/server/rule/RuleDescriptionSectionsGeneratorsTest.java @@ -50,8 +50,8 @@ import static org.sonar.server.rule.RuleDescriptionGeneratorTestData.aRuleOfType @RunWith(Parameterized.class) public class RuleDescriptionSectionsGeneratorsTest { - private static final String KEY_1 = "KEY"; - private static final String KEY_2 = "KEY_2"; + private static final String KEY_1 = "key"; + private static final String KEY_2 = "key_2"; private static final String UUID_1 = "uuid1"; private static final String UUID_2 = "uuid2"; |