aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws-client
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2013-11-06 14:38:40 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2013-11-06 14:38:40 +0100
commitb5116218aebe1ae7ca6f3abcd77b507ae3cb5131 (patch)
tree9b256ca26109b39a236ae5cb7e199b021588eafb /sonar-ws-client
parent373924bdca4f3ac6fb21948625678c4238e6e664 (diff)
downloadsonarqube-b5116218aebe1ae7ca6f3abcd77b507ae3cb5131.tar.gz
sonarqube-b5116218aebe1ae7ca6f3abcd77b507ae3cb5131.zip
Rename TechnicalDebt class name to WorkDayDuration and move it to issue internal package
Diffstat (limited to 'sonar-ws-client')
-rw-r--r--sonar-ws-client/src/main/java/org/sonar/wsclient/issue/Issue.java2
-rw-r--r--sonar-ws-client/src/main/java/org/sonar/wsclient/issue/WorkDayDuration.java (renamed from sonar-ws-client/src/main/java/org/sonar/wsclient/issue/TechnicalDebt.java)2
-rw-r--r--sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssue.java8
-rw-r--r--sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssueChangeDiff.java6
-rw-r--r--sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultWorkDayDuration.java (renamed from sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultTechnicalDebt.java)8
-rw-r--r--sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/IssueJsonParserTest.java8
6 files changed, 16 insertions, 18 deletions
diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/Issue.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/Issue.java
index 8f81332bb86..f330e782faa 100644
--- a/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/Issue.java
+++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/Issue.java
@@ -53,7 +53,7 @@ public interface Issue {
Double effortToFix();
@CheckForNull
- TechnicalDebt technicalDebt();
+ WorkDayDuration technicalDebt();
String status();
diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/TechnicalDebt.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/WorkDayDuration.java
index c52d5f3ff3b..1db322bf5e3 100644
--- a/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/TechnicalDebt.java
+++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/WorkDayDuration.java
@@ -22,7 +22,7 @@ package org.sonar.wsclient.issue;
/**
* @since 4.0
*/
-public interface TechnicalDebt {
+public interface WorkDayDuration {
Integer days();
diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssue.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssue.java
index 652decf37f2..a0744230d47 100644
--- a/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssue.java
+++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssue.java
@@ -21,7 +21,7 @@ package org.sonar.wsclient.issue.internal;
import org.sonar.wsclient.issue.Issue;
import org.sonar.wsclient.issue.IssueComment;
-import org.sonar.wsclient.issue.TechnicalDebt;
+import org.sonar.wsclient.issue.WorkDayDuration;
import org.sonar.wsclient.unmarshallers.JsonUtils;
import javax.annotation.CheckForNull;
@@ -78,10 +78,10 @@ public class DefaultIssue implements Issue {
}
@CheckForNull
- public TechnicalDebt technicalDebt() {
- Map technicalDebt = (Map) json.get(DefaultTechnicalDebt.KEY);
+ public WorkDayDuration technicalDebt() {
+ Map technicalDebt = (Map) json.get("technicalDebt");
if (technicalDebt != null) {
- return new DefaultTechnicalDebt(technicalDebt);
+ return new DefaultWorkDayDuration(technicalDebt);
}
return null;
}
diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssueChangeDiff.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssueChangeDiff.java
index 2f57f46653d..289d3dd62e4 100644
--- a/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssueChangeDiff.java
+++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssueChangeDiff.java
@@ -53,17 +53,17 @@ public class DefaultIssueChangeDiff implements IssueChangeDiff {
}
private Object parseValue(String attribute) {
- if (DefaultTechnicalDebt.KEY.equals(key())) {
+ if ("technicalDebt".equals(key())) {
return parseDefaultTechnicalDebt(attribute);
} else {
return JsonUtils.getString(json, attribute);
}
}
- private DefaultTechnicalDebt parseDefaultTechnicalDebt(String attribute){
+ private DefaultWorkDayDuration parseDefaultTechnicalDebt(String attribute){
Map technicalDebt = (Map) json.get(attribute);
if (technicalDebt != null) {
- return new DefaultTechnicalDebt(technicalDebt);
+ return new DefaultWorkDayDuration(technicalDebt);
}
return null;
}
diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultTechnicalDebt.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultWorkDayDuration.java
index 9bdab493bf7..7e2ecc79091 100644
--- a/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultTechnicalDebt.java
+++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultWorkDayDuration.java
@@ -19,7 +19,7 @@
*/
package org.sonar.wsclient.issue.internal;
-import org.sonar.wsclient.issue.TechnicalDebt;
+import org.sonar.wsclient.issue.WorkDayDuration;
import org.sonar.wsclient.unmarshallers.JsonUtils;
import java.util.Map;
@@ -27,13 +27,11 @@ import java.util.Map;
/**
* @since 4.0
*/
-public class DefaultTechnicalDebt implements TechnicalDebt {
-
- public static final String KEY = "technicalDebt";
+public class DefaultWorkDayDuration implements WorkDayDuration {
private final Map json;
- DefaultTechnicalDebt(Map json) {
+ DefaultWorkDayDuration(Map json) {
this.json = json;
}
diff --git a/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/IssueJsonParserTest.java b/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/IssueJsonParserTest.java
index 4acc0bf370e..461268d8fbc 100644
--- a/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/IssueJsonParserTest.java
+++ b/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/IssueJsonParserTest.java
@@ -255,12 +255,12 @@ public class IssueJsonParserTest {
IssueChangeDiff changeDiff = change.diffs().get(0);
assertThat(changeDiff.key()).isEqualTo("technicalDebt");
- TechnicalDebt newTechnicalDebt = (TechnicalDebt) changeDiff.newValue();
+ WorkDayDuration newTechnicalDebt = (WorkDayDuration) changeDiff.newValue();
assertThat(newTechnicalDebt.days()).isEqualTo(2);
assertThat(newTechnicalDebt.hours()).isEqualTo(1);
assertThat(newTechnicalDebt.minutes()).isEqualTo(0);
- TechnicalDebt oldTechnicalDebt = (TechnicalDebt) changeDiff.oldValue();
+ WorkDayDuration oldTechnicalDebt = (WorkDayDuration) changeDiff.oldValue();
assertThat(oldTechnicalDebt.days()).isEqualTo(3);
assertThat(oldTechnicalDebt.hours()).isEqualTo(0);
assertThat(oldTechnicalDebt.minutes()).isEqualTo(10);
@@ -281,12 +281,12 @@ public class IssueJsonParserTest {
IssueChangeDiff changeDiff = change.diffs().get(0);
assertThat(changeDiff.key()).isEqualTo("technicalDebt");
- TechnicalDebt newTechnicalDebt = (TechnicalDebt) changeDiff.newValue();
+ WorkDayDuration newTechnicalDebt = (WorkDayDuration) changeDiff.newValue();
assertThat(newTechnicalDebt.days()).isEqualTo(2);
assertThat(newTechnicalDebt.hours()).isEqualTo(1);
assertThat(newTechnicalDebt.minutes()).isEqualTo(0);
- TechnicalDebt oldTechnicalDebt = (TechnicalDebt) changeDiff.oldValue();
+ WorkDayDuration oldTechnicalDebt = (WorkDayDuration) changeDiff.oldValue();
assertThat(oldTechnicalDebt).isNull();
}