Search in sources :

Example 1 with CreateEventRequest

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);
    }
}
Also used : CreateEventRequest(org.sonarqube.ws.client.projectanalysis.CreateEventRequest) IOException(java.io.IOException) TestRequest(org.sonar.server.ws.TestRequest)

Example 2 with CreateEventRequest

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);
}
Also used : CreateEventRequest(org.sonarqube.ws.client.projectanalysis.CreateEventRequest) CreateEventResponse(org.sonarqube.ws.ProjectAnalyses.CreateEventResponse)

Aggregations

CreateEventRequest (org.sonarqube.ws.client.projectanalysis.CreateEventRequest)2 IOException (java.io.IOException)1 TestRequest (org.sonar.server.ws.TestRequest)1 CreateEventResponse (org.sonarqube.ws.ProjectAnalyses.CreateEventResponse)1