aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws-client
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2013-06-03 16:55:05 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2013-06-03 17:00:05 +0200
commit473b592946fa31843073bcc9e469bc43675cd2ab (patch)
tree1612823ba43e25503ff293dd0a78aff98e536cd7 /sonar-ws-client
parent8eb8931a7b241260ae730c2582446abddd397f4c (diff)
downloadsonarqube-473b592946fa31843073bcc9e469bc43675cd2ab.tar.gz
sonarqube-473b592946fa31843073bcc9e469bc43675cd2ab.zip
SONAR-3755 add author to issue ws response
Diffstat (limited to 'sonar-ws-client')
-rw-r--r--sonar-ws-client/src/main/java/org/sonar/wsclient/issue/Issue.java8
-rw-r--r--sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueJsonParserTest.java2
-rw-r--r--sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/search.json1
3 files changed, 11 insertions, 0 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 7e8ca71744e..b5b555087e5 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
@@ -99,6 +99,14 @@ public class Issue {
return JsonUtils.getString(json, "assignee");
}
+ /**
+ * SCM account
+ */
+ @CheckForNull
+ public String author() {
+ return JsonUtils.getString(json, "author");
+ }
+
@CheckForNull
public String actionPlan() {
return JsonUtils.getString(json, "actionPlan");
diff --git a/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueJsonParserTest.java b/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueJsonParserTest.java
index a33d6093190..09cb3941742 100644
--- a/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueJsonParserTest.java
+++ b/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueJsonParserTest.java
@@ -49,6 +49,7 @@ public class IssueJsonParserTest {
assertThat(first.message()).isEqualTo("the message");
assertThat(first.effortToFix()).isEqualTo(4.2);
assertThat(first.reporter()).isEqualTo("perceval");
+ assertThat(first.author()).isEqualTo("pirlouis");
assertThat(first.actionPlan()).isEqualTo("9450b10c-e725-48b8-bf01-acdec751c491");
assertThat(first.creationDate()).isNotNull();
assertThat(first.updateDate()).isNotNull();
@@ -63,6 +64,7 @@ public class IssueJsonParserTest {
assertThat(second.line()).isNull();
assertThat(second.effortToFix()).isNull();
assertThat(second.reporter()).isNull();
+ assertThat(second.author()).isNull();
assertThat(second.attribute("JIRA")).isNull();
assertThat(second.attributes()).isEmpty();
assertThat(second.comments()).isEmpty();
diff --git a/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/search.json b/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/search.json
index 40e1a7ab144..8c8505f5d73 100644
--- a/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/search.json
+++ b/sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/search.json
@@ -14,6 +14,7 @@
"message": "the message",
"title": "the title",
"reporter": "perceval",
+ "author": "pirlouis",
"actionPlan": "9450b10c-e725-48b8-bf01-acdec751c491",
"creationDate": "2013-05-18T12:45:34+0200",
"updateDate": "2013-05-18T13:45:34+0200",