aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws-client
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2013-04-24 17:43:59 +0200
committerJulien Lancelot <julien.lancelot@gmail.com>2013-04-24 17:43:59 +0200
commitf866cc7686a634a6f9302d8b01647cf2e0242902 (patch)
tree75943edf018b552d153d3c62c8e6f5f1cb9352f0 /sonar-ws-client
parent51218df0a85b38643a1f31fc920f7e084ad6e8e1 (diff)
downloadsonarqube-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.java10
-rw-r--r--sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueQueryTest.java6
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));
}