Search in sources :

Example 1 with SearchProjectsRequest

use of org.sonar.server.component.ws.SearchProjectsAction.SearchProjectsRequest in project sonarqube by SonarSource.

the class SearchProjectsActionTest method call.

private SearchProjectsWsResponse call(RequestBuilder requestBuilder) {
    SearchProjectsRequest wsRequest = requestBuilder.build();
    TestRequest httpRequest = ws.newRequest();
    ofNullable(wsRequest.getFilter()).ifPresent(filter -> httpRequest.setParam(PARAM_FILTER, filter));
    ofNullable(wsRequest.getSort()).ifPresent(sort -> httpRequest.setParam(SORT, sort));
    ofNullable(wsRequest.getAsc()).ifPresent(asc -> httpRequest.setParam(ASCENDING, Boolean.toString(asc)));
    httpRequest.setParam(PAGE, String.valueOf(wsRequest.getPage()));
    httpRequest.setParam(PAGE_SIZE, String.valueOf(wsRequest.getPageSize()));
    httpRequest.setParam(FACETS, Joiner.on(",").join(wsRequest.getFacets()));
    httpRequest.setParam(FIELDS, Joiner.on(",").join(wsRequest.getAdditionalFields()));
    return httpRequest.executeProtobuf(SearchProjectsWsResponse.class);
}
Also used : SearchProjectsRequest(org.sonar.server.component.ws.SearchProjectsAction.SearchProjectsRequest) TestRequest(org.sonar.server.ws.TestRequest)

Aggregations

SearchProjectsRequest (org.sonar.server.component.ws.SearchProjectsAction.SearchProjectsRequest)1 TestRequest (org.sonar.server.ws.TestRequest)1