// debt-related information
x1Rule
.setDebtSubCharacteristic(SubCharacteristics.INTEGRATION_TESTABILITY)
- .setDebtRemediationFunction(x1Rule.debtRemediationFunctions().linearWithOffset("1h", "30min"));
+ .setDebtRemediationFunction(x1Rule.debtRemediationFunctions().linearWithOffset("1h", "30min"))
+ .setEffortToFixDescription("Effort to fix issue on one line");
x1Rule.createParam("acceptWhitespace")
.setDefaultValue("false")
assertThat(rule.debtRemediationFunction().type()).isEqualTo(DebtRemediationFunction.Type.LINEAR_OFFSET);
assertThat(rule.debtRemediationFunction().coefficient()).isEqualTo("1h");
assertThat(rule.debtRemediationFunction().offset()).isEqualTo("30min");
+ assertThat(rule.effortToFixDescription()).isEqualTo("x1 effort to fix");
}
/**
assertThat(rule.debtRemediationFunction().type()).isEqualTo(DebtRemediationFunction.Type.LINEAR);
assertThat(rule.debtRemediationFunction().coefficient()).isEqualTo("2h");
assertThat(rule.debtRemediationFunction().offset()).isNull();
+ assertThat(rule.effortToFixDescription()).isEqualTo("x1 effort to fix updated");
}
@Test
// Add a user tag
tester.get(RuleUpdater.class).update(RuleUpdate.createForPluginRule(rule.key())
- .setTags(newHashSet("tag2")),
+ .setTags(newHashSet("user-tag")),
UserSession.get());
dbSession.clearCache();
// Verify tags
Rule ruleUpdated = index.getByKey(RuleTesting.XOO_X1);
assertThat(ruleUpdated.systemTags()).contains("tag1");
- assertThat(ruleUpdated.tags()).contains("tag2");
+ assertThat(ruleUpdated.tags()).contains("user-tag");
// The plugin X1 will be updated
rulesDefinition.includeX1 = false;
// User tag should become a system tag
Rule ruleReloaded = index.getByKey(RuleTesting.XOO_X1);
- assertThat(ruleReloaded.systemTags()).contains("tag1", "tag2");
+ assertThat(ruleReloaded.systemTags()).contains("tag1", "tag2", "user-tag");
assertThat(ruleUpdated.tags()).isEmpty();
}
.setHtmlDescription("x1 desc updated")
.setSeverity(Severity.INFO)
.setEffortToFixDescription("x1 effort to fix updated")
- .setTags("tag1", "tag2");
+ .setTags("tag1", "tag2", "user-tag");
x1Rule.createParam("acceptWhitespace")
.setType(RuleParamType.BOOLEAN)
.setDefaultValue("true")