diff options
author | Julien Lancelot <julien.lancelot@gmail.com> | 2013-04-24 17:43:59 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@gmail.com> | 2013-04-24 17:43:59 +0200 |
commit | f866cc7686a634a6f9302d8b01647cf2e0242902 (patch) | |
tree | 75943edf018b552d153d3c62c8e6f5f1cb9352f0 /sonar-ws-client | |
parent | 51218df0a85b38643a1f31fc920f7e084ad6e8e1 (diff) | |
download | sonarqube-f866cc7686a634a6f9302d8b01647cf2e0242902.tar.gz sonarqube-f866cc7686a634a6f9302d8b01647cf2e0242902.zip |
SONAR-3755 Add sort in IssueQuery
Diffstat (limited to 'sonar-ws-client')
-rw-r--r-- | sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueQuery.java | 10 | ||||
-rw-r--r-- | sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueQueryTest.java | 6 |
2 files changed, 15 insertions, 1 deletions
diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueQuery.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueQuery.java index 34b822230f5..e4d38dc3bef 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueQuery.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueQuery.java @@ -90,6 +90,16 @@ public class IssueQuery { return this; } + public IssueQuery sort(String sort) { + params.put("sort", sort); + return this; + } + + public IssueQuery asc(boolean asc) { + params.put("asc", asc); + return this; + } + public IssueQuery pageSize(int pageSize) { params.put("pageSize", pageSize); return this; 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 a82a6658f1b..4a37fed1e80 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 @@ -43,10 +43,12 @@ public class IssueQueryTest { .statuses("OPEN", "CLOSED") .severities("BLOCKER", "INFO") .userLogins("login1", "login2") + .sort("assignee") + .asc(false) .pageSize(5) .pageIndex(4); - assertThat(query.urlParams()).hasSize(11); + assertThat(query.urlParams()).hasSize(13); assertThat(query.urlParams()).includes(entry("keys", "ABCDE,FGHIJ")); assertThat(query.urlParams()).includes(entry("assignees", "arthur,perceval")); assertThat(query.urlParams()).includes(entry("components", "Action.java,Filter.java")); @@ -55,6 +57,8 @@ public class IssueQueryTest { assertThat(query.urlParams()).includes(entry("statuses", "OPEN,CLOSED")); assertThat(query.urlParams()).includes(entry("severities", "BLOCKER,INFO")); assertThat(query.urlParams()).includes(entry("userLogins", "login1,login2")); + assertThat(query.urlParams()).includes(entry("sort", "assignee")); + assertThat(query.urlParams()).includes(entry("asc", false)); assertThat(query.urlParams()).includes(entry("pageSize", 5)); assertThat(query.urlParams()).includes(entry("pageIndex", 4)); } |