diff options
author | Aurelien Poscia <aurelien.poscia@sonarsource.com> | 2022-07-08 16:45:08 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-07-08 20:02:48 +0000 |
commit | 12b488c80a45f27b5176557a9c7e1a24dcab83d4 (patch) | |
tree | 429357e1b675ca9b37ec9644c4057e9ba9907531 /server/sonar-webserver-core | |
parent | 54c600a0fddace72aadafb4c3a3484b51405628d (diff) | |
download | sonarqube-12b488c80a45f27b5176557a9c7e1a24dcab83d4.tar.gz sonarqube-12b488c80a45f27b5176557a9c7e1a24dcab83d4.zip |
SONAR-16614 adapt test to new constraints enforced by sonar-plugin-api
Diffstat (limited to 'server/sonar-webserver-core')
-rw-r--r-- | server/sonar-webserver-core/src/test/java/org/sonar/server/rule/RegisterRulesTest.java | 10 |
1 files changed, 7 insertions, 3 deletions
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 fb6fb316b6c..3144162449b 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 @@ -746,6 +746,7 @@ public class RegisterRulesTest { 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 -> { @@ -755,6 +756,7 @@ public class RegisterRulesTest { .addDescriptionSection(section1context1) .addDescriptionSection(section1context2) .addDescriptionSection(section2context1) + .addDescriptionSection(section2context2) .addDescriptionSection(section3noContext) .addDescriptionSection(section4noContext) .setHtmlDescription("Desc1"); @@ -763,7 +765,8 @@ public class RegisterRulesTest { RuleDescriptionSection section1context2updated = createRuleDescriptionSection(HOW_TO_FIX_SECTION_KEY, "section1 ctx2 updated content", "CTX_2"); RuleDescriptionSection section2updatedWithoutContext = createRuleDescriptionSection(RESOURCES_SECTION_KEY, section2context1.getHtmlContent(), null); - RuleDescriptionSection section4updatedWithContext = createRuleDescriptionSection(ROOT_CAUSE_SECTION_KEY, section4noContext.getHtmlContent(), "CTX_1"); + 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"); @@ -773,7 +776,8 @@ public class RegisterRulesTest { .addDescriptionSection(section1context2updated) .addDescriptionSection(section2updatedWithoutContext) .addDescriptionSection(section3noContext) - .addDescriptionSection(section4updatedWithContext) + .addDescriptionSection(section4updatedWithContext1) + .addDescriptionSection(section4updatedWithContext2) .setHtmlDescription("Desc2"); repo.done(); @@ -784,7 +788,7 @@ public class RegisterRulesTest { assertThat(rule1.getDefaultRuleDescriptionSection().getContent()).isEqualTo("Desc2"); Set<RuleDescriptionSection> expectedSections = Set.of(section1context1, section1context2updated, - section2updatedWithoutContext, section3noContext, section4updatedWithContext); + section2updatedWithoutContext, section3noContext, section4updatedWithContext1, section4updatedWithContext2); assertThat(rule1.getRuleDescriptionSectionDtos()).hasSize(expectedSections.size() + 1); expectedSections.forEach(apiSection -> assertSectionExists(apiSection, rule1.getRuleDescriptionSectionDtos())); } |