diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2017-02-16 17:45:52 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2017-02-17 09:43:54 +0100 |
commit | caf680a41651e04268b7bd1d26152d5428e574d9 (patch) | |
tree | 87ceea69b5cb80e48a9ce8d83b08fd29122abafc /server/sonar-server/src | |
parent | c00a059069b34fc14716a5fb40f6eaa5a2cddfe3 (diff) | |
download | sonarqube-caf680a41651e04268b7bd1d26152d5428e574d9.tar.gz sonarqube-caf680a41651e04268b7bd1d26152d5428e574d9.zip |
SONAR-8804 Use api/projects/search in projects admin page
Diffstat (limited to 'server/sonar-server/src')
-rw-r--r-- | server/sonar-server/src/main/java/org/sonar/server/project/ws/SearchAction.java | 3 | ||||
-rw-r--r-- | server/sonar-server/src/test/java/org/sonar/server/project/ws/SearchActionTest.java | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/project/ws/SearchAction.java b/server/sonar-server/src/main/java/org/sonar/server/project/ws/SearchAction.java index 1d7aa790a68..3ca4f103486 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/project/ws/SearchAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/project/ws/SearchAction.java @@ -44,6 +44,7 @@ import static org.sonar.server.ws.WsUtils.writeProtobuf; import static org.sonarqube.ws.WsProjects.SearchWsResponse.Component; import static org.sonarqube.ws.WsProjects.SearchWsResponse.newBuilder; import static org.sonarqube.ws.client.project.ProjectsWsParameters.ACTION_SEARCH; +import static org.sonarqube.ws.client.project.ProjectsWsParameters.MAX_PAGE_SIZE; import static org.sonarqube.ws.client.project.ProjectsWsParameters.PARAM_ORGANIZATION; import static org.sonarqube.ws.client.project.ProjectsWsParameters.PARAM_QUALIFIERS; @@ -68,7 +69,7 @@ public class SearchAction implements ProjectsWsAction { .setDescription("Search for projects or views.<br>" + "Requires 'System Administrator' permission") .setInternal(true) - .addPagingParams(100) + .addPagingParams(100, MAX_PAGE_SIZE) .addSearchQuery("sona", "component names", "component keys") .setResponseExample(getClass().getResource("search-example.json")) .setHandler(this); diff --git a/server/sonar-server/src/test/java/org/sonar/server/project/ws/SearchActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/project/ws/SearchActionTest.java index 9b62ee686fd..1aa03aa609f 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/project/ws/SearchActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/project/ws/SearchActionTest.java @@ -24,7 +24,6 @@ import com.google.common.base.Throwables; import java.io.IOException; import java.net.URISyntaxException; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import org.assertj.core.api.Assertions; import org.junit.Rule; @@ -64,7 +63,6 @@ import static org.sonar.db.component.ComponentTesting.newView; import static org.sonar.test.JsonAssert.assertJson; import static org.sonarqube.ws.MediaTypes.PROTOBUF; import static org.sonarqube.ws.client.project.ProjectsWsParameters.PARAM_ORGANIZATION; -import static org.sonarqube.ws.client.project.ProjectsWsParameters.PARAM_QUALIFIERS; public class SearchActionTest { @@ -253,7 +251,7 @@ public class SearchActionTest { WebService.Param psParam = action.param("ps"); assertThat(psParam.isRequired()).isFalse(); assertThat(psParam.defaultValue()).isEqualTo("100"); - assertThat(psParam.description()).isEqualTo("Page size. Must be greater than 0."); + assertThat(psParam.description()).isEqualTo("Page size. Must be greater than 0 and less than 500"); } @Test |