]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3755 add author to issue ws response
authorSimon Brandhof <simon.brandhof@gmail.com>
Mon, 3 Jun 2013 14:55:05 +0000 (16:55 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Mon, 3 Jun 2013 15:00:05 +0000 (17:00 +0200)
sonar-server/src/main/webapp/WEB-INF/app/models/issue.rb
sonar-ws-client/src/main/java/org/sonar/wsclient/issue/Issue.java
sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueJsonParserTest.java
sonar-ws-client/src/test/resources/org/sonar/wsclient/issue/IssueParserTest/search.json

index 15238c29c66bfb62b065cd6c7714dff104a17114..49436c1582e13ede9a60d6f85be8a0b2120b7107 100644 (file)
@@ -34,6 +34,7 @@ class Issue
     hash[:effortToFix] = issue.effortToFix.to_f if issue.effortToFix
     hash[:reporter] = issue.reporter if issue.reporter
     hash[:assignee] = issue.assignee if issue.assignee
+    hash[:author] = issue.authorLogin if issue.authorLogin
     hash[:actionPlan] = issue.actionPlanKey if issue.actionPlanKey
     hash[:creationDate] = Api::Utils.format_datetime(issue.creationDate) if issue.creationDate
     hash[:updateDate] = Api::Utils.format_datetime(issue.updateDate) if issue.updateDate
index 7e8ca71744e57b4bfcb74a095de0d327790f55bc..b5b555087e59918e05a08b78d08bf3804006fa78 100644 (file)
@@ -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");
index a33d60931905bbe697f1e5f374e9c3b47e298979..09cb39417421ab7cce2ed6e2923d73f03eb28970 100644 (file)
@@ -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();
index 40e1a7ab1444e7eec7b0a0aecf208512062e08cf..8c8505f5d73cdfe58953f0f7867a9d4fc64fd3b6 100644 (file)
@@ -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",