From 071dd097a358d5750b2cc4be0f4216df111eb2d6 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Thu, 20 Jun 2019 17:24:52 +0200 Subject: [PATCH] SONAR-12221 Add pagination to api/qualitygates/search --- .../ProjectQgateAssociationDto.java | 16 ++-- .../ProjectQgateAssociationMapper.xml | 2 +- .../ProjectQgateAssociationDaoTest.java | 8 +- .../ProjectQgateAssociationDtoTest.java | 54 ------------ .../server/qualitygate/ws/SearchAction.java | 84 ++++++++---------- .../server/qualitygate/ws/search-example.json | 10 ++- .../qualitygate/ws/SearchActionTest.java | 86 ++++++++++++------- .../src/main/protobuf/ws-qualitygates.proto | 5 ++ 8 files changed, 118 insertions(+), 147 deletions(-) delete mode 100644 server/sonar-db-dao/src/test/java/org/sonar/db/qualitygate/ProjectQgateAssociationDtoTest.java diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/qualitygate/ProjectQgateAssociationDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/qualitygate/ProjectQgateAssociationDto.java index 3dd29f1e214..b510eef339f 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/qualitygate/ProjectQgateAssociationDto.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/qualitygate/ProjectQgateAssociationDto.java @@ -28,6 +28,7 @@ import javax.annotation.Nullable; public class ProjectQgateAssociationDto { private Long id; + private String key; private String name; private String gateId; @@ -40,6 +41,15 @@ public class ProjectQgateAssociationDto { return this; } + public String getKey() { + return key; + } + + public ProjectQgateAssociationDto setKey(String key) { + this.key = key; + return this; + } + public String getName() { return name; } @@ -59,10 +69,4 @@ public class ProjectQgateAssociationDto { return this; } - public ProjectQgateAssociation toQgateAssociation() { - return new ProjectQgateAssociation() - .setId(id) - .setName(name) - .setMember(gateId != null); - } } diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/qualitygate/ProjectQgateAssociationMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/qualitygate/ProjectQgateAssociationMapper.xml index a2a05d73d07..547eeeacc09 100644 --- a/server/sonar-db-dao/src/main/resources/org/sonar/db/qualitygate/ProjectQgateAssociationMapper.xml +++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/qualitygate/ProjectQgateAssociationMapper.xml @@ -4,7 +4,7 @@