aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-xoo-plugin/src/test
diff options
context:
space:
mode:
authorBenjamin Campomenosi <109955405+benjamin-campomenosi-sonarsource@users.noreply.github.com>2023-04-21 12:17:10 +0200
committersonartech <sonartech@sonarsource.com>2023-04-24 20:04:24 +0000
commita755196f047cc2f36a9612134d4f1c3482ccb4c5 (patch)
tree19a44b125a2772da241a9d04a7cd3a25444be299 /plugins/sonar-xoo-plugin/src/test
parent5555b600ec9cdc2256c4e47b36df188d7703c1ca (diff)
downloadsonarqube-a755196f047cc2f36a9612134d4f1c3482ccb4c5.tar.gz
sonarqube-a755196f047cc2f36a9612134d4f1c3482ccb4c5.zip
SONAR-19050 Update xoo-plugin : use new rule characteristics in some issues
Diffstat (limited to 'plugins/sonar-xoo-plugin/src/test')
-rw-r--r--plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/rule/XooRulesDefinitionTest.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/rule/XooRulesDefinitionTest.java b/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/rule/XooRulesDefinitionTest.java
index 8d3ece2a71c..d851fb4f26f 100644
--- a/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/rule/XooRulesDefinitionTest.java
+++ b/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/rule/XooRulesDefinitionTest.java
@@ -25,6 +25,7 @@ import org.sonar.api.SonarEdition;
import org.sonar.api.SonarQubeSide;
import org.sonar.api.impl.server.RulesDefinitionContext;
import org.sonar.api.internal.SonarRuntimeImpl;
+import org.sonar.api.rules.RuleCharacteristic;
import org.sonar.api.server.debt.DebtRemediationFunction;
import org.sonar.api.server.rule.RulesDefinition;
import org.sonar.api.utils.Version;
@@ -55,6 +56,7 @@ public class XooRulesDefinitionTest {
assertThat(rule.debtRemediationFunction().gapMultiplier()).isEqualTo("1min");
assertThat(rule.debtRemediationFunction().baseEffort()).isNull();
assertThat(rule.gapDescription()).isNotEmpty();
+ assertThat(rule.characteristic()).isNull();
assertThat(rule.ruleDescriptionSections()).isNotEmpty();
assertThat(rule.ruleDescriptionSections().stream().anyMatch(rds -> rds.getContext().isPresent())).isTrue();
}
@@ -114,6 +116,13 @@ public class XooRulesDefinitionTest {
assertThat(repo.rules()).hasSize(2);
}
+ @Test
+ public void define_xoo_rule_with_characteristic() {
+ RulesDefinition.Repository repo = context.repository("xoo");
+ RulesDefinition.Rule oneCodeSmellIssuePerLine = repo.rule("OneCodeSmellIssuePerLine");
+ assertThat(oneCodeSmellIssuePerLine.characteristic()).isEqualTo(RuleCharacteristic.STRUCTURED);
+ }
+
private RulesDefinition.Repository getRepository() {
RulesDefinition.Repository repo = context.repository("xoo");
assertThat(repo).isNotNull();