use of org.sonarqube.ws.client.GetRequest in project sonarqube by SonarSource.
the class ProjectAnalysisServiceTest method search.
@Test
public void search() {
underTest.search(SearchRequest.builder().setProject("project").setCategory(QUALITY_GATE).setPage(10).setPageSize(50).build());
GetRequest getRequest = serviceTester.getGetRequest();
assertThat(serviceTester.getGetParser()).isSameAs(ProjectAnalyses.SearchResponse.parser());
serviceTester.assertThat(getRequest).hasParam(PARAM_PROJECT, "project").hasParam(PARAM_CATEGORY, QUALITY_GATE.name()).hasParam(PAGE, 10).hasParam(PAGE_SIZE, 50).andNoOtherParam();
}
use of org.sonarqube.ws.client.GetRequest in project sonarqube by SonarSource.
the class ProjectAnalysisServiceTest method search_without_category.
@Test
public void search_without_category() {
underTest.search(SearchRequest.builder().setProject("project").setPage(10).setPageSize(50).build());
GetRequest getRequest = serviceTester.getGetRequest();
assertThat(serviceTester.getGetParser()).isSameAs(ProjectAnalyses.SearchResponse.parser());
serviceTester.assertThat(getRequest).hasParam(PARAM_PROJECT, "project").hasParam(PAGE, 10).hasParam(PAGE_SIZE, 50).andNoOtherParam();
}
use of org.sonarqube.ws.client.GetRequest in project sonarqube by SonarSource.
the class ProjectAnalysisService method search.
public SearchResponse search(SearchRequest searchRequest) {
EventCategory eventCategory = searchRequest.getCategory();
GetRequest request = new GetRequest(path("search")).setParam(PARAM_PROJECT, searchRequest.getProject()).setParam(PARAM_CATEGORY, eventCategory == null ? null : eventCategory.name()).setParam(PAGE, searchRequest.getPage()).setParam(PAGE_SIZE, searchRequest.getPageSize());
return call(request, SearchResponse.parser());
}
use of org.sonarqube.ws.client.GetRequest in project sonarqube by SonarSource.
the class LicensesServiceTest method list_definitions.
@Test
public void list_definitions() {
underTest.list();
GetRequest getRequest = serviceTester.getGetRequest();
assertThat(serviceTester.getGetParser()).isSameAs(ListWsResponse.parser());
serviceTester.assertThat(getRequest).andNoOtherParam();
}
use of org.sonarqube.ws.client.GetRequest in project sonarqube by SonarSource.
the class MeasuresServiceTest method search_history.
@Test
public void search_history() {
SearchHistoryRequest request = SearchHistoryRequest.builder().setComponent(VALUE_COMPONENT).setMetrics(VALUE_METRICS).setFrom(VALUE_FROM).setTo(VALUE_TO).setPage(VALUE_PAGE).setPageSize(VALUE_PAGE_SIZE).build();
underTest.searchHistory(request);
GetRequest getRequest = serviceTester.getGetRequest();
assertThat(serviceTester.getGetParser()).isSameAs(WsMeasures.SearchHistoryResponse.parser());
serviceTester.assertThat(getRequest).hasParam(PARAM_COMPONENT, VALUE_COMPONENT).hasParam(PARAM_METRICS, "ncloc,complexity").hasParam(PARAM_FROM, VALUE_FROM).hasParam(PARAM_TO, VALUE_TO).hasParam("p", VALUE_PAGE).hasParam("ps", VALUE_PAGE_SIZE).andNoOtherParam();
}
Aggregations