use of org.sonar.server.ws.TestRequest in project sonarqube by SonarSource.
the class ChangelogActionTest method call.
private ChangelogWsResponse call(@Nullable String issueKey) {
TestRequest request = tester.newRequest().setMediaType(MediaTypes.PROTOBUF);
setNullable(issueKey, e -> request.setParam("issue", e));
try {
return ChangelogWsResponse.parseFrom(request.execute().getInputStream());
} catch (IOException e) {
throw Throwables.propagate(e);
}
}
use of org.sonar.server.ws.TestRequest in project sonarqube by SonarSource.
the class SetSeverityActionTest method call.
private TestResponse call(@Nullable String issueKey, @Nullable String severity) {
TestRequest request = tester.newRequest();
setNullable(issueKey, issue -> request.setParam("issue", issue));
setNullable(severity, value -> request.setParam("severity", value));
return request.execute();
}
use of org.sonar.server.ws.TestRequest in project sonarqube by SonarSource.
the class SetTypeActionTest method call.
private TestResponse call(@Nullable String issueKey, @Nullable String type) {
TestRequest request = tester.newRequest();
setNullable(issueKey, issue -> request.setParam("issue", issue));
setNullable(type, t -> request.setParam("type", t));
return request.execute();
}
use of org.sonar.server.ws.TestRequest 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);
}
}
use of org.sonar.server.ws.TestRequest in project sonarqube by SonarSource.
the class AddActionTest method call.
private TestResponse call(AddRequest.Builder wsRequestBuilder) {
AddRequest wsRequest = wsRequestBuilder.build();
TestRequest request = ws.newRequest();
request.setParam(PARAM_TYPE, wsRequest.getType());
setNullable(wsRequest.getChannel(), channel -> request.setParam(PARAM_CHANNEL, channel));
setNullable(wsRequest.getProject(), project -> request.setParam(PARAM_PROJECT, project));
return request.execute();
}
Aggregations