use of org.sonarqube.ws.client.measure.SearchHistoryRequest in project sonarqube by SonarSource.
the class SearchHistoryActionTest method call.
private SearchHistoryResponse call() {
SearchHistoryRequest wsRequest = this.wsRequest.build();
TestRequest request = ws.newRequest().setMediaType(MediaTypes.PROTOBUF);
request.setParam(PARAM_COMPONENT, wsRequest.getComponent());
request.setParam(PARAM_METRICS, String.join(",", wsRequest.getMetrics()));
setNullable(wsRequest.getFrom(), from -> request.setParam(PARAM_FROM, from));
setNullable(wsRequest.getTo(), to -> request.setParam(PARAM_TO, to));
setNullable(wsRequest.getPage(), p -> request.setParam(Param.PAGE, String.valueOf(p)));
setNullable(wsRequest.getPageSize(), ps -> request.setParam(Param.PAGE_SIZE, String.valueOf(ps)));
try {
return SearchHistoryResponse.parseFrom(request.execute().getInputStream());
} catch (IOException e) {
throw Throwables.propagate(e);
}
}
Aggregations