summaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2013-12-02 17:42:48 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2013-12-02 17:42:59 +0100
commit9774b1e57f8a947591e32fcab63bb7bee6147378 (patch)
treeeafcfc896c85f70a798a5a21e09ea1489f658ad8 /sonar-batch
parent76cbf664056ce6dbe7f0275e2a0a0ad1c721bdca (diff)
downloadsonarqube-9774b1e57f8a947591e32fcab63bb7bee6147378.tar.gz
sonarqube-9774b1e57f8a947591e32fcab63bb7bee6147378.zip
Update message to display when not effort to fix on constant_issue requirement
Diffstat (limited to 'sonar-batch')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/technicaldebt/TechnicalDebtCalculator.java3
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/technicaldebt/TechnicalDebtCalculatorTest.java2
2 files changed, 3 insertions, 2 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/technicaldebt/TechnicalDebtCalculator.java b/sonar-batch/src/main/java/org/sonar/batch/technicaldebt/TechnicalDebtCalculator.java
index ded5a20aa01..996cd321c99 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/technicaldebt/TechnicalDebtCalculator.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/technicaldebt/TechnicalDebtCalculator.java
@@ -46,7 +46,8 @@ public class TechnicalDebtCalculator implements BatchExtension {
Requirement requirement = model.requirementsByRule(issue.ruleKey());
if (requirement != null) {
if (requirement.function().equals(DefaultRequirement.CONSTANT_ISSUE) && issue.effortToFix() != null) {
- throw new IllegalArgumentException("The implementation of rule '"+ issue.ruleKey() +"' defines an effort to fix whereas its requirement is set to 'constant/issue' - which is not compatible.");
+ throw new IllegalArgumentException("Requirement for '"+ issue.ruleKey() +"' can not use 'Constant/issue' remediation function " +
+ "because this rule does not have a fixed remediation cost.");
}
return converter.fromMinutes(calculTechnicalDebt(requirement, issue));
}
diff --git a/sonar-batch/src/test/java/org/sonar/batch/technicaldebt/TechnicalDebtCalculatorTest.java b/sonar-batch/src/test/java/org/sonar/batch/technicaldebt/TechnicalDebtCalculatorTest.java
index b4b5f55bfff..ccb9554d225 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/technicaldebt/TechnicalDebtCalculatorTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/technicaldebt/TechnicalDebtCalculatorTest.java
@@ -148,7 +148,7 @@ public class TechnicalDebtCalculatorTest {
fail();
} catch (Exception e) {
assertThat(e).isInstanceOf(IllegalArgumentException.class)
- .hasMessage("The implementation of rule 'squid:AvoidCycle' defines an effort to fix whereas its requirement is set to 'constant/issue' - which is not compatible.");
+ .hasMessage("Requirement for 'squid:AvoidCycle' can not use 'Constant/issue' remediation function because this rule does not have a fixed remediation cost.");
}
verifyZeroInteractions(converter);
}