use of org.sonarqube.ws.client.projectanalysis.CreateEventRequest in project sonarqube by SonarSource.
the class CreateEventActionTest method call.
private CreateEventResponse call(CreateEventRequest.Builder requestBuilder) {
CreateEventRequest request = requestBuilder.build();
TestRequest httpRequest = ws.newRequest().setMethod(POST.name()).setMediaType(MediaTypes.PROTOBUF);
httpRequest.setParam(PARAM_CATEGORY, request.getCategory().name()).setParam(PARAM_NAME, request.getName()).setParam(PARAM_ANALYSIS, request.getAnalysis());
try {
return CreateEventResponse.parseFrom(httpRequest.execute().getInputStream());
} catch (IOException e) {
throw Throwables.propagate(e);
}
}
use of org.sonarqube.ws.client.projectanalysis.CreateEventRequest in project sonarqube by SonarSource.
the class CreateEventAction method handle.
@Override
public void handle(Request httpRequest, Response httpResponse) throws Exception {
CreateEventRequest request = toAddEventRequest(httpRequest);
CreateEventResponse response = doHandle(request);
writeProtobuf(response, httpRequest, httpResponse);
}
Aggregations