private void newRequest(
      @Nullable String userLogin, @Nullable String templateKey, @Nullable String permission) {
    TestRequest request = ws.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();
  }
예제 #2
0
  private SearchMyProjectsWsResponse call_ws(TestRequest request) {
    InputStream responseStream =
        request.setMediaType(MediaTypes.PROTOBUF).execute().getInputStream();

    try {
      return SearchMyProjectsWsResponse.parseFrom(responseStream);
    } catch (IOException e) {
      throw Throwables.propagate(e);
    }
  }