use of org.sonar.server.ws.TestRequest in project sonarqube by SonarSource.
the class CreateActionTest method executeJsonRequest.
private String executeJsonRequest(@Nullable String name, @Nullable String key, @Nullable String description, @Nullable String url, @Nullable String avatar) {
TestRequest request = wsTester.newRequest().setMediaType(MediaTypes.JSON);
populateRequest(name, key, description, url, avatar, request);
return request.execute().getInput();
}
use of org.sonar.server.ws.TestRequest in project sonarqube by SonarSource.
the class RemoveActionTest 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();
}
use of org.sonar.server.ws.TestRequest in project sonarqube by SonarSource.
the class SearchActionTest method executeRequest.
private List<Organization> executeRequest(@Nullable Integer page, @Nullable Integer pageSize, String... keys) {
TestRequest request = wsTester.newRequest().setMediaType(MediaTypes.PROTOBUF);
populateRequest(request, page, pageSize, keys);
try {
return Organizations.SearchWsResponse.parseFrom(request.execute().getInputStream()).getOrganizationsList();
} catch (IOException e) {
throw new IllegalStateException(e);
}
}
use of org.sonar.server.ws.TestRequest in project sonarqube by SonarSource.
the class SearchActionTest method executeJsonRequest.
private String executeJsonRequest(@Nullable Integer page, @Nullable Integer pageSize, String... keys) {
TestRequest request = wsTester.newRequest().setMediaType(MediaTypes.JSON);
populateRequest(request, page, pageSize, keys);
return request.execute().getInput();
}
use of org.sonar.server.ws.TestRequest in project sonarqube by SonarSource.
the class AddUserToTemplateActionTest method newRequest.
private void newRequest(@Nullable String userLogin, @Nullable String templateKey, @Nullable String permission) throws Exception {
TestRequest request = newRequest();
if (userLogin != null) {
request.setParam(PARAM_USER_LOGIN, userLogin);
}
if (templateKey != null) {
request.setParam(org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID, templateKey);
}
if (permission != null) {
request.setParam(PARAM_PERMISSION, permission);
}
request.execute();
}
Aggregations