From 58dd4353773af1c010facbcc05c17cd1cac5b9be Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Lievremont Date: Fri, 28 Nov 2014 17:25:20 +0100 Subject: [PATCH] SONAR-5742 Add ignorePaging parameter handle to WS client (for IT) --- .../main/java/org/sonar/wsclient/issue/IssueQuery.java | 9 +++++++++ .../java/org/sonar/wsclient/issue/IssueQueryTest.java | 6 ++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueQuery.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueQuery.java index 304fee715b9..a5d1817b570 100644 --- a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueQuery.java +++ b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueQuery.java @@ -151,6 +151,15 @@ public class IssueQuery { return this; } + /** + * Only valid with one component, do not use in the general case + * @since 5.0 + */ + public IssueQuery ignorePaging(boolean ignorePaging) { + params.put("ignorePaging", ignorePaging); + return this; + } + private IssueQuery addParam(String key, String[] values) { if (values != null) { params.put(key, EncodingUtils.toQueryParam(values)); diff --git a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueQueryTest.java b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueQueryTest.java index c4d0e209d14..ae1aadd3704 100644 --- a/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueQueryTest.java +++ b/server/sonar-ws-client/src/test/java/org/sonar/wsclient/issue/IssueQueryTest.java @@ -59,9 +59,10 @@ public class IssueQueryTest { .sort("ASSIGNEE") .asc(false) .pageSize(5) - .pageIndex(4); + .pageIndex(4) + .ignorePaging(true); - assertThat(query.urlParams()).hasSize(22); + assertThat(query.urlParams()).hasSize(23); assertThat(query.urlParams()).includes(entry("issues", "ABCDE,FGHIJ")); assertThat(query.urlParams()).includes(entry("assignees", "arthur,perceval")); assertThat(query.urlParams()).includes(entry("assigned", true)); @@ -84,6 +85,7 @@ public class IssueQueryTest { assertThat(query.urlParams()).includes(entry("asc", false)); assertThat(query.urlParams()).includes(entry("pageSize", 5)); assertThat(query.urlParams()).includes(entry("pageIndex", 4)); + assertThat(query.urlParams()).includes(entry("ignorePaging", true)); } @Test -- 2.39.5