diff options
author | Julien Lancelot <julien.lancelot@gmail.com> | 2013-05-07 11:22:12 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@gmail.com> | 2013-05-07 11:22:12 +0200 |
commit | 35aaa0091d1319da83dcfc558921ca7dd8689757 (patch) | |
tree | e03664abeb7c5b3b3480517bdd9b733ceb707c87 /sonar-ws-client/src/test/java/org/sonar | |
parent | 9d6b148aea0128fbf5d92a9abdb56031b10de972 (diff) | |
download | sonarqube-35aaa0091d1319da83dcfc558921ca7dd8689757.tar.gz sonarqube-35aaa0091d1319da83dcfc558921ca7dd8689757.zip |
SONAR-3755 Add action plans to issue query and add WS to add action plan to issue
Diffstat (limited to 'sonar-ws-client/src/test/java/org/sonar')
-rw-r--r-- | sonar-ws-client/src/test/java/org/sonar/wsclient/issue/DefaultIssueClientTest.java | 20 | ||||
-rw-r--r-- | sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueQueryTest.java | 5 |
2 files changed, 24 insertions, 1 deletions
diff --git a/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/DefaultIssueClientTest.java b/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/DefaultIssueClientTest.java index 2c0fdaea03f..a098d39e2c9 100644 --- a/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/DefaultIssueClientTest.java +++ b/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/DefaultIssueClientTest.java @@ -92,6 +92,26 @@ public class DefaultIssueClientTest { } @Test + public void should_plan() { + HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url(), null, null); + + IssueClient client = new DefaultIssueClient(requestFactory); + client.plan("ABCDE", "DEFGH"); + + assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/plan?issue=ABCDE&plan=DEFGH"); + } + + @Test + public void should_unplan() { + HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url(), null, null); + + IssueClient client = new DefaultIssueClient(requestFactory); + client.plan("ABCDE", null); + + assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/plan?issue=ABCDE"); + } + + @Test public void should_create_issue() { HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url(), null, null); diff --git a/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueQueryTest.java b/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueQueryTest.java index 7daca96782d..ff001a067ad 100644 --- a/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueQueryTest.java +++ b/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueQueryTest.java @@ -42,6 +42,7 @@ public class IssueQueryTest { .componentRoots("struts") .resolutions("FIXED", "FALSE-POSITIVE") .rules("squid:AvoidCycle") + .actionPlans("ABC") .statuses("OPEN", "CLOSED") .severities("BLOCKER", "INFO") .userLogins("login1", "login2") @@ -50,13 +51,15 @@ public class IssueQueryTest { .pageSize(5) .pageIndex(4); - assertThat(query.urlParams()).hasSize(15); + assertThat(query.urlParams()).hasSize(16); assertThat(query.urlParams()).includes(entry("issues", "ABCDE,FGHIJ")); assertThat(query.urlParams()).includes(entry("assignees", "arthur,perceval")); assertThat(query.urlParams()).includes(entry("assigned", true)); assertThat(query.urlParams()).includes(entry("planned", true)); assertThat(query.urlParams()).includes(entry("components", "Action.java,Filter.java")); assertThat(query.urlParams()).includes(entry("componentRoots", "struts")); + assertThat(query.urlParams()).includes(entry("rules", "squid:AvoidCycle")); + assertThat(query.urlParams()).includes(entry("actionPlans", "ABC")); assertThat(query.urlParams()).includes(entry("resolutions", "FIXED,FALSE-POSITIVE")); assertThat(query.urlParams()).includes(entry("statuses", "OPEN,CLOSED")); assertThat(query.urlParams()).includes(entry("severities", "BLOCKER,INFO")); |