summaryrefslogtreecommitdiffstats
path: root/sonar-ws-client
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2013-10-01 21:56:16 +0200
committerJulien Lancelot <julien.lancelot@gmail.com>2013-10-01 21:56:16 +0200
commitc66ed023d5ef8de630557081b582dbde562eb3ee (patch)
tree40b6becce3d1ca9fcf2cbef1d9c35d6780c18f3d /sonar-ws-client
parent4887d9c4787f4bb4b15ba232d636df5a78e657a6 (diff)
downloadsonarqube-c66ed023d5ef8de630557081b582dbde562eb3ee.tar.gz
sonarqube-c66ed023d5ef8de630557081b582dbde562eb3ee.zip
SONAR-4716 Add remediation cost when creating issues
Diffstat (limited to 'sonar-ws-client')
-rw-r--r--sonar-ws-client/src/main/java/org/sonar/wsclient/issue/Issue.java4
-rw-r--r--sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssue.java5
-rw-r--r--sonar-ws-client/src/test/java/org/sonar/wsclient/issue/internal/IssueJsonParserTest.java3
-rw-r--r--sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/search.json1
4 files changed, 11 insertions, 2 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 93aec19c148..c88a9a228e0 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
@@ -20,7 +20,6 @@
package org.sonar.wsclient.issue;
import javax.annotation.CheckForNull;
-
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -52,6 +51,9 @@ public interface Issue {
@CheckForNull
Double effortToFix();
+ @CheckForNull
+ Long remediationCost();
+
String status();
/**
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 36f25bc8d30..2f83632ab17 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
@@ -75,6 +75,11 @@ public class DefaultIssue implements Issue {
return JsonUtils.getDouble(json, "effortToFix");
}
+ @CheckForNull
+ public Long remediationCost() {
+ return JsonUtils.getLong(json, "remediationCost");
+ }
+
public String status() {
return JsonUtils.getString(json, "status");
}
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 725405444ab..4e95e9dcbe0 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
@@ -27,7 +27,6 @@ import org.sonar.wsclient.issue.*;
import org.sonar.wsclient.user.User;
import java.util.List;
-import java.util.TimeZone;
import static org.fest.assertions.Assertions.assertThat;
@@ -52,6 +51,7 @@ public class IssueJsonParserTest {
assertThat(first.assignee()).isEqualTo("karadoc");
assertThat(first.message()).isEqualTo("the message");
assertThat(first.effortToFix()).isEqualTo(4.2);
+ assertThat(first.remediationCost()).isEqualTo(10L);
assertThat(first.reporter()).isEqualTo("perceval");
assertThat(first.author()).isEqualTo("pirlouis");
assertThat(first.actionPlan()).isEqualTo("9450b10c-e725-48b8-bf01-acdec751c491");
@@ -67,6 +67,7 @@ public class IssueJsonParserTest {
assertThat(second.key()).isEqualTo("FGHIJ");
assertThat(second.line()).isNull();
assertThat(second.effortToFix()).isNull();
+ assertThat(second.remediationCost()).isNull();
assertThat(second.reporter()).isNull();
assertThat(second.author()).isNull();
assertThat(second.attribute("JIRA")).isNull();
diff --git a/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/search.json b/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/search.json
index 8c8505f5d73..e1f131c2f96 100644
--- a/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/search.json
+++ b/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/internal/IssueJsonParserTest/search.json
@@ -11,6 +11,7 @@
"status": "OPEN",
"assignee": "karadoc",
"effortToFix": 4.2,
+ "remediationCost": 10,
"message": "the message",
"title": "the title",
"reporter": "perceval",