]> source.dussan.org Git - sonarqube.git/commitdiff
Remove legacy sonar-ws code for qualityprofiles
authorDaniel Schwarz <daniel.schwarz@sonarsource.com>
Sat, 2 Dec 2017 15:17:48 +0000 (16:17 +0100)
committerDaniel Schwarz <bartfastiel@users.noreply.github.com>
Wed, 6 Dec 2017 13:40:17 +0000 (14:40 +0100)
39 files changed:
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/QProfileTester.java
sonar-ws/src/main/java/org/sonarqube/ws/client/DefaultWsClient.java
sonar-ws/src/main/java/org/sonarqube/ws/client/WsClient.java
sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/ActivateRuleRequest.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/AddGroupRequest.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/AddProjectRequest.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/AddUserRequest.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/ChangeParentRequest.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/ChangelogRequest.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/CopyRequest.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/CreateRequest.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/QualityProfilesService.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/RemoveGroupRequest.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/RemoveProjectRequest.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/RemoveUserRequest.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/RestoreRequest.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/SearchGroupsRequest.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/SearchRequest.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/SearchUsersRequest.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/SetDefaultRequest.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/ShowRequest.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/QualityprofilesService.java
sonar-ws/src/test/java/org/sonarqube/ws/client/qualityprofile/AddProjectRequestTest.java [deleted file]
sonar-ws/src/test/java/org/sonarqube/ws/client/qualityprofile/CreateRequestTest.java [deleted file]
sonar-ws/src/test/java/org/sonarqube/ws/client/qualityprofile/QualityProfilesServiceTest.java [deleted file]
sonar-ws/src/test/java/org/sonarqube/ws/client/qualityprofile/RemoveProjectRequestTest.java [deleted file]
tests/src/test/java/org/sonarqube/tests/analysis/IssueExclusionsTest.java
tests/src/test/java/org/sonarqube/tests/authorization/QualityProfileAdminPermissionTest.java
tests/src/test/java/org/sonarqube/tests/issue/OrganizationIssueAssignTest.java
tests/src/test/java/org/sonarqube/tests/organization/OrganizationTest.java
tests/src/test/java/org/sonarqube/tests/qualityProfile/BuiltInQualityProfilesNotificationTest.java
tests/src/test/java/org/sonarqube/tests/qualityProfile/BuiltInQualityProfilesTest.java
tests/src/test/java/org/sonarqube/tests/qualityProfile/CustomQualityProfilesTest.java
tests/src/test/java/org/sonarqube/tests/qualityProfile/OrganizationQualityProfilesUiTest.java
tests/src/test/java/org/sonarqube/tests/qualityProfile/QualityProfilesEditTest.java
tests/src/test/java/org/sonarqube/tests/qualityProfile/QualityProfilesUiTest.java
tests/src/test/java/org/sonarqube/tests/qualityProfile/QualityProfilesWsTest.java
tests/src/test/java/org/sonarqube/tests/rule/RulesWsTest.java
tests/src/test/java/util/ItUtils.java

index c28530f86de3d71e6248f0e1889a350fe47e0093..312db3c9ed71a1c39e5bfea9157ee833b9e98862 100644 (file)
@@ -25,14 +25,15 @@ import java.util.function.Consumer;
 import org.assertj.core.api.Assertions;
 import org.sonarqube.ws.Common;
 import org.sonarqube.ws.Organizations.Organization;
+import org.sonarqube.ws.Projects.CreateWsResponse.Project;
 import org.sonarqube.ws.Qualityprofiles.CreateWsResponse.QualityProfile;
 import org.sonarqube.ws.Rules;
-import org.sonarqube.ws.Projects.CreateWsResponse.Project;
 import org.sonarqube.ws.client.HttpException;
-import org.sonarqube.ws.client.qualityprofile.ActivateRuleRequest;
-import org.sonarqube.ws.client.qualityprofile.AddProjectRequest;
-import org.sonarqube.ws.client.qualityprofile.CreateRequest;
-import org.sonarqube.ws.client.qualityprofile.QualityProfilesService;
+import org.sonarqube.ws.client.qualityprofiles.ActivateRuleRequest;
+import org.sonarqube.ws.client.qualityprofiles.AddProjectRequest;
+import org.sonarqube.ws.client.qualityprofiles.CreateRequest;
+import org.sonarqube.ws.client.qualityprofiles.DeactivateRuleRequest;
+import org.sonarqube.ws.client.qualityprofiles.QualityprofilesService;
 import org.sonarqube.ws.client.rules.SearchRequest;
 
 import static java.util.Arrays.asList;
@@ -49,19 +50,19 @@ public class QProfileTester {
     this.session = session;
   }
 
-  public QualityProfilesService service() {
-    return session.wsClient().qualityProfilesOld();
+  public QualityprofilesService service() {
+    return session.wsClient().qualityprofiles();
   }
 
   @SafeVarargs
-  public final QualityProfile createXooProfile(Organization organization, Consumer<CreateRequest.Builder>... populators) {
+  public final QualityProfile createXooProfile(Organization organization, Consumer<CreateRequest>... populators) {
     int id = ID_GENERATOR.getAndIncrement();
-    CreateRequest.Builder request = CreateRequest.builder()
-      .setOrganizationKey(organization.getKey())
+    CreateRequest request = new CreateRequest()
+      .setOrganization(organization.getKey())
       .setLanguage("xoo")
       .setName("Profile" + id);
     stream(populators).forEach(p -> p.accept(request));
-    return service().create(request.build()).getProfile();
+    return service().create(request).getProfile();
   }
 
   public QProfileTester activateRule(QualityProfile profile, String ruleKey) {
@@ -69,24 +70,22 @@ public class QProfileTester {
   }
 
   public QProfileTester activateRule(String profileKey, String ruleKey) {
-    ActivateRuleRequest request = ActivateRuleRequest.builder()
+    ActivateRuleRequest request = new ActivateRuleRequest()
       .setKey(profileKey)
-      .setRuleKey(ruleKey)
-      .build();
+      .setRule(ruleKey);
     service().activateRule(request);
     return this;
   }
 
   public QProfileTester deactivateRule(QualityProfile profile, String ruleKey) {
-    service().deactivateRule(profile.getKey(), ruleKey);
+    service().deactivateRule(new DeactivateRuleRequest().setKey(profile.getKey()).setRule(ruleKey));
     return this;
   }
 
   public QProfileTester assignQProfileToProject(QualityProfile profile, Project project) {
-    service().addProject(AddProjectRequest.builder()
-      .setProjectKey(project.getKey())
-      .setKey(profile.getKey())
-      .build());
+    service().addProject(new AddProjectRequest()
+      .setProject(project.getKey())
+      .setKey(profile.getKey()));
     return this;
   }
 
index 71d261c2718e8bc6ceadf34ee77509ff6a152841..3712426dd3a375ab0b56d790da15b371fe5659a1 100644 (file)
@@ -32,7 +32,6 @@ import org.sonarqube.ws.client.projectanalyses.ProjectAnalysesService;
 import org.sonarqube.ws.client.projectbranches.ProjectBranchesService;
 import org.sonarqube.ws.client.projectlinks.ProjectLinksService;
 import org.sonarqube.ws.client.qualitygates.QualitygatesService;
-import org.sonarqube.ws.client.qualityprofile.QualityProfilesService;
 import org.sonarqube.ws.client.qualityprofiles.QualityprofilesService;
 import org.sonarqube.ws.client.roots.RootsService;
 import org.sonarqube.ws.client.rules.RulesService;
@@ -56,7 +55,6 @@ class DefaultWsClient implements WsClient {
   private final PermissionsService permissions;
   private final ComponentsService components;
   private final FavoritesService favoritesService;
-  private final QualityProfilesService qualityProfilesOld;
   private final QualityprofilesService qualityprofiles;
   private final IssuesService issues;
   private final UsersService usersService;
@@ -82,7 +80,6 @@ class DefaultWsClient implements WsClient {
     this.permissions = new PermissionsService(wsConnector);
     this.components = new ComponentsService(wsConnector);
     this.favoritesService = new FavoritesService(wsConnector);
-    this.qualityProfilesOld = new QualityProfilesService(wsConnector);
     this.qualityprofiles = new QualityprofilesService(wsConnector);
     this.issues = new IssuesService(wsConnector);
     this.usersService = new UsersService(wsConnector);
@@ -128,11 +125,6 @@ class DefaultWsClient implements WsClient {
     return favoritesService;
   }
 
-  @Override
-  public QualityProfilesService qualityProfilesOld() {
-    return qualityProfilesOld;
-  }
-
   @Override
   public QualityprofilesService qualityProfiles() {
     return qualityprofiles;
index 75ac3a18e1c68a4767d5fbb796478120d305beed..88948a30469cba72b16eeb30822664db8b3001a5 100644 (file)
@@ -32,7 +32,6 @@ import org.sonarqube.ws.client.projectanalyses.ProjectAnalysesService;
 import org.sonarqube.ws.client.projectbranches.ProjectBranchesService;
 import org.sonarqube.ws.client.projectlinks.ProjectLinksService;
 import org.sonarqube.ws.client.qualitygates.QualitygatesService;
-import org.sonarqube.ws.client.qualityprofile.QualityProfilesService;
 import org.sonarqube.ws.client.qualityprofiles.QualityprofilesService;
 import org.sonarqube.ws.client.roots.RootsService;
 import org.sonarqube.ws.client.rules.RulesService;
@@ -75,12 +74,6 @@ public interface WsClient {
 
   PermissionsService permissions();
 
-  /**
-   * @deprecated since 7.0 use {@link #qualityProfiles()} instead
-   */
-  @Deprecated
-  QualityProfilesService qualityProfilesOld();
-
   QualityprofilesService qualityProfiles();
 
   UsersService users();
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/ActivateRuleRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/ActivateRuleRequest.java
deleted file mode 100644 (file)
index 70499d8..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonarqube.ws.client.qualityprofile;
-
-import java.util.Optional;
-import javax.annotation.Nullable;
-import org.sonarqube.ws.Common.Severity;
-
-import static java.util.Objects.requireNonNull;
-
-public class ActivateRuleRequest {
-  private final Optional<String> params;
-  private final String key;
-  private final Optional<Boolean> reset;
-  private final String ruleKey;
-  private final Optional<Severity> severity;
-  private final Optional<String> organization;
-
-  private ActivateRuleRequest(Builder builder) {
-    organization = requireNonNull(builder.organization);
-    params = requireNonNull(builder.params);
-    key = requireNonNull(builder.key);
-    reset = requireNonNull(builder.reset);
-    ruleKey = requireNonNull(builder.ruleKey);
-    severity = requireNonNull(builder.severity);
-  }
-
-  public static ActivateRuleRequest.Builder builder() {
-    return new Builder();
-  }
-
-  public Optional<String> getParams() {
-    return params;
-  }
-
-  public String getKey() {
-    return key;
-  }
-
-  public Optional<Boolean> getReset() {
-    return reset;
-  }
-
-  public String getRuleKey() {
-    return ruleKey;
-  }
-
-  public Optional<Severity> getSeverity() {
-    return severity;
-  }
-
-  public Optional<String> getOrganization() {
-    return organization;
-  }
-
-  public static class Builder {
-    private Optional<String> organization = Optional.empty();
-    private Optional<String> params = Optional.empty();
-    private String key;
-    private Optional<Boolean> reset = Optional.empty();
-    private String ruleKey;
-    private Optional<Severity> severity = Optional.empty();
-
-    private Builder() {
-    }
-
-    public Builder setOrganization(@Nullable String organization) {
-      this.organization = Optional.ofNullable(organization);
-      return this;
-    }
-
-    public Builder setParams(@Nullable String params) {
-      this.params = Optional.ofNullable(params);
-      return this;
-    }
-
-    public Builder setKey(String key) {
-      this.key = key;
-      return this;
-    }
-
-    public Builder setReset(@Nullable Boolean reset) {
-      this.reset = Optional.ofNullable(reset);
-      return this;
-    }
-
-    public Builder setRuleKey(String ruleKey) {
-      this.ruleKey = ruleKey;
-      return this;
-    }
-
-    public Builder setSeverity(@Nullable Severity severity) {
-      this.severity = Optional.ofNullable(severity);
-      return this;
-    }
-
-    public ActivateRuleRequest build() {
-      return new ActivateRuleRequest(this);
-    }
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/AddGroupRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/AddGroupRequest.java
deleted file mode 100644 (file)
index 8fe5c8a..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonarqube.ws.client.qualityprofile;
-
-import javax.annotation.concurrent.Immutable;
-
-@Immutable
-public class AddGroupRequest {
-
-  private final String organization;
-  private final String language;
-  private final String qualityProfile;
-  private final String group;
-
-  private AddGroupRequest(Builder builder) {
-    this.language = builder.language;
-    this.organization = builder.organization;
-    this.qualityProfile = builder.qualityProfile;
-    this.group = builder.group;
-  }
-
-  public String getLanguage() {
-    return language;
-  }
-
-  public String getOrganization() {
-    return organization;
-  }
-
-  public String getQualityProfile() {
-    return qualityProfile;
-  }
-
-  public String getGroup() {
-    return group;
-  }
-
-  public static Builder builder() {
-    return new Builder();
-  }
-
-  public static class Builder {
-    private String organization;
-    private String qualityProfile;
-    private String language;
-    private String group;
-
-    private Builder() {
-      // enforce factory method use
-    }
-
-    public Builder setLanguage(String language) {
-      this.language = language;
-      return this;
-    }
-
-    public Builder setOrganization(String organization) {
-      this.organization = organization;
-      return this;
-    }
-
-    public Builder setQualityProfile(String qualityProfile) {
-      this.qualityProfile = qualityProfile;
-      return this;
-    }
-
-    public Builder setGroup(String group) {
-      this.group = group;
-      return this;
-    }
-
-    public AddGroupRequest build() {
-      return new AddGroupRequest(this);
-    }
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/AddProjectRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/AddProjectRequest.java
deleted file mode 100644 (file)
index fc85243..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonarqube.ws.client.qualityprofile;
-
-import java.util.Optional;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-import javax.annotation.concurrent.Immutable;
-
-import static java.util.Objects.requireNonNull;
-
-@Immutable
-public class AddProjectRequest {
-
-  private final String language;
-  private final Optional<String> organization;
-  private final String qualityProfile;
-  private final String key;
-  private final String projectKey;
-  private final String projectUuid;
-
-  private AddProjectRequest(Builder builder) {
-    this.language = builder.language;
-    this.organization = requireNonNull(builder.organization);
-    this.qualityProfile = builder.qualityProfile;
-    this.key = builder.key;
-    this.projectKey = builder.projectKey;
-    this.projectUuid = builder.projectUuid;
-  }
-
-  @CheckForNull
-  public String getLanguage() {
-    return language;
-  }
-
-  public Optional<String> getOrganization() {
-    return organization;
-  }
-
-  @CheckForNull
-  public String getQualityProfile() {
-    return qualityProfile;
-  }
-
-  @CheckForNull
-  public String getKey() {
-    return key;
-  }
-
-  @CheckForNull
-  public String getProjectKey() {
-    return projectKey;
-  }
-
-  @CheckForNull
-  public String getProjectUuid() {
-    return projectUuid;
-  }
-
-  public static Builder builder() {
-    return new Builder();
-  }
-
-  public static class Builder {
-    private String language;
-    private Optional<String> organization = Optional.empty();
-    private String qualityProfile;
-    private String key;
-    private String projectKey;
-    private String projectUuid;
-
-    private Builder() {
-      // enforce factory method use
-    }
-
-    public Builder setLanguage(@Nullable String language) {
-      this.language = language;
-      return this;
-    }
-
-    public Builder setOrganization(@Nullable String organization) {
-      this.organization = Optional.ofNullable(organization);
-      return this;
-    }
-
-    public Builder setQualityProfile(@Nullable String qualityProfile) {
-      this.qualityProfile = qualityProfile;
-      return this;
-    }
-
-    public Builder setKey(@Nullable String key) {
-      this.key = key;
-      return this;
-    }
-
-    public Builder setProjectKey(@Nullable String projectKey) {
-      this.projectKey = projectKey;
-      return this;
-    }
-
-    public Builder setProjectUuid(@Nullable String projectUuid) {
-      this.projectUuid = projectUuid;
-      return this;
-    }
-
-    public AddProjectRequest build() {
-      return new AddProjectRequest(this);
-    }
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/AddUserRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/AddUserRequest.java
deleted file mode 100644 (file)
index db89c3d..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonarqube.ws.client.qualityprofile;
-
-import javax.annotation.concurrent.Immutable;
-
-@Immutable
-public class AddUserRequest {
-
-  private final String organization;
-  private final String language;
-  private final String qualityProfile;
-  private final String userLogin;
-
-  private AddUserRequest(Builder builder) {
-    this.language = builder.language;
-    this.organization = builder.organization;
-    this.qualityProfile = builder.qualityProfile;
-    this.userLogin = builder.userLogin;
-  }
-
-  public String getLanguage() {
-    return language;
-  }
-
-  public String getOrganization() {
-    return organization;
-  }
-
-  public String getQualityProfile() {
-    return qualityProfile;
-  }
-
-  public String getUserLogin() {
-    return userLogin;
-  }
-
-  public static Builder builder() {
-    return new Builder();
-  }
-
-  public static class Builder {
-    private String organization;
-    private String qualityProfile;
-    private String language;
-    private String userLogin;
-
-    private Builder() {
-      // enforce factory method use
-    }
-
-    public Builder setLanguage(String language) {
-      this.language = language;
-      return this;
-    }
-
-    public Builder setOrganization(String organization) {
-      this.organization = organization;
-      return this;
-    }
-
-    public Builder setQualityProfile(String qualityProfile) {
-      this.qualityProfile = qualityProfile;
-      return this;
-    }
-
-    public Builder setUserLogin(String userLogin) {
-      this.userLogin = userLogin;
-      return this;
-    }
-
-    public AddUserRequest build() {
-      return new AddUserRequest(this);
-    }
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/ChangeParentRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/ChangeParentRequest.java
deleted file mode 100644 (file)
index 9b1b6a3..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-package org.sonarqube.ws.client.qualityprofile;
-
-import javax.annotation.Nullable;
-
-public class ChangeParentRequest {
-  private final String language;
-  private final String parentKey;
-  private final String parentQualityProfile;
-  private final String key;
-  private final String qualityProfile;
-  private final String organization;
-
-  public ChangeParentRequest(Builder builder) {
-    this.language = builder.language;
-    this.parentKey = builder.parentKey;
-    this.parentQualityProfile = builder.parentName;
-    this.key = builder.profileKey;
-    this.qualityProfile = builder.profileName;
-    this.organization = builder.organization;
-  }
-
-  public String getLanguage() {
-    return language;
-  }
-
-  public String getParentKey() {
-    return parentKey;
-  }
-
-  public String getParentQualityProfile() {
-    return parentQualityProfile;
-  }
-
-  public String getKey() {
-    return key;
-  }
-
-  public String getQualityProfile() {
-    return qualityProfile;
-  }
-
-  public String getOrganization() {
-    return organization;
-  }
-
-  public static Builder builder() {
-    return new Builder();
-  }
-
-  public static class Builder {
-    private String language;
-    private String parentKey;
-    private String parentName;
-    private String profileKey;
-    private String profileName;
-    private String organization;
-
-    private Builder() {
-      // enforce factory method use
-    }
-
-    public Builder setLanguage(@Nullable String language) {
-      this.language = language;
-      return this;
-    }
-
-    public Builder setProfileName(@Nullable String profileName) {
-      this.profileName = profileName;
-      return this;
-    }
-
-    public Builder setProfileKey(@Nullable String profileKey) {
-      this.profileKey = profileKey;
-      return this;
-    }
-
-    public Builder setParentKey(@Nullable String parentKey) {
-      this.parentKey = parentKey;
-      return this;
-    }
-
-    public Builder setParentName(@Nullable String parentName) {
-      this.parentName = parentName;
-      return this;
-    }
-
-    public Builder setOrganization(@Nullable String s) {
-      this.organization = s;
-      return this;
-    }
-
-    public ChangeParentRequest build() {
-      return new ChangeParentRequest(this);
-    }
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/ChangelogRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/ChangelogRequest.java
deleted file mode 100644 (file)
index 5c74416..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-package org.sonarqube.ws.client.qualityprofile;
-
-public class ChangelogRequest {
-
-  private final String language;
-  private final String organization;
-  private final Integer p;
-  private final Integer ps;
-  private final String qualityProfile;
-  private final String since;
-  private final String to;
-
-  private ChangelogRequest(Builder builder) {
-    this.language = builder.language;
-    this.organization = builder.organization;
-    this.p = builder.p;
-    this.ps = builder.ps;
-    this.qualityProfile = builder.qualityProfile;
-    this.since = builder.since;
-    this.to = builder.to;
-  }
-
-  public String getLanguage() {
-    return language;
-  }
-
-  public String getOrganization() {
-    return organization;
-  }
-
-  public Integer getP() {
-    return p;
-  }
-
-  public Integer getPs() {
-    return ps;
-  }
-
-  public String getQualityProfile() {
-    return qualityProfile;
-  }
-
-  public String getSince() {
-    return since;
-  }
-
-  public String getTo() {
-    return to;
-  }
-
-  public static Builder builder() {
-    return new Builder();
-  }
-
-  public static class Builder {
-    private String language;
-    private String organization;
-    private Integer p;
-    private Integer ps;
-    private String qualityProfile;
-    private String since;
-    private String to;
-
-    private Builder() {
-    }
-
-    public Builder setLanguage(String language) {
-      this.language = language;
-      return this;
-    }
-
-    public Builder setOrganization(String organization) {
-      this.organization = organization;
-      return this;
-    }
-
-    public Builder setP(Integer p) {
-      this.p = p;
-      return this;
-    }
-
-    public Builder setPs(Integer ps) {
-      this.ps = ps;
-      return this;
-    }
-
-    public Builder setQualityProfile(String qualityProfile) {
-      this.qualityProfile = qualityProfile;
-      return this;
-    }
-
-    public Builder setSince(String since) {
-      this.since = since;
-      return this;
-    }
-
-    public Builder setTo(String to) {
-      this.to = to;
-      return this;
-    }
-
-    public ChangelogRequest build() {
-      return new ChangelogRequest(this);
-    }
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/CopyRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/CopyRequest.java
deleted file mode 100644 (file)
index 39fdb48..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-package org.sonarqube.ws.client.qualityprofile;
-
-import static java.util.Objects.requireNonNull;
-
-public class CopyRequest {
-  private final String fromKey;
-  private final String toName;
-
-  public CopyRequest(String fromKey, String toName) {
-    this.fromKey = requireNonNull(fromKey);
-    this.toName = requireNonNull(toName);
-  }
-
-  public String getFromKey() {
-    return fromKey;
-  }
-
-  public String getToName() {
-    return toName;
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/CreateRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/CreateRequest.java
deleted file mode 100644 (file)
index abf35e1..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonarqube.ws.client.qualityprofile;
-
-import javax.annotation.Nullable;
-import javax.annotation.concurrent.Immutable;
-
-import static com.google.common.base.Preconditions.checkArgument;
-
-@Immutable
-public class CreateRequest {
-
-  private final String name;
-  private final String language;
-  private final String organizationKey;
-
-  private CreateRequest(Builder builder) {
-    this.name = builder.name;
-    this.language = builder.language;
-    this.organizationKey = builder.organizationKey;
-  }
-
-  public String getLanguage() {
-    return language;
-  }
-
-  public String getName() {
-    return name;
-  }
-
-  public String getOrganizationKey() {
-    return organizationKey;
-  }
-
-  public static Builder builder() {
-    return new Builder();
-  }
-
-  public static class Builder {
-    private String language;
-    private String name;
-    private String organizationKey;
-
-    private Builder() {
-      // enforce factory method use
-    }
-
-    public Builder setLanguage(@Nullable String language) {
-      this.language = language;
-      return this;
-    }
-
-    public Builder setName(@Nullable String profileName) {
-      this.name = profileName;
-      return this;
-    }
-
-    public Builder setOrganizationKey(@Nullable String organizationKey) {
-      this.organizationKey = organizationKey;
-      return this;
-    }
-
-    public CreateRequest build() {
-      checkArgument(language != null && !language.isEmpty(), "Language is mandatory and must not be empty.");
-      checkArgument(name != null && !name.isEmpty(), "Profile name is mandatory and must not be empty.");
-      checkArgument(organizationKey == null || !organizationKey.isEmpty(), "Organization key may be either null or not empty. Empty organization key is invalid.");
-      return new CreateRequest(this);
-    }
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/QualityProfilesService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/QualityProfilesService.java
deleted file mode 100644 (file)
index aa00e4e..0000000
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonarqube.ws.client.qualityprofile;
-
-import org.sonarqube.ws.MediaTypes;
-import org.sonarqube.ws.Qualityprofiles;
-import org.sonarqube.ws.Qualityprofiles.CopyWsResponse;
-import org.sonarqube.ws.Qualityprofiles.CreateWsResponse;
-import org.sonarqube.ws.Qualityprofiles.SearchGroupsResponse;
-import org.sonarqube.ws.Qualityprofiles.SearchUsersResponse;
-import org.sonarqube.ws.Qualityprofiles.SearchWsResponse;
-import org.sonarqube.ws.Qualityprofiles.ShowResponse;
-import org.sonarqube.ws.client.BaseService;
-import org.sonarqube.ws.client.GetRequest;
-import org.sonarqube.ws.client.PostRequest;
-import org.sonarqube.ws.client.WsConnector;
-
-import static org.sonar.api.server.ws.WebService.Param.PAGE;
-import static org.sonar.api.server.ws.WebService.Param.PAGE_SIZE;
-import static org.sonar.api.server.ws.WebService.Param.SELECTED;
-import static org.sonar.api.server.ws.WebService.Param.TEXT_QUERY;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.ACTION_ACTIVATE_RULE;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.ACTION_ADD_GROUP;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.ACTION_ADD_PROJECT;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.ACTION_ADD_USER;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.ACTION_CHANGE_PARENT;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.ACTION_COPY;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.ACTION_CREATE;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.ACTION_DEACTIVATE_RULE;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.ACTION_DELETE;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.ACTION_REMOVE_GROUP;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.ACTION_REMOVE_PROJECT;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.ACTION_REMOVE_USER;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.ACTION_RESTORE;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.ACTION_SEARCH;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.ACTION_SEARCH_GROUPS;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.ACTION_SEARCH_USERS;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.ACTION_SET_DEFAULT;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.ACTION_SHOW;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.CONTROLLER_QUALITY_PROFILES;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_COMPARE_TO_SONAR_WAY;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_DEFAULTS;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_FROM_KEY;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_GROUP;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_KEY;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_LANGUAGE;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_LOGIN;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_NAME;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_ORGANIZATION;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_PARAMS;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_PARENT_KEY;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_PARENT_QUALITY_PROFILE;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_PROJECT_KEY;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_PROJECT_UUID;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_QUALITY_PROFILE;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_RESET;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_RULE;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_SEVERITY;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_TO_NAME;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.RestoreActionParameters.PARAM_BACKUP;
-
-/**
- * @deprecated since 7.0, use {@link org.sonarqube.ws.client.qualityprofiles.QualityprofilesService} instead
- */
-@Deprecated
-public class QualityProfilesService extends BaseService {
-
-  public QualityProfilesService(WsConnector wsConnector) {
-    super(wsConnector, CONTROLLER_QUALITY_PROFILES);
-  }
-
-  public void activateRule(ActivateRuleRequest request) {
-    PostRequest httpRequest = new PostRequest(path(ACTION_ACTIVATE_RULE));
-    httpRequest.setParam(PARAM_ORGANIZATION, request.getOrganization().orElse(null));
-    httpRequest.setParam(PARAM_PARAMS, request.getParams().orElse(null));
-    httpRequest.setParam(PARAM_KEY, request.getKey());
-    httpRequest.setParam(PARAM_RESET, request.getReset().orElse(null));
-    httpRequest.setParam(PARAM_RULE, request.getRuleKey());
-    httpRequest.setParam(PARAM_SEVERITY, request.getSeverity().map(Enum::name).orElse(null));
-    call(httpRequest);
-  }
-
-  public void deactivateRule(String profileKey, String ruleKey) {
-    PostRequest httpRequest = new PostRequest(path(ACTION_DEACTIVATE_RULE));
-    httpRequest.setParam(PARAM_KEY, profileKey);
-    httpRequest.setParam(PARAM_RULE, ruleKey);
-    call(httpRequest);
-  }
-
-  public void restoreProfile(RestoreRequest request) {
-    PostRequest httpRequest = new PostRequest(path(ACTION_RESTORE));
-    httpRequest.setParam(PARAM_ORGANIZATION, request.getOrganization().orElse(null));
-    httpRequest.setPart(PARAM_BACKUP, new PostRequest.Part(MediaTypes.XML, request.getBackup()));
-    call(httpRequest);
-  }
-
-  public SearchWsResponse search(SearchRequest request) {
-    return call(
-      new GetRequest(path(ACTION_SEARCH))
-        .setParam(PARAM_DEFAULTS, request.getDefaults())
-        .setParam(PARAM_LANGUAGE, request.getLanguage())
-        .setParam(PARAM_QUALITY_PROFILE, request.getQualityProfile())
-        .setParam(PARAM_PROJECT_KEY, request.getProjectKey())
-        .setParam(PARAM_ORGANIZATION, request.getOrganizationKey()),
-      SearchWsResponse.parser());
-  }
-
-  public Qualityprofiles.ShowResponse show(ShowRequest request) {
-    return call(
-      new GetRequest(path(ACTION_SHOW))
-        .setParam(PARAM_KEY, request.getKey())
-        .setParam(PARAM_COMPARE_TO_SONAR_WAY, request.getCompareToSonarWay()),
-      ShowResponse.parser());
-  }
-
-  public void addProject(AddProjectRequest request) {
-    call(new PostRequest(path(ACTION_ADD_PROJECT))
-      .setParam(PARAM_LANGUAGE, request.getLanguage())
-      .setParam(PARAM_ORGANIZATION, request.getOrganization().orElse(null))
-      .setParam(PARAM_QUALITY_PROFILE, request.getQualityProfile())
-      .setParam(QualityProfileWsParameters.PARAM_KEY, request.getKey())
-      .setParam(PARAM_PROJECT_KEY, request.getProjectKey())
-      .setParam(PARAM_PROJECT_UUID, request.getProjectUuid()));
-  }
-
-  public void removeProject(RemoveProjectRequest request) {
-    call(new PostRequest(path(ACTION_REMOVE_PROJECT))
-      .setParam(PARAM_LANGUAGE, request.getLanguage())
-      .setParam(PARAM_QUALITY_PROFILE, request.getQualityProfile())
-      .setParam(QualityProfileWsParameters.PARAM_KEY, request.getKey())
-      .setParam(PARAM_PROJECT_KEY, request.getProjectKey())
-      .setParam(PARAM_PROJECT_UUID, request.getProjectUuid()));
-  }
-
-  public CreateWsResponse create(CreateRequest request) {
-    PostRequest postRequest = new PostRequest(path(ACTION_CREATE))
-      .setParam(PARAM_ORGANIZATION, request.getOrganizationKey())
-      .setParam(PARAM_LANGUAGE, request.getLanguage())
-      .setParam(PARAM_NAME, request.getName());
-    return call(postRequest, CreateWsResponse.parser());
-  }
-
-  public CopyWsResponse copy(CopyRequest request) {
-    PostRequest postRequest = new PostRequest(path(ACTION_COPY))
-      .setParam(PARAM_FROM_KEY, request.getFromKey())
-      .setParam(PARAM_TO_NAME, request.getToName());
-
-    return call(postRequest, CopyWsResponse.parser());
-  }
-
-  public void changeParent(ChangeParentRequest request) {
-    call(new PostRequest(path(ACTION_CHANGE_PARENT))
-      .setParam(PARAM_LANGUAGE, request.getLanguage())
-      .setParam(PARAM_PARENT_KEY, request.getParentKey())
-      .setParam(PARAM_PARENT_QUALITY_PROFILE, request.getParentQualityProfile())
-      .setParam(PARAM_KEY, request.getKey())
-      .setParam(PARAM_QUALITY_PROFILE, request.getQualityProfile())
-      .setParam(PARAM_ORGANIZATION, request.getOrganization()));
-  }
-
-  public void setDefault(SetDefaultRequest request) {
-    PostRequest postRequest = new PostRequest(path(ACTION_SET_DEFAULT))
-      .setParam(QualityProfileWsParameters.PARAM_KEY, request.getKey());
-
-    call(postRequest);
-  }
-
-  public void delete(String profileKey) {
-    PostRequest postRequest = new PostRequest(path(ACTION_DELETE))
-      .setParam(QualityProfileWsParameters.PARAM_KEY, profileKey);
-
-    call(postRequest);
-  }
-
-  public void addUser(AddUserRequest request) {
-    call(new PostRequest(path(ACTION_ADD_USER))
-      .setParam(PARAM_ORGANIZATION, request.getOrganization())
-      .setParam(PARAM_QUALITY_PROFILE, request.getQualityProfile())
-      .setParam(PARAM_LANGUAGE, request.getLanguage())
-      .setParam(PARAM_LOGIN, request.getUserLogin()));
-  }
-
-  public void removeUser(RemoveUserRequest request) {
-    call(new PostRequest(path(ACTION_REMOVE_USER))
-      .setParam(PARAM_ORGANIZATION, request.getOrganization())
-      .setParam(PARAM_QUALITY_PROFILE, request.getQualityProfile())
-      .setParam(PARAM_LANGUAGE, request.getLanguage())
-      .setParam(PARAM_LOGIN, request.getUserLogin()));
-  }
-
-  public SearchUsersResponse searchUsers(SearchUsersRequest request) {
-    return call(
-      new GetRequest(path(ACTION_SEARCH_USERS))
-        .setParam(PARAM_ORGANIZATION, request.getOrganization())
-        .setParam(PARAM_QUALITY_PROFILE, request.getQualityProfile())
-        .setParam(PARAM_LANGUAGE, request.getLanguage())
-        .setParam(TEXT_QUERY, request.getQuery())
-        .setParam(SELECTED, request.getSelected())
-        .setParam(PAGE, request.getPage())
-        .setParam(PAGE_SIZE, request.getPageSize()),
-      SearchUsersResponse.parser());
-  }
-
-  public void addGroup(AddGroupRequest request) {
-    call(new PostRequest(path(ACTION_ADD_GROUP))
-      .setParam(PARAM_ORGANIZATION, request.getOrganization())
-      .setParam(PARAM_QUALITY_PROFILE, request.getQualityProfile())
-      .setParam(PARAM_LANGUAGE, request.getLanguage())
-      .setParam(PARAM_GROUP, request.getGroup()));
-  }
-
-  public void removeGroup(RemoveGroupRequest request) {
-    call(new PostRequest(path(ACTION_REMOVE_GROUP))
-      .setParam(PARAM_ORGANIZATION, request.getOrganization())
-      .setParam(PARAM_QUALITY_PROFILE, request.getQualityProfile())
-      .setParam(PARAM_LANGUAGE, request.getLanguage())
-      .setParam(PARAM_GROUP, request.getGroup()));
-  }
-
-  public SearchGroupsResponse searchGroups(SearchGroupsRequest request) {
-    return call(
-      new GetRequest(path(ACTION_SEARCH_GROUPS))
-        .setParam(PARAM_ORGANIZATION, request.getOrganization())
-        .setParam(PARAM_QUALITY_PROFILE, request.getQualityProfile())
-        .setParam(PARAM_LANGUAGE, request.getLanguage())
-        .setParam(TEXT_QUERY, request.getQuery())
-        .setParam(SELECTED, request.getSelected())
-        .setParam(PAGE, request.getPage())
-        .setParam(PAGE_SIZE, request.getPageSize()),
-      SearchGroupsResponse.parser());
-  }
-
-  public String changelog(ChangelogRequest request) {
-    PostRequest postRequest = new PostRequest(path("changelog"))
-      .setParam("language", request.getLanguage())
-      .setParam("organization", request.getOrganization())
-      .setParam("qualityProfile", request.getQualityProfile());
-    if (request.getP() != null) {
-      postRequest.setParam("p", request.getP());
-    }
-    if (request.getPs() != null) {
-      postRequest.setParam("ps", request.getPs());
-    }
-    if (request.getSince() != null) {
-      postRequest.setParam("since", request.getSince());
-    }
-    if (request.getTo() != null) {
-      postRequest.setParam("to", request.getTo());
-    }
-    return call(postRequest).content();
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/RemoveGroupRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/RemoveGroupRequest.java
deleted file mode 100644 (file)
index 6bd43b8..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonarqube.ws.client.qualityprofile;
-
-import javax.annotation.concurrent.Immutable;
-
-@Immutable
-public class RemoveGroupRequest {
-
-  private final String organization;
-  private final String language;
-  private final String qualityProfile;
-  private final String group;
-
-  private RemoveGroupRequest(Builder builder) {
-    this.language = builder.language;
-    this.organization = builder.organization;
-    this.qualityProfile = builder.qualityProfile;
-    this.group = builder.group;
-  }
-
-  public String getLanguage() {
-    return language;
-  }
-
-  public String getOrganization() {
-    return organization;
-  }
-
-  public String getQualityProfile() {
-    return qualityProfile;
-  }
-
-  public String getGroup() {
-    return group;
-  }
-
-  public static Builder builder() {
-    return new Builder();
-  }
-
-  public static class Builder {
-    private String organization;
-    private String qualityProfile;
-    private String language;
-    private String group;
-
-    private Builder() {
-      // enforce factory method use
-    }
-
-    public Builder setLanguage(String language) {
-      this.language = language;
-      return this;
-    }
-
-    public Builder setOrganization(String organization) {
-      this.organization = organization;
-      return this;
-    }
-
-    public Builder setQualityProfile(String qualityProfile) {
-      this.qualityProfile = qualityProfile;
-      return this;
-    }
-
-    public Builder setGroup(String group) {
-      this.group = group;
-      return this;
-    }
-
-    public RemoveGroupRequest build() {
-      return new RemoveGroupRequest(this);
-    }
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/RemoveProjectRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/RemoveProjectRequest.java
deleted file mode 100644 (file)
index ccc3557..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonarqube.ws.client.qualityprofile;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-import javax.annotation.concurrent.Immutable;
-
-@Immutable
-public class RemoveProjectRequest {
-
-  private final String language;
-  private final String qualityProfile;
-  private final String key;
-  private final String projectKey;
-  private final String projectUuid;
-
-  private RemoveProjectRequest(Builder builder) {
-    this.language = builder.language;
-    this.qualityProfile = builder.qualityProfile;
-    this.key = builder.key;
-    this.projectKey = builder.projectKey;
-    this.projectUuid = builder.projectUuid;
-  }
-
-  @CheckForNull
-  public String getLanguage() {
-    return language;
-  }
-
-  @CheckForNull
-  public String getQualityProfile() {
-    return qualityProfile;
-  }
-
-  @CheckForNull
-  public String getKey() {
-    return key;
-  }
-
-  @CheckForNull
-  public String getProjectKey() {
-    return projectKey;
-  }
-
-  @CheckForNull
-  public String getProjectUuid() {
-    return projectUuid;
-  }
-
-  public static Builder builder() {
-    return new Builder();
-  }
-
-  public static class Builder {
-    private String language;
-    private String qualityProfile;
-    private String key;
-    private String projectKey;
-    private String projectUuid;
-
-    private Builder() {
-      // enforce factory method use
-    }
-
-    public Builder setLanguage(@Nullable String language) {
-      this.language = language;
-      return this;
-    }
-
-    public Builder setQualityProfile(@Nullable String qualityProfile) {
-      this.qualityProfile = qualityProfile;
-      return this;
-    }
-
-    public Builder setKey(@Nullable String key) {
-      this.key = key;
-      return this;
-    }
-
-    public Builder setProjectKey(@Nullable String projectKey) {
-      this.projectKey = projectKey;
-      return this;
-    }
-
-    public Builder setProjectUuid(@Nullable String projectUuid) {
-      this.projectUuid = projectUuid;
-      return this;
-    }
-
-    public RemoveProjectRequest build() {
-      return new RemoveProjectRequest(this);
-    }
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/RemoveUserRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/RemoveUserRequest.java
deleted file mode 100644 (file)
index 609ac00..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonarqube.ws.client.qualityprofile;
-
-import javax.annotation.concurrent.Immutable;
-
-@Immutable
-public class RemoveUserRequest {
-
-  private final String organization;
-  private final String language;
-  private final String qualityProfile;
-  private final String userLogin;
-
-  private RemoveUserRequest(Builder builder) {
-    this.language = builder.language;
-    this.organization = builder.organization;
-    this.qualityProfile = builder.qualityProfile;
-    this.userLogin = builder.userLogin;
-  }
-
-  public String getLanguage() {
-    return language;
-  }
-
-  public String getOrganization() {
-    return organization;
-  }
-
-  public String getQualityProfile() {
-    return qualityProfile;
-  }
-
-  public String getUserLogin() {
-    return userLogin;
-  }
-
-  public static Builder builder() {
-    return new Builder();
-  }
-
-  public static class Builder {
-    private String organization;
-    private String qualityProfile;
-    private String language;
-    private String userLogin;
-
-    private Builder() {
-      // enforce factory method use
-    }
-
-    public Builder setLanguage(String language) {
-      this.language = language;
-      return this;
-    }
-
-    public Builder setOrganization(String organization) {
-      this.organization = organization;
-      return this;
-    }
-
-    public Builder setQualityProfile(String qualityProfile) {
-      this.qualityProfile = qualityProfile;
-      return this;
-    }
-
-    public Builder setUserLogin(String userLogin) {
-      this.userLogin = userLogin;
-      return this;
-    }
-
-    public RemoveUserRequest build() {
-      return new RemoveUserRequest(this);
-    }
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/RestoreRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/RestoreRequest.java
deleted file mode 100644 (file)
index c4cbdae..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonarqube.ws.client.qualityprofile;
-
-import java.io.File;
-import java.util.Optional;
-import javax.annotation.Nullable;
-
-import static java.util.Objects.requireNonNull;
-
-public class RestoreRequest {
-
-  private final File backup;
-  private final Optional<String> organization;
-
-  private RestoreRequest(Builder builder) {
-    backup = requireNonNull(builder.backup);
-    organization = requireNonNull(builder.organization);
-  }
-
-  public File getBackup() {
-    return backup;
-  }
-
-  public Optional<String> getOrganization() {
-    return organization;
-  }
-
-  public static Builder builder() {
-    return new Builder();
-  }
-
-  public static class Builder {
-    private File backup;
-    private Optional<String> organization = Optional.empty();
-
-    public Builder setBackup(File backup) {
-      this.backup = backup;
-      return this;
-    }
-
-    public Builder setOrganization(@Nullable String organization) {
-      this.organization = Optional.ofNullable(organization);
-      return this;
-    }
-
-    public RestoreRequest build() {
-      return new RestoreRequest(this);
-    }
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/SearchGroupsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/SearchGroupsRequest.java
deleted file mode 100644 (file)
index bf515ef..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonarqube.ws.client.qualityprofile;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-public class SearchGroupsRequest {
-
-  private String organization;
-  private String qualityProfile;
-  private String language;
-  private String selected;
-  private String query;
-  private Integer page;
-  private Integer pageSize;
-
-  private SearchGroupsRequest(Builder builder) {
-    this.organization = builder.organization;
-    this.qualityProfile = builder.qualityProfile;
-    this.language = builder.language;
-    this.selected = builder.selected;
-    this.query = builder.query;
-    this.page = builder.page;
-    this.pageSize = builder.pageSize;
-  }
-
-  @CheckForNull
-  public String getOrganization() {
-    return organization;
-  }
-
-  public String getQualityProfile() {
-    return qualityProfile;
-  }
-
-  public String getLanguage() {
-    return language;
-  }
-
-  @CheckForNull
-  public String getQuery() {
-    return query;
-  }
-
-  public String getSelected() {
-    return selected;
-  }
-
-  public Integer getPage() {
-    return page;
-  }
-
-  public Integer getPageSize() {
-    return pageSize;
-  }
-
-  public static Builder builder() {
-    return new Builder();
-  }
-
-  public static class Builder {
-    private String organization;
-    private String qualityProfile;
-    private String language;
-    private String selected;
-    private String query;
-    private Integer page;
-    private Integer pageSize;
-
-    public Builder setOrganization(@Nullable String organization) {
-      this.organization = organization;
-      return this;
-    }
-
-    public Builder setQualityProfile(String qualityProfile) {
-      this.qualityProfile = qualityProfile;
-      return this;
-    }
-
-    public Builder setLanguage(String language) {
-      this.language = language;
-      return this;
-    }
-
-    public Builder setSelected(String selected) {
-      this.selected = selected;
-      return this;
-    }
-
-    public Builder setQuery(@Nullable String query) {
-      this.query = query;
-      return this;
-    }
-
-    public Builder setPage(Integer page) {
-      this.page = page;
-      return this;
-    }
-
-    public Builder setPageSize(Integer pageSize) {
-      this.pageSize = pageSize;
-      return this;
-    }
-
-    public SearchGroupsRequest build() {
-      return new SearchGroupsRequest(this);
-    }
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/SearchRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/SearchRequest.java
deleted file mode 100644 (file)
index 1df9c05..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonarqube.ws.client.qualityprofile;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-public class SearchRequest {
-  private String organizationKey;
-  private boolean defaults;
-  private String language;
-  private String qualityProfile;
-  private String projectKey;
-
-  public String getOrganizationKey() {
-    return organizationKey;
-  }
-
-  public SearchRequest setOrganizationKey(String organizationKey) {
-    this.organizationKey = organizationKey;
-    return this;
-  }
-
-  public boolean getDefaults() {
-    return defaults;
-  }
-
-  public SearchRequest setDefaults(boolean defaults) {
-    this.defaults = defaults;
-    return this;
-  }
-
-  @CheckForNull
-  public String getLanguage() {
-    return language;
-  }
-
-  public SearchRequest setLanguage(@Nullable String language) {
-    this.language = language;
-    return this;
-  }
-
-  @CheckForNull
-  public String getQualityProfile() {
-    return qualityProfile;
-  }
-
-  public SearchRequest setQualityProfile(@Nullable String qualityProfile) {
-    this.qualityProfile = qualityProfile;
-    return this;
-  }
-
-  @CheckForNull
-  public String getProjectKey() {
-    return projectKey;
-  }
-
-  public SearchRequest setProjectKey(@Nullable String projectKey) {
-    this.projectKey = projectKey;
-    return this;
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/SearchUsersRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/SearchUsersRequest.java
deleted file mode 100644 (file)
index 247efbd..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonarqube.ws.client.qualityprofile;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-public class SearchUsersRequest {
-
-  private String organization;
-  private String qualityProfile;
-  private String language;
-  private String selected;
-  private String query;
-  private Integer page;
-  private Integer pageSize;
-
-  private SearchUsersRequest(Builder builder) {
-    this.organization = builder.organization;
-    this.qualityProfile = builder.qualityProfile;
-    this.language = builder.language;
-    this.selected = builder.selected;
-    this.query = builder.query;
-    this.page = builder.page;
-    this.pageSize = builder.pageSize;
-  }
-
-  @CheckForNull
-  public String getOrganization() {
-    return organization;
-  }
-
-  public String getQualityProfile() {
-    return qualityProfile;
-  }
-
-  public String getLanguage() {
-    return language;
-  }
-
-  @CheckForNull
-  public String getQuery() {
-    return query;
-  }
-
-  public String getSelected() {
-    return selected;
-  }
-
-  public Integer getPage() {
-    return page;
-  }
-
-  public Integer getPageSize() {
-    return pageSize;
-  }
-
-  public static Builder builder() {
-    return new Builder();
-  }
-
-  public static class Builder {
-    private String organization;
-    private String qualityProfile;
-    private String language;
-    private String selected;
-    private String query;
-    private Integer page;
-    private Integer pageSize;
-
-    public Builder setOrganization(@Nullable String organization) {
-      this.organization = organization;
-      return this;
-    }
-
-    public Builder setQualityProfile(String qualityProfile) {
-      this.qualityProfile = qualityProfile;
-      return this;
-    }
-
-    public Builder setLanguage(String language) {
-      this.language = language;
-      return this;
-    }
-
-    public Builder setSelected(String selected) {
-      this.selected = selected;
-      return this;
-    }
-
-    public Builder setQuery(@Nullable String query) {
-      this.query = query;
-      return this;
-    }
-
-    public Builder setPage(Integer page) {
-      this.page = page;
-      return this;
-    }
-
-    public Builder setPageSize(Integer pageSize) {
-      this.pageSize = pageSize;
-      return this;
-    }
-
-    public SearchUsersRequest build() {
-      return new SearchUsersRequest(this);
-    }
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/SetDefaultRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/SetDefaultRequest.java
deleted file mode 100644 (file)
index 57a7bd4..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-package org.sonarqube.ws.client.qualityprofile;
-
-public class SetDefaultRequest {
-  private final String key;
-
-  public SetDefaultRequest(String key) {
-    this.key = key;
-  }
-
-  public String getKey() {
-    return key;
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/ShowRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/ShowRequest.java
deleted file mode 100644 (file)
index 0e267e6..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-package org.sonarqube.ws.client.qualityprofile;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-public class ShowRequest {
-  private String key;
-  private Boolean compareToSonarWay;
-
-  @CheckForNull
-  public String getKey() {
-    return key;
-  }
-
-  public ShowRequest setKey(@Nullable String key) {
-    this.key = key;
-    return this;
-  }
-
-  @CheckForNull
-  public Boolean getCompareToSonarWay() {
-    return compareToSonarWay;
-  }
-
-  public ShowRequest setCompareToSonarWay(@Nullable Boolean compareToSonarWay) {
-    this.compareToSonarWay = compareToSonarWay;
-    return this;
-  }
-}
index 31694161a170b11fe4884bc48d73677b9063c991..b91e6ce4b2a9ccabf9aa75a2fd411d42fe3291c9 100644 (file)
@@ -237,8 +237,8 @@ public class QualityprofilesService extends BaseService {
    * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/qualityprofiles/copy">Further information about this action online (including a response example)</a>
    * @since 5.2
    */
-  public void copy(CopyRequest request) {
-    call(
+  public CopyWsResponse copy(CopyRequest request) {
+    return call(
       new PostRequest(path("copy"))
         .setParam("fromKey", request.getFromKey())
         .setParam("toName", request.getToName()),
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/qualityprofile/AddProjectRequestTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/qualityprofile/AddProjectRequestTest.java
deleted file mode 100644 (file)
index 7f0fcde..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonarqube.ws.client.qualityprofile;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class AddProjectRequestTest {
-
-  @Rule
-  public ExpectedException expectedException = ExpectedException.none();
-
-  AddProjectRequest.Builder underTest = AddProjectRequest.builder();
-
-  @Test
-  public void create_request_from_profile_key_and_project_key() {
-    AddProjectRequest result = underTest.setKey("SonarWay").setProjectKey("sample").build();
-
-    assertThat(result.getLanguage()).isNull();
-    assertThat(result.getKey()).isEqualTo("SonarWay");
-    assertThat(result.getQualityProfile()).isNull();
-    assertThat(result.getProjectKey()).isEqualTo("sample");
-    assertThat(result.getProjectUuid()).isNull();
-  }
-
-  @Test
-  public void create_request_from_profile_name_and_language_and_project_key() {
-    AddProjectRequest result = underTest.setLanguage("xoo").setQualityProfile("Sonar Way").setProjectKey("sample").build();
-
-    assertThat(result.getLanguage()).isEqualTo("xoo");
-    assertThat(result.getKey()).isNull();
-    assertThat(result.getQualityProfile()).isEqualTo("Sonar Way");
-    assertThat(result.getProjectKey()).isEqualTo("sample");
-    assertThat(result.getProjectUuid()).isNull();
-  }
-
-  @Test
-  public void create_request_from_profile_key_and_project_uuid() {
-    AddProjectRequest result = underTest.setKey("SonarWay").setProjectUuid("123").build();
-
-    assertThat(result.getLanguage()).isNull();
-    assertThat(result.getKey()).isEqualTo("SonarWay");
-    assertThat(result.getQualityProfile()).isNull();
-    assertThat(result.getProjectKey()).isNull();
-    assertThat(result.getProjectUuid()).isEqualTo("123");
-  }
-
-}
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/qualityprofile/CreateRequestTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/qualityprofile/CreateRequestTest.java
deleted file mode 100644 (file)
index 7aff1d8..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonarqube.ws.client.qualityprofile;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class CreateRequestTest {
-
-  @Rule
-  public ExpectedException expectedException = ExpectedException.none();
-
-  CreateRequest.Builder underTest = CreateRequest.builder();
-
-  @Test
-  public void create_set_request() {
-    CreateRequest result = underTest
-      .setLanguage("java")
-      .setName("Sonar way")
-      .build();
-
-    assertThat(result.getLanguage()).isEqualTo("java");
-    assertThat(result.getName()).isEqualTo("Sonar way");
-  }
-
-  @Test
-  public void fail_when_no_language() {
-    expectedException.expect(IllegalArgumentException.class);
-    underTest.setName("Sonar way").build();
-  }
-
-  @Test
-  public void fail_when_no_profile_name() {
-    expectedException.expect(IllegalArgumentException.class);
-    underTest.setLanguage("java").build();
-  }
-
-}
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/qualityprofile/QualityProfilesServiceTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/qualityprofile/QualityProfilesServiceTest.java
deleted file mode 100644 (file)
index 2718136..0000000
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonarqube.ws.client.qualityprofile;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.sonarqube.ws.Common.Severity;
-import org.sonarqube.ws.Qualityprofiles;
-import org.sonarqube.ws.Qualityprofiles.SearchWsResponse;
-import org.sonarqube.ws.Qualityprofiles.ShowResponse;
-import org.sonarqube.ws.client.GetRequest;
-import org.sonarqube.ws.client.PostRequest;
-import org.sonarqube.ws.client.ServiceTester;
-import org.sonarqube.ws.client.WsConnector;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.mock;
-import static org.sonar.api.server.ws.WebService.Param.PAGE;
-import static org.sonar.api.server.ws.WebService.Param.PAGE_SIZE;
-import static org.sonar.api.server.ws.WebService.Param.SELECTED;
-import static org.sonar.api.server.ws.WebService.Param.TEXT_QUERY;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_COMPARE_TO_SONAR_WAY;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_DEFAULTS;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_FROM_KEY;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_GROUP;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_LANGUAGE;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_NAME;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_LOGIN;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_ORGANIZATION;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_PARAMS;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_KEY;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_QUALITY_PROFILE;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_PROJECT_KEY;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_RULE;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_SEVERITY;
-import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_TO_NAME;
-
-public class QualityProfilesServiceTest {
-
-  @Rule
-  public ServiceTester<QualityProfilesService> serviceTester = new ServiceTester<>(new QualityProfilesService(mock(WsConnector.class)));
-
-  private QualityProfilesService underTest = serviceTester.getInstanceUnderTest();
-
-  @Test
-  public void search() {
-    underTest.search(new SearchRequest()
-      .setDefaults(true)
-      .setProjectKey("project")
-      .setLanguage("language")
-      .setQualityProfile("profile"));
-    GetRequest getRequest = serviceTester.getGetRequest();
-
-    assertThat(serviceTester.getGetParser()).isSameAs(SearchWsResponse.parser());
-    serviceTester.assertThat(getRequest)
-      .hasPath("search")
-      .hasParam(PARAM_DEFAULTS, true)
-      .hasParam(PARAM_PROJECT_KEY, "project")
-      .hasParam(PARAM_LANGUAGE, "language")
-      .hasParam(PARAM_QUALITY_PROFILE, "profile")
-      .andNoOtherParam();
-  }
-
-  @Test
-  public void show() {
-    underTest.show(new ShowRequest()
-      .setKey("profile")
-      .setCompareToSonarWay(true));
-    GetRequest getRequest = serviceTester.getGetRequest();
-
-    assertThat(serviceTester.getGetParser()).isSameAs(ShowResponse.parser());
-    serviceTester.assertThat(getRequest)
-      .hasPath("show")
-      .hasParam(PARAM_KEY, "profile")
-      .hasParam(PARAM_COMPARE_TO_SONAR_WAY, true)
-      .andNoOtherParam();
-  }
-
-  @Test
-  public void add_project() throws Exception {
-    underTest.addProject(AddProjectRequest.builder()
-      .setLanguage("xoo")
-      .setQualityProfile("Sonar Way")
-      .setProjectKey("sample")
-      .build());
-
-    serviceTester.assertThat(serviceTester.getPostRequest())
-      .hasPath("add_project")
-      .hasParam(PARAM_LANGUAGE, "xoo")
-      .hasParam(PARAM_QUALITY_PROFILE, "Sonar Way")
-      .hasParam(PARAM_PROJECT_KEY, "sample")
-      .andNoOtherParam();
-  }
-
-  @Test
-  public void remove_project() throws Exception {
-    underTest.removeProject(RemoveProjectRequest.builder()
-      .setLanguage("xoo")
-      .setQualityProfile("Sonar Way")
-      .setProjectKey("sample")
-      .build());
-
-    serviceTester.assertThat(serviceTester.getPostRequest())
-      .hasPath("remove_project")
-      .hasParam(PARAM_LANGUAGE, "xoo")
-      .hasParam(PARAM_QUALITY_PROFILE, "Sonar Way")
-      .hasParam(PARAM_PROJECT_KEY, "sample")
-      .andNoOtherParam();
-  }
-
-  @Test
-  public void create() throws Exception {
-    underTest.create(CreateRequest.builder()
-      .setLanguage("xoo")
-      .setName("Sonar Way")
-      .build());
-
-    serviceTester.assertThat(serviceTester.getPostRequest())
-      .hasPath("create")
-      .hasParam(PARAM_LANGUAGE, "xoo")
-      .hasParam(PARAM_NAME, "Sonar Way")
-      .andNoOtherParam();
-  }
-
-  @Test
-  public void copy() throws Exception {
-    underTest.copy(new CopyRequest("fromKey", "My Sonar Way"));
-
-    serviceTester.assertThat(serviceTester.getPostRequest())
-      .hasPath("copy")
-      .hasParam(PARAM_FROM_KEY, "fromKey")
-      .hasParam(PARAM_TO_NAME, "My Sonar Way")
-      .andNoOtherParam();
-  }
-
-  @Test
-  public void set_default() {
-    underTest.setDefault(new SetDefaultRequest("sample"));
-
-    serviceTester.assertThat(serviceTester.getPostRequest())
-      .hasPath("set_default")
-      .hasParam(QualityProfileWsParameters.PARAM_KEY, "sample")
-      .andNoOtherParam();
-  }
-
-  @Test
-  public void delete() {
-    underTest.delete("sample");
-
-    serviceTester.assertThat(serviceTester.getPostRequest())
-      .hasPath("delete")
-      .hasParam(QualityProfileWsParameters.PARAM_KEY, "sample")
-      .andNoOtherParam();
-  }
-
-  @Test
-  public void deactivate_rule() {
-    underTest.deactivateRule("P1", "R1");
-    PostRequest request = serviceTester.getPostRequest();
-
-    serviceTester.assertThat(request)
-      .hasPath("deactivate_rule")
-      .hasParam(PARAM_KEY, "P1")
-      .hasParam(PARAM_RULE, "R1")
-      .andNoOtherParam();
-  }
-
-  @Test
-  public void activate_rule() {
-    underTest.activateRule(ActivateRuleRequest.builder()
-      .setRuleKey("R1")
-      .setKey("P1")
-      .setOrganization("O1")
-      .setParams("PS1")
-      .setSeverity(Severity.INFO)
-      .build());
-    PostRequest request = serviceTester.getPostRequest();
-
-    serviceTester.assertThat(request)
-      .hasPath("activate_rule")
-      .hasParam(PARAM_KEY, "P1")
-      .hasParam(PARAM_RULE, "R1")
-      .hasParam(PARAM_ORGANIZATION, "O1")
-      .hasParam(PARAM_PARAMS, "PS1")
-      .hasParam(PARAM_SEVERITY, Severity.INFO.toString())
-      .andNoOtherParam();
-  }
-
-  @Test
-  public void add_user() {
-    underTest.addUser(AddUserRequest.builder()
-      .setOrganization("O1")
-      .setQualityProfile("P1")
-      .setLanguage("Xoo")
-      .setUserLogin("john")
-      .build());
-    PostRequest request = serviceTester.getPostRequest();
-
-    serviceTester.assertThat(request)
-      .hasPath("add_user")
-      .hasParam(PARAM_ORGANIZATION, "O1")
-      .hasParam(PARAM_QUALITY_PROFILE, "P1")
-      .hasParam(PARAM_LANGUAGE, "Xoo")
-      .hasParam(PARAM_LOGIN, "john")
-      .andNoOtherParam();
-  }
-
-  @Test
-  public void remove_user() {
-    underTest.removeUser(RemoveUserRequest.builder()
-      .setOrganization("O1")
-      .setQualityProfile("P1")
-      .setLanguage("Xoo")
-      .setUserLogin("john")
-      .build());
-    PostRequest request = serviceTester.getPostRequest();
-
-    serviceTester.assertThat(request)
-      .hasPath("remove_user")
-      .hasParam(PARAM_ORGANIZATION, "O1")
-      .hasParam(PARAM_QUALITY_PROFILE, "P1")
-      .hasParam(PARAM_LANGUAGE, "Xoo")
-      .hasParam(PARAM_LOGIN, "john")
-      .andNoOtherParam();
-  }
-
-  @Test
-  public void search_users() {
-    underTest.searchUsers(SearchUsersRequest.builder()
-      .setOrganization("O1")
-      .setQualityProfile("P1")
-      .setLanguage("Xoo")
-      .setQuery("john")
-      .setSelected("all")
-      .setPage(5)
-      .setPageSize(50)
-      .build()
-    );
-    GetRequest getRequest = serviceTester.getGetRequest();
-
-    assertThat(serviceTester.getGetParser()).isSameAs(Qualityprofiles.SearchUsersResponse.parser());
-    serviceTester.assertThat(getRequest)
-      .hasPath("search_users")
-      .hasParam(PARAM_ORGANIZATION, "O1")
-      .hasParam(PARAM_QUALITY_PROFILE, "P1")
-      .hasParam(PARAM_LANGUAGE, "Xoo")
-      .hasParam(TEXT_QUERY, "john")
-      .hasParam(SELECTED, "all")
-      .hasParam(PAGE, 5)
-      .hasParam(PAGE_SIZE, 50)
-      .andNoOtherParam();
-  }
-
-  @Test
-  public void add_group() {
-    underTest.addGroup(AddGroupRequest.builder()
-      .setOrganization("O1")
-      .setQualityProfile("P1")
-      .setLanguage("Xoo")
-      .setGroup("users")
-      .build());
-    PostRequest request = serviceTester.getPostRequest();
-
-    serviceTester.assertThat(request)
-      .hasPath("add_group")
-      .hasParam(PARAM_ORGANIZATION, "O1")
-      .hasParam(PARAM_QUALITY_PROFILE, "P1")
-      .hasParam(PARAM_LANGUAGE, "Xoo")
-      .hasParam(PARAM_GROUP, "users")
-      .andNoOtherParam();
-  }
-
-  @Test
-  public void remove_group() {
-    underTest.removeGroup(RemoveGroupRequest.builder()
-      .setOrganization("O1")
-      .setQualityProfile("P1")
-      .setLanguage("Xoo")
-      .setGroup("users")
-      .build());
-    PostRequest request = serviceTester.getPostRequest();
-
-    serviceTester.assertThat(request)
-      .hasPath("remove_group")
-      .hasParam(PARAM_ORGANIZATION, "O1")
-      .hasParam(PARAM_QUALITY_PROFILE, "P1")
-      .hasParam(PARAM_LANGUAGE, "Xoo")
-      .hasParam(PARAM_GROUP, "users")
-      .andNoOtherParam();
-  }
-
-  @Test
-  public void search_groups() {
-    underTest.searchGroups(SearchGroupsRequest.builder()
-      .setOrganization("O1")
-      .setQualityProfile("P1")
-      .setLanguage("Xoo")
-      .setQuery("users")
-      .setSelected("all")
-      .setPage(5)
-      .setPageSize(50)
-      .build()
-    );
-    GetRequest getRequest = serviceTester.getGetRequest();
-
-    assertThat(serviceTester.getGetParser()).isSameAs(Qualityprofiles.SearchGroupsResponse.parser());
-    serviceTester.assertThat(getRequest)
-      .hasPath("search_groups")
-      .hasParam(PARAM_ORGANIZATION, "O1")
-      .hasParam(PARAM_QUALITY_PROFILE, "P1")
-      .hasParam(PARAM_LANGUAGE, "Xoo")
-      .hasParam(TEXT_QUERY, "users")
-      .hasParam(SELECTED, "all")
-      .hasParam(PAGE, 5)
-      .hasParam(PAGE_SIZE, 50)
-      .andNoOtherParam();
-  }
-}
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/qualityprofile/RemoveProjectRequestTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/qualityprofile/RemoveProjectRequestTest.java
deleted file mode 100644 (file)
index e6735e2..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonarqube.ws.client.qualityprofile;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class RemoveProjectRequestTest {
-
-  @Rule
-  public ExpectedException expectedException = ExpectedException.none();
-
-  RemoveProjectRequest.Builder underTest = RemoveProjectRequest.builder();
-
-  @Test
-  public void create_request_from_profile_key_and_project_key() {
-    RemoveProjectRequest result = underTest.setKey("SonarWay").setProjectKey("sample").build();
-
-    assertThat(result.getLanguage()).isNull();
-    assertThat(result.getKey()).isEqualTo("SonarWay");
-    assertThat(result.getQualityProfile()).isNull();
-    assertThat(result.getProjectKey()).isEqualTo("sample");
-    assertThat(result.getProjectUuid()).isNull();
-  }
-
-  @Test
-  public void create_request_from_profile_name_and_language_and_project_key() {
-    RemoveProjectRequest result = underTest.setLanguage("xoo").setQualityProfile("Sonar Way").setProjectKey("sample").build();
-
-    assertThat(result.getLanguage()).isEqualTo("xoo");
-    assertThat(result.getKey()).isNull();
-    assertThat(result.getQualityProfile()).isEqualTo("Sonar Way");
-    assertThat(result.getProjectKey()).isEqualTo("sample");
-    assertThat(result.getProjectUuid()).isNull();
-  }
-
-  @Test
-  public void create_request_from_profile_key_and_project_uuid() {
-    RemoveProjectRequest result = underTest.setKey("SonarWay").setProjectUuid("123").build();
-
-    assertThat(result.getLanguage()).isNull();
-    assertThat(result.getKey()).isEqualTo("SonarWay");
-    assertThat(result.getQualityProfile()).isNull();
-    assertThat(result.getProjectKey()).isNull();
-    assertThat(result.getProjectUuid()).isEqualTo("123");
-  }
-
-}
index ad68417e7c4ef228961cd2965dea8be93c31a140..45b4a28a05d71d0879a1245c86df2136e9ac8d2f 100644 (file)
@@ -28,7 +28,7 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.sonarqube.qa.util.Tester;
 import org.sonarqube.tests.Category4Suite;
-import org.sonarqube.ws.client.qualityprofile.AddProjectRequest;
+import org.sonarqube.ws.client.qualityprofiles.AddProjectRequest;
 import util.ItUtils;
 
 import static org.assertj.core.api.Assertions.assertThat;
@@ -239,8 +239,8 @@ public class IssueExclusionsTest {
     tester.projects().provision(p -> p
       .setKey("com.sonarsource.it.samples:multi-modules-exclusions")
       .setName("Sonar :: Integration Tests :: Multi-modules With Exclusions"));
-    tester.wsClient().qualityProfilesOld().addProject(AddProjectRequest.builder().setProjectKey("com.sonarsource.it.samples:multi-modules-exclusions")
-      .setLanguage("xoo").setQualityProfile("with-many-rules").build());
+    tester.wsClient().qualityprofiles().addProject(new AddProjectRequest().setProject("com.sonarsource.it.samples:multi-modules-exclusions")
+      .setLanguage("xoo").setQualityProfile("with-many-rules"));
 
     SonarScanner scan = SonarScanner.create(ItUtils.projectDir(PROJECT_DIR))
       .setProperty("sonar.cpd.exclusions", "**/*")
index 4bac6f1017e3335922330ef3ccafad4703dce361..647de95197f440579c486edb0255715e8dc2e2a7 100644 (file)
@@ -25,7 +25,7 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.sonarqube.qa.util.Tester;
 import org.sonarqube.ws.client.permissions.AddUserRequest;
-import org.sonarqube.ws.client.qualityprofile.CreateRequest;
+import org.sonarqube.ws.client.qualityprofiles.CreateRequest;
 import util.selenium.Selenese;
 
 import static util.ItUtils.runProjectAnalysis;
@@ -60,10 +60,9 @@ public class QualityProfileAdminPermissionTest {
   }
 
   private void createProfile(String language, String name) {
-    tester.wsClient().qualityProfilesOld().create(CreateRequest.builder()
+    tester.wsClient().qualityprofiles().create(new CreateRequest()
       .setLanguage(language)
-      .setName(name)
-      .build());
+      .setName(name));
   }
 
 }
index 4bd683f3277592afc0c3e957872007a00f2d7b95..79b0b20cd0f03c7feac794f4cd77a54d587b3b98 100644 (file)
@@ -38,7 +38,7 @@ import org.sonarqube.ws.client.issues.AssignRequest;
 import org.sonarqube.ws.client.issues.BulkChangeRequest;
 import org.sonarqube.ws.client.issues.SearchRequest;
 import org.sonarqube.ws.client.project.CreateRequest;
-import org.sonarqube.ws.client.qualityprofile.AddProjectRequest;
+import org.sonarqube.ws.client.qualityprofiles.AddProjectRequest;
 import util.issue.IssueRule;
 
 import static java.lang.String.format;
@@ -204,13 +204,12 @@ public class OrganizationIssueAssignTest {
   }
 
   private void addQualityProfileToProject(String organization, String projectKey) {
-    tester.wsClient().qualityProfilesOld().addProject(
-      AddProjectRequest.builder()
-        .setProjectKey(projectKey)
+    tester.wsClient().qualityprofiles().addProject(
+      new AddProjectRequest()
+        .setProject(projectKey)
         .setOrganization(organization)
         .setLanguage("xoo")
-        .setQualityProfile("one-issue-per-file-profile")
-        .build());
+        .setQualityProfile("one-issue-per-file-profile"));
   }
 
   private Issues.AssignResponse assignIssueTo(Issue issue, User u) {
index 092c1f7d833e51bebb29e66c480595c58cbf7edb..d6387035175964cfc34b7f0173be32d7af31ef31 100644 (file)
@@ -331,9 +331,9 @@ public class OrganizationTest {
   }
 
   private void assertThatBuiltInQualityProfilesExist(Organization org) {
-    org.sonarqube.ws.client.qualityprofile.SearchRequest profilesRequest = new org.sonarqube.ws.client.qualityprofile.SearchRequest()
-      .setOrganizationKey(org.getKey());
-    Qualityprofiles.SearchWsResponse response = tester.wsClient().qualityProfilesOld().search(profilesRequest);
+    org.sonarqube.ws.client.qualityprofiles.SearchRequest profilesRequest = new org.sonarqube.ws.client.qualityprofiles.SearchRequest()
+      .setOrganization(org.getKey());
+    Qualityprofiles.SearchWsResponse response = tester.wsClient().qualityprofiles().search(profilesRequest);
     assertThat(response.getProfilesCount()).isGreaterThan(0);
 
     response.getProfilesList().forEach(p -> {
@@ -354,7 +354,7 @@ public class OrganizationTest {
   }
 
   private void assertThatQualityProfilesDoNotExist(Organization org) {
-    expectNotFoundError(() -> tester.wsClient().qualityProfilesOld().search(
-      new org.sonarqube.ws.client.qualityprofile.SearchRequest().setOrganizationKey(org.getKey())));
+    expectNotFoundError(() -> tester.wsClient().qualityprofiles().search(
+      new org.sonarqube.ws.client.qualityprofiles.SearchRequest().setOrganization(org.getKey())));
   }
 }
index abaf407ee2039b220f6c3722d42b4c5b04c07eaf..018de95aa1f5e3411fff5ce743eaba9bce811aac 100644 (file)
@@ -33,8 +33,8 @@ import org.sonarqube.ws.client.PostRequest;
 import org.sonarqube.ws.client.WsClient;
 import org.sonarqube.ws.client.permissions.AddGroupRequest;
 import org.sonarqube.ws.client.permissions.AddUserRequest;
-import org.sonarqube.ws.client.qualityprofile.ChangeParentRequest;
-import org.sonarqube.ws.client.qualityprofile.CreateRequest;
+import org.sonarqube.ws.client.qualityprofiles.ChangeParentRequest;
+import org.sonarqube.ws.client.qualityprofiles.CreateRequest;
 import org.subethamail.wiser.Wiser;
 import org.subethamail.wiser.WiserMessage;
 import util.ItUtils;
@@ -111,8 +111,8 @@ public class BuiltInQualityProfilesNotificationTest {
     Users.CreateWsResponse.User noProfileAdmin = userRule.generate();
 
     // Create a child profile on the built-in profile => The notification should not take into account updates of this profile
-    wsClient.qualityProfilesOld().create(CreateRequest.builder().setLanguage("foo").setName("child").build());
-    wsClient.qualityProfilesOld().changeParent(ChangeParentRequest.builder().setProfileName("child").setParentName("Basic").setLanguage("foo").build());
+    wsClient.qualityprofiles().create(new CreateRequest().setLanguage("foo").setName("child"));
+    wsClient.qualityprofiles().changeParent(new ChangeParentRequest().setQualityProfile("child").setParentQualityProfile("Basic").setLanguage("foo"));
 
     // uninstall plugin V1
     wsClient.wsConnector().call(new PostRequest("api/plugins/uninstall").setParam("key", "foo")).failIfNotSuccessful();
index be5eb2a3ee92bb1cbd2e393d4757e0c07f6bcb23..6994f1a8a9584566fec1e7900c92fe5abddd3f5c 100644 (file)
@@ -24,20 +24,22 @@ import java.util.function.Predicate;
 import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
-import org.sonarqube.tests.Category6Suite;
-import org.sonarqube.qa.util.TesterSession;
 import org.sonarqube.qa.util.Tester;
+import org.sonarqube.qa.util.TesterSession;
+import org.sonarqube.tests.Category6Suite;
 import org.sonarqube.ws.Organizations.Organization;
 import org.sonarqube.ws.Qualityprofiles;
 import org.sonarqube.ws.Qualityprofiles.CreateWsResponse;
 import org.sonarqube.ws.Qualityprofiles.SearchWsResponse;
 import org.sonarqube.ws.Qualityprofiles.SearchWsResponse.QualityProfile;
 import org.sonarqube.ws.Users.CreateWsResponse.User;
-import org.sonarqube.ws.client.qualityprofile.ChangeParentRequest;
-import org.sonarqube.ws.client.qualityprofile.CopyRequest;
-import org.sonarqube.ws.client.qualityprofile.QualityProfilesService;
-import org.sonarqube.ws.client.qualityprofile.SearchRequest;
-import org.sonarqube.ws.client.qualityprofile.SetDefaultRequest;
+import org.sonarqube.ws.client.qualityprofiles.ChangeParentRequest;
+import org.sonarqube.ws.client.qualityprofiles.CopyRequest;
+import org.sonarqube.ws.client.qualityprofiles.DeactivateRuleRequest;
+import org.sonarqube.ws.client.qualityprofiles.DeleteRequest;
+import org.sonarqube.ws.client.qualityprofiles.QualityprofilesService;
+import org.sonarqube.ws.client.qualityprofiles.SearchRequest;
+import org.sonarqube.ws.client.qualityprofiles.SetDefaultRequest;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.tuple;
@@ -55,7 +57,7 @@ public class BuiltInQualityProfilesTest {
   @Test
   public void built_in_profiles_are_available_in_new_organization() {
     Organization org = tester.organizations().generate();
-    SearchWsResponse result = tester.qProfiles().service().search(new SearchRequest().setOrganizationKey(org.getKey()));
+    SearchWsResponse result = tester.qProfiles().service().search(new SearchRequest().setOrganization(org.getKey()));
 
     assertThat(result.getProfilesList())
       .extracting(QualityProfile::getName, QualityProfile::getLanguage, QualityProfile::getIsBuiltIn, QualityProfile::getIsDefault)
@@ -70,7 +72,7 @@ public class BuiltInQualityProfilesTest {
 
   @Test
   public void built_in_profiles_are_available_in_default_organization() {
-    SearchWsResponse result = tester.qProfiles().service().search(new SearchRequest().setOrganizationKey("default-organization"));
+    SearchWsResponse result = tester.qProfiles().service().search(new SearchRequest().setOrganization("default-organization"));
 
     assertThat(result.getProfilesList())
       .extracting(QualityProfile::getOrganization, QualityProfile::getName, QualityProfile::getLanguage, QualityProfile::getIsBuiltIn, QualityProfile::getIsDefault)
@@ -89,9 +91,9 @@ public class BuiltInQualityProfilesTest {
     QualityProfile builtInProfile = getProfile(org, p -> p.getIsBuiltIn() && p.getIsDefault() && "Basic".equals(p.getName()) && "xoo".equals(p.getLanguage()));
 
     CreateWsResponse.QualityProfile profileInOrg = tester.qProfiles().createXooProfile(org);
-    tester.qProfiles().service().setDefault(new SetDefaultRequest(profileInOrg.getKey()));
+    tester.qProfiles().service().setDefault(new SetDefaultRequest().setKey(profileInOrg.getKey()));
 
-    expectBadRequestError(() -> tester.qProfiles().service().delete(builtInProfile.getKey()));
+    expectBadRequestError(() -> tester.qProfiles().service().delete(new DeleteRequest().setKey(builtInProfile.getKey())));
   }
 
   @Test
@@ -99,10 +101,11 @@ public class BuiltInQualityProfilesTest {
     Organization org = tester.organizations().generate();
     QualityProfile builtInProfile = getProfile(org, p -> p.getIsBuiltIn() && p.getIsDefault() && "Basic".equals(p.getName()) && "xoo".equals(p.getLanguage()));
 
-    QualityProfilesService service = tester.qProfiles().service();
+    QualityprofilesService service = tester.qProfiles().service();
     expectBadRequestError(() -> tester.qProfiles().activateRule(builtInProfile.getKey(), RULE_ONE_BUG_PER_LINE));
-    expectBadRequestError(() -> service.deactivateRule(builtInProfile.getKey(), RULE_ONE_BUG_PER_LINE));
-    expectBadRequestError(() -> service.delete(builtInProfile.getKey()));
+    expectBadRequestError(() -> service.deactivateRule(new DeactivateRuleRequest()
+            .setKey(builtInProfile.getKey()).setRule(RULE_ONE_BUG_PER_LINE)));
+    expectBadRequestError(() -> service.delete(new DeleteRequest().setKey(builtInProfile.getKey())));
   }
 
   @Test
@@ -112,7 +115,7 @@ public class BuiltInQualityProfilesTest {
     QualityProfile builtInProfile = getProfile(org, p -> p.getIsBuiltIn() && "Basic".equals(p.getName()) && "xoo".equals(p.getLanguage()));
     TesterSession adminSession = tester.as(administrator.getLogin());
 
-    Qualityprofiles.CopyWsResponse copyResponse = adminSession.qProfiles().service().copy(new CopyRequest(builtInProfile.getKey(), "My copy"));
+    Qualityprofiles.CopyWsResponse copyResponse = adminSession.qProfiles().service().copy(new CopyRequest().setFromKey(builtInProfile.getKey()).setToName("My copy"));
 
     assertThat(copyResponse.getIsDefault()).isFalse();
     assertThat(copyResponse.getKey()).isNotEmpty().isNotEqualTo(builtInProfile.getKey());
@@ -134,9 +137,9 @@ public class BuiltInQualityProfilesTest {
     QualityProfile builtInProfile = getProfile(org, p -> p.getIsBuiltIn() && "Basic".equals(p.getName()) && "xoo".equals(p.getLanguage()));
     TesterSession adminSession = tester.as(administrator.getLogin());
 
-    Qualityprofiles.CopyWsResponse copyResponse = adminSession.qProfiles().service().copy(new CopyRequest(builtInProfile.getKey(), "My copy"));
+    Qualityprofiles.CopyWsResponse copyResponse = adminSession.qProfiles().service().copy(new CopyRequest().setFromKey(builtInProfile.getKey()).setToName("My copy"));
     adminSession.qProfiles().service().changeParent(
-      ChangeParentRequest.builder().setParentKey(builtInProfile.getKey()).setProfileKey(copyResponse.getKey()).build());
+      new ChangeParentRequest().setParentKey(builtInProfile.getKey()).setKey(copyResponse.getKey()));
 
     QualityProfile inheritedQualityPropfile = getProfile(org, p -> p.getKey().equals(copyResponse.getKey()));
 
@@ -145,7 +148,7 @@ public class BuiltInQualityProfilesTest {
 
     // Remove inheritance
     adminSession.qProfiles().service().changeParent(
-      new ChangeParentRequest(ChangeParentRequest.builder().setProfileKey(inheritedQualityPropfile.getKey())));
+      new ChangeParentRequest().setKey(inheritedQualityPropfile.getKey()));
 
     inheritedQualityPropfile = getProfile(org, p -> p.getKey().equals(copyResponse.getKey()));
 
@@ -155,7 +158,7 @@ public class BuiltInQualityProfilesTest {
 
   private QualityProfile getProfile(Organization organization, Predicate<QualityProfile> filter) {
     return tester.qProfiles().service().search(new SearchRequest()
-      .setOrganizationKey(organization.getKey())).getProfilesList()
+      .setOrganization(organization.getKey())).getProfilesList()
       .stream()
       .filter(filter)
       .findAny().orElseThrow(IllegalStateException::new);
index c3866bb6c0faaa580b65e8d11fca92edc60a1c60..0a11bd742039dc50bc6b0ebc7dc963ad1af66240 100644 (file)
@@ -21,7 +21,6 @@ package org.sonarqube.tests.qualityProfile;
 
 import com.sonar.orchestrator.Orchestrator;
 import com.sonar.orchestrator.build.SonarScanner;
-import org.sonarqube.tests.Category6Suite;
 import java.util.List;
 import java.util.Map;
 import java.util.function.Predicate;
@@ -29,8 +28,9 @@ import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
 import org.sonarqube.qa.util.QProfileTester;
-import org.sonarqube.qa.util.TesterSession;
 import org.sonarqube.qa.util.Tester;
+import org.sonarqube.qa.util.TesterSession;
+import org.sonarqube.tests.Category6Suite;
 import org.sonarqube.ws.Organizations.Organization;
 import org.sonarqube.ws.Qualityprofiles;
 import org.sonarqube.ws.Qualityprofiles.CreateWsResponse.QualityProfile;
@@ -38,12 +38,12 @@ import org.sonarqube.ws.Users.CreateWsResponse.User;
 import org.sonarqube.ws.client.GetRequest;
 import org.sonarqube.ws.client.PostRequest;
 import org.sonarqube.ws.client.organizations.DeleteRequest;
-import org.sonarqube.ws.client.qualityprofile.AddProjectRequest;
-import org.sonarqube.ws.client.qualityprofile.ChangeParentRequest;
-import org.sonarqube.ws.client.qualityprofile.CopyRequest;
-import org.sonarqube.ws.client.qualityprofile.CreateRequest;
-import org.sonarqube.ws.client.qualityprofile.SearchRequest;
-import org.sonarqube.ws.client.qualityprofile.SetDefaultRequest;
+import org.sonarqube.ws.client.qualityprofiles.AddProjectRequest;
+import org.sonarqube.ws.client.qualityprofiles.ChangeParentRequest;
+import org.sonarqube.ws.client.qualityprofiles.CopyRequest;
+import org.sonarqube.ws.client.qualityprofiles.CreateRequest;
+import org.sonarqube.ws.client.qualityprofiles.SearchRequest;
+import org.sonarqube.ws.client.qualityprofiles.SetDefaultRequest;
 import util.ItUtils;
 
 import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
@@ -112,7 +112,7 @@ public class CustomQualityProfilesTest {
       .activateRule(profile, "xoo:OneIssuePerFile")
       .assertThatNumberOfActiveRulesEqualsTo(profile, 1);
 
-    adminSession.service().delete(profile.getKey());
+    adminSession.service().delete(new org.sonarqube.ws.client.qualityprofiles.DeleteRequest().setKey(profile.getKey()));
     adminSession.assertThatNumberOfActiveRulesEqualsTo(profile, 0);
   }
 
@@ -127,36 +127,34 @@ public class CustomQualityProfilesTest {
 
     // Copied profile
     Qualityprofiles.SearchWsResponse.QualityProfile builtInProfile = getProfile(org, p -> p.getIsBuiltIn() && "Basic".equals(p.getName()) && "xoo".equals(p.getLanguage()));
-    Qualityprofiles.CopyWsResponse copyResponse = adminSession.service().copy(new CopyRequest(builtInProfile.getKey(), "My copy"));
+    Qualityprofiles.CopyWsResponse copyResponse = adminSession.service().copy(new CopyRequest().setFromKey(builtInProfile.getKey()).setToName("My copy"));
 
     // Inherited profile from custom
     QualityProfile inheritedProfile1 = adminSession.service().create(
-      CreateRequest.builder()
+      new CreateRequest()
         .setLanguage(parentProfile.getLanguage())
-        .setOrganizationKey(org.getKey())
-        .setName("inherited_profile")
-        .build())
+        .setOrganization(org.getKey())
+        .setName("inherited_profile"))
       .getProfile();
 
     adminSession.service().changeParent(
-      ChangeParentRequest.builder().setParentKey(parentProfile.getKey()).setProfileKey(inheritedProfile1.getKey()).build());
+      new ChangeParentRequest().setParentKey(parentProfile.getKey()).setKey(inheritedProfile1.getKey()));
 
     // Inherited profile from builtIn
     QualityProfile inheritedProfile2 = adminSession.service().create(
-      CreateRequest.builder()
+      new CreateRequest()
         .setLanguage(parentProfile.getLanguage())
-        .setOrganizationKey(org.getKey())
-        .setName("inherited_profile2")
-        .build())
+        .setOrganization(org.getKey())
+        .setName("inherited_profile2"))
       .getProfile();
 
     adminSession.service().changeParent(
-      ChangeParentRequest.builder().setParentKey(builtInProfile.getKey()).setProfileKey(inheritedProfile2.getKey()).build());
+      new ChangeParentRequest().setParentKey(builtInProfile.getKey()).setKey(inheritedProfile2.getKey()));
 
     tester.organizations().service().delete(new DeleteRequest().setOrganization(org.getKey()));
 
     expectMissingError(() -> tester.qProfiles().service().search(new SearchRequest()
-      .setOrganizationKey(org.getKey())));
+      .setOrganization(org.getKey())));
 
     tester.qProfiles().service().search(new SearchRequest()).getProfilesList()
       .forEach(p -> {
@@ -175,13 +173,13 @@ public class CustomQualityProfilesTest {
     QProfileTester adminSession = tester.as(adminOfOrg1.getLogin()).qProfiles();
 
     expectForbiddenError(() -> adminSession.createXooProfile(org2));
-    expectForbiddenError(() -> adminSession.service().delete(profileInOrg2.getKey()));
+    expectForbiddenError(() -> adminSession.service().delete(new org.sonarqube.ws.client.qualityprofiles.DeleteRequest().setKey(profileInOrg2.getKey())));
     expectForbiddenError(() -> adminSession.activateRule(profileInOrg2, "xoo:OneIssuePerFile"));
     expectForbiddenError(() -> adminSession.deactivateRule(profileInOrg2, "xoo:OneIssuePerFile"));
   }
 
   private void delete(QualityProfile profile) {
-    tester.qProfiles().service().delete(profile.getKey());
+    tester.qProfiles().service().delete(new org.sonarqube.ws.client.qualityprofiles.DeleteRequest().setKey(profile.getKey()));
   }
 
   @Test
@@ -192,7 +190,7 @@ public class CustomQualityProfilesTest {
     TesterSession anonymousSession = tester.asAnonymous();
 
     expectUnauthorizedError(() -> anonymousSession.qProfiles().createXooProfile(org));
-    expectUnauthorizedError(() -> anonymousSession.qProfiles().service().delete(profile.getKey()));
+    expectUnauthorizedError(() -> anonymousSession.qProfiles().service().delete(new org.sonarqube.ws.client.qualityprofiles.DeleteRequest().setKey(profile.getKey())));
     expectUnauthorizedError(() -> anonymousSession.qProfiles().activateRule(profile, "xoo:OneIssuePerFile"));
     expectUnauthorizedError(() -> anonymousSession.qProfiles().deactivateRule(profile, "xoo:OneIssuePerFile"));
   }
@@ -209,7 +207,7 @@ public class CustomQualityProfilesTest {
     tester.qProfiles()
       .activateRule(profile, "xoo:OneIssuePerFile")
       .assertThatNumberOfActiveRulesEqualsTo(profile, 1);
-    tester.qProfiles().service().delete(profile.getKey());
+    tester.qProfiles().service().delete(new org.sonarqube.ws.client.qualityprofiles.DeleteRequest().setKey(profile.getKey()));
     tester.qProfiles().assertThatNumberOfActiveRulesEqualsTo(profile, 0);
   }
 
@@ -221,15 +219,14 @@ public class CustomQualityProfilesTest {
     TesterSession adminSession = tester.as(user.getLogin());
     QualityProfile parentProfile = adminSession.qProfiles().createXooProfile(org);
     QualityProfile inheritedProfile = adminSession.qProfiles().service().create(
-      CreateRequest.builder()
+      new CreateRequest()
         .setLanguage(parentProfile.getLanguage())
-        .setOrganizationKey(org.getKey())
-        .setName("inherited_profile")
-        .build())
+        .setOrganization(org.getKey())
+        .setName("inherited_profile"))
       .getProfile();
 
     adminSession.qProfiles().service().changeParent(
-      ChangeParentRequest.builder().setParentKey(parentProfile.getKey()).setProfileKey(inheritedProfile.getKey()).build());
+      new ChangeParentRequest().setParentKey(parentProfile.getKey()).setKey(inheritedProfile.getKey()));
 
     Qualityprofiles.SearchWsResponse.QualityProfile inheritedQualityPropfile = getProfile(org, p -> p.getKey().equals(inheritedProfile.getKey()));
 
@@ -238,7 +235,7 @@ public class CustomQualityProfilesTest {
 
     // Remove inheritance
     adminSession.qProfiles().service().changeParent(
-      new ChangeParentRequest(ChangeParentRequest.builder().setProfileKey(inheritedQualityPropfile.getKey())));
+      new ChangeParentRequest().setKey(inheritedQualityPropfile.getKey()));
 
     inheritedQualityPropfile = getProfile(org, p -> p.getKey().equals(inheritedProfile.getKey()));
 
@@ -268,7 +265,7 @@ public class CustomQualityProfilesTest {
     assertThatQualityProfileIsUsedFor(projectKey, defaultProfile.getKey());
 
     QualityProfile newXooProfile = adminSession.qProfiles().createXooProfile(org);
-    adminSession.qProfiles().service().setDefault(new SetDefaultRequest(newXooProfile.getKey()));
+    adminSession.qProfiles().service().setDefault(new SetDefaultRequest().setKey(newXooProfile.getKey()));
 
     orchestrator.executeBuild(
       SonarScanner.create(projectDir("shared/xoo-sample"),
@@ -295,10 +292,9 @@ public class CustomQualityProfilesTest {
       .setParam("name", projectName)
       .setParam("organization", org.getKey()));
 
-    adminSession.qProfiles().service().addProject(AddProjectRequest.builder()
+    adminSession.qProfiles().service().addProject(new AddProjectRequest()
       .setKey(newXooProfile.getKey())
-      .setProjectKey(projectKey)
-      .build());
+      .setProject(projectKey));
 
     orchestrator.executeBuild(
       SonarScanner.create(projectDir("shared/xoo-sample"),
@@ -321,7 +317,7 @@ public class CustomQualityProfilesTest {
 
   private Qualityprofiles.SearchWsResponse.QualityProfile getProfile(Organization organization, Predicate<Qualityprofiles.SearchWsResponse.QualityProfile> filter) {
     return tester.qProfiles().service().search(new SearchRequest()
-      .setOrganizationKey(organization.getKey())).getProfilesList()
+      .setOrganization(organization.getKey())).getProfilesList()
       .stream()
       .filter(filter)
       .findAny().orElseThrow(IllegalStateException::new);
index 83c7f9e7b51a2e2328f01142365d63e37088a873..bc1d4d6e87e25cf6ec18217e68df4d023d6d94fc 100644 (file)
@@ -35,8 +35,8 @@ import org.sonarqube.ws.Organizations.Organization;
 import org.sonarqube.ws.Qualityprofiles;
 import org.sonarqube.ws.Users.CreateWsResponse.User;
 import org.sonarqube.ws.client.PostRequest;
-import org.sonarqube.ws.client.qualityprofile.AddProjectRequest;
-import org.sonarqube.ws.client.qualityprofile.ChangeParentRequest;
+import org.sonarqube.ws.client.qualityprofiles.AddProjectRequest;
+import org.sonarqube.ws.client.qualityprofiles.ChangeParentRequest;
 import util.selenium.Selenese;
 
 import static com.codeborne.selenide.Selenide.$;
@@ -184,12 +184,11 @@ public class OrganizationQualityProfilesUiTest {
   }
 
   private void inheritProfile(String language, String name, String parentName) {
-    tester.wsClient().qualityProfilesOld().changeParent(ChangeParentRequest.builder()
+    tester.wsClient().qualityprofiles().changeParent(new ChangeParentRequest()
       .setLanguage(language)
-      .setProfileName(name)
-      .setParentName(parentName)
-      .setOrganization(organization.getKey())
-      .build());
+      .setQualityProfile(name)
+      .setParentQualityProfile(parentName)
+      .setOrganization(organization.getKey()));
   }
 
   private void analyzeProject(String path) {
@@ -200,12 +199,11 @@ public class OrganizationQualityProfilesUiTest {
   }
 
   private void addProfileToProject(String language, String profileName, String projectKey) {
-    tester.wsClient().qualityProfilesOld().addProject(AddProjectRequest.builder()
+    tester.wsClient().qualityprofiles().addProject(new AddProjectRequest()
       .setLanguage(language)
       .setQualityProfile(profileName)
-      .setProjectKey(projectKey)
-      .setOrganization(organization.getKey())
-      .build());
+      .setProject(projectKey)
+      .setOrganization(organization.getKey()));
   }
 
   private void deleteProfile(String language, String name) {
index 6ae433c2567b439368e2bcd1268aef1f0a85c2e6..c5ba0483a4a64cad77a08f08e186d7643151a709 100644 (file)
@@ -36,13 +36,13 @@ import org.sonarqube.ws.UserGroups;
 import org.sonarqube.ws.Users.CreateWsResponse.User;
 import org.sonarqube.ws.client.PostRequest;
 import org.sonarqube.ws.client.permissions.AddUserRequest;
-import org.sonarqube.ws.client.qualityprofile.AddGroupRequest;
-import org.sonarqube.ws.client.qualityprofile.RemoveGroupRequest;
-import org.sonarqube.ws.client.qualityprofile.RemoveUserRequest;
-import org.sonarqube.ws.client.qualityprofile.SearchGroupsRequest;
-import org.sonarqube.ws.client.qualityprofile.SearchUsersRequest;
-import org.sonarqube.ws.client.qualityprofile.SearchRequest;
-import org.sonarqube.ws.client.qualityprofile.ShowRequest;
+import org.sonarqube.ws.client.qualityprofiles.AddGroupRequest;
+import org.sonarqube.ws.client.qualityprofiles.RemoveGroupRequest;
+import org.sonarqube.ws.client.qualityprofiles.RemoveUserRequest;
+import org.sonarqube.ws.client.qualityprofiles.SearchGroupsRequest;
+import org.sonarqube.ws.client.qualityprofiles.SearchRequest;
+import org.sonarqube.ws.client.qualityprofiles.SearchUsersRequest;
+import org.sonarqube.ws.client.qualityprofiles.ShowRequest;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.tuple;
@@ -66,12 +66,11 @@ public class QualityProfilesEditTest {
     CreateWsResponse.QualityProfile xooProfile = tester.qProfiles().createXooProfile(organization);
     addUserPermission(organization, user1, xooProfile);
 
-    SearchUsersResponse users = tester.qProfiles().service().searchUsers(SearchUsersRequest.builder()
+    SearchUsersResponse users = tester.qProfiles().service().searchUsers(new SearchUsersRequest()
       .setOrganization(organization.getKey())
       .setQualityProfile(xooProfile.getName())
       .setLanguage(xooProfile.getLanguage())
-      .setSelected("all")
-      .build());
+      .setSelected("all"));
 
     assertThat(users.getUsersList())
       .extracting(SearchUsersResponse.User::getLogin, SearchUsersResponse.User::getName, SearchUsersResponse.User::getAvatar, SearchUsersResponse.User::getSelected)
@@ -91,39 +90,35 @@ public class QualityProfilesEditTest {
     CreateWsResponse.QualityProfile xooProfile = tester.qProfiles().createXooProfile(organization);
 
     // No user added
-    assertThat(tester.qProfiles().service().searchUsers(SearchUsersRequest.builder()
+    assertThat(tester.qProfiles().service().searchUsers(new SearchUsersRequest()
       .setOrganization(organization.getKey())
       .setQualityProfile(xooProfile.getName())
       .setLanguage(xooProfile.getLanguage())
-      .setSelected("selected")
-      .build()).getUsersList())
+      .setSelected("selected")).getUsersList())
         .extracting(SearchUsersResponse.User::getLogin)
         .isEmpty();
 
     // Add user 1
     addUserPermission(organization, user1, xooProfile);
-    assertThat(tester.qProfiles().service().searchUsers(SearchUsersRequest.builder()
+    assertThat(tester.qProfiles().service().searchUsers(new SearchUsersRequest()
       .setOrganization(organization.getKey())
       .setQualityProfile(xooProfile.getName())
       .setLanguage(xooProfile.getLanguage())
-      .setSelected("selected")
-      .build()).getUsersList())
+      .setSelected("selected")).getUsersList())
         .extracting(SearchUsersResponse.User::getLogin)
         .containsExactlyInAnyOrder(user1.getLogin());
 
     // Remove user 1
-    tester.qProfiles().service().removeUser(RemoveUserRequest.builder()
+    tester.qProfiles().service().removeUser(new RemoveUserRequest()
       .setOrganization(organization.getKey())
       .setQualityProfile(xooProfile.getName())
       .setLanguage(xooProfile.getLanguage())
-      .setUserLogin(user1.getLogin())
-      .build());
-    assertThat(tester.qProfiles().service().searchUsers(SearchUsersRequest.builder()
+      .setLogin(user1.getLogin()));
+    assertThat(tester.qProfiles().service().searchUsers(new SearchUsersRequest()
       .setOrganization(organization.getKey())
       .setQualityProfile(xooProfile.getName())
       .setLanguage(xooProfile.getLanguage())
-      .setSelected("selected")
-      .build()).getUsersList())
+      .setSelected("selected")).getUsersList())
         .extracting(SearchUsersResponse.User::getLogin)
         .isEmpty();
   }
@@ -138,11 +133,10 @@ public class QualityProfilesEditTest {
     addGroupPermission(organization, group1, xooProfile);
     addGroupPermission(organization, group2, xooProfile);
 
-    SearchGroupsResponse groups = tester.qProfiles().service().searchGroups(SearchGroupsRequest.builder()
+    SearchGroupsResponse groups = tester.qProfiles().service().searchGroups(new SearchGroupsRequest()
       .setOrganization(organization.getKey())
       .setQualityProfile(xooProfile.getName())
-      .setLanguage(xooProfile.getLanguage())
-      .build());
+      .setLanguage(xooProfile.getLanguage()));
 
     assertThat(groups.getGroupsList()).extracting(Group::getName, Group::getDescription, Group::getSelected)
       .containsExactlyInAnyOrder(
@@ -160,39 +154,35 @@ public class QualityProfilesEditTest {
     CreateWsResponse.QualityProfile xooProfile = tester.qProfiles().createXooProfile(organization);
 
     // No group added
-    assertThat(tester.qProfiles().service().searchGroups(SearchGroupsRequest.builder()
+    assertThat(tester.qProfiles().service().searchGroups(new SearchGroupsRequest()
       .setOrganization(organization.getKey())
       .setQualityProfile(xooProfile.getName())
       .setLanguage(xooProfile.getLanguage())
-      .setSelected("selected")
-      .build()).getGroupsList())
+      .setSelected("selected")).getGroupsList())
         .extracting(Group::getName)
         .isEmpty();
 
     // Add group 1
     addGroupPermission(organization, group1, xooProfile);
-    assertThat(tester.qProfiles().service().searchGroups(SearchGroupsRequest.builder()
+    assertThat(tester.qProfiles().service().searchGroups(new SearchGroupsRequest()
       .setOrganization(organization.getKey())
       .setQualityProfile(xooProfile.getName())
       .setLanguage(xooProfile.getLanguage())
-      .setSelected("selected")
-      .build()).getGroupsList())
+      .setSelected("selected")).getGroupsList())
         .extracting(Group::getName)
         .containsExactlyInAnyOrder(group1.getName());
 
     // Remove group 1
-    tester.qProfiles().service().removeGroup(RemoveGroupRequest.builder()
+    tester.qProfiles().service().removeGroup(new RemoveGroupRequest()
       .setOrganization(organization.getKey())
       .setQualityProfile(xooProfile.getName())
       .setLanguage(xooProfile.getLanguage())
-      .setGroup(group1.getName())
-      .build());
-    assertThat(tester.qProfiles().service().searchGroups(SearchGroupsRequest.builder()
+      .setGroup(group1.getName()));
+    assertThat(tester.qProfiles().service().searchGroups(new SearchGroupsRequest()
       .setOrganization(organization.getKey())
       .setQualityProfile(xooProfile.getName())
       .setLanguage(xooProfile.getLanguage())
-      .setSelected("selected")
-      .build()).getGroupsList())
+      .setSelected("selected")).getGroupsList())
         .extracting(Group::getName)
         .isEmpty();
   }
@@ -210,7 +200,7 @@ public class QualityProfilesEditTest {
     CreateWsResponse.QualityProfile xooProfile3 = tester.qProfiles().createXooProfile(organization);
 
     SearchWsResponse result = tester.as(user.getLogin())
-      .qProfiles().service().search(new SearchRequest().setOrganizationKey(organization.getKey()));
+      .qProfiles().service().search(new SearchRequest().setOrganization(organization.getKey()));
     assertThat(result.getActions().getCreate()).isFalse();
     assertThat(result.getProfilesList())
       .extracting(SearchWsResponse.QualityProfile::getKey, qp -> qp.getActions().getEdit(), qp -> qp.getActions().getCopy(), qp -> qp.getActions().getSetAsDefault(),
@@ -229,7 +219,7 @@ public class QualityProfilesEditTest {
     tester.wsClient().permissions().addUser(new AddUserRequest().setOrganization(organization.getKey()).setLogin(user.getLogin()).setPermission("profileadmin"));
 
     SearchWsResponse result = tester.as(user.getLogin())
-      .qProfiles().service().search(new SearchRequest().setOrganizationKey(organization.getKey()));
+      .qProfiles().service().search(new SearchRequest().setOrganization(organization.getKey()));
     assertThat(result.getActions().getCreate()).isTrue();
     assertThat(result.getProfilesList())
       .extracting(SearchWsResponse.QualityProfile::getKey, qp -> qp.getActions().getEdit(), qp -> qp.getActions().getCopy(), qp -> qp.getActions().getSetAsDefault(),
@@ -263,31 +253,29 @@ public class QualityProfilesEditTest {
       .failIfNotSuccessful();
 
     // Check that the profile has no missing rule from the Sonar way profile
-    assertThat(tester.qProfiles().service().show(new ShowRequest().setKey(xooProfile.getKey()).setCompareToSonarWay(true)).getCompareToSonarWay().getMissingRuleCount())
+    assertThat(tester.qProfiles().service().show(new ShowRequest().setKey(xooProfile.getKey()).setCompareToSonarWay("true")).getCompareToSonarWay().getMissingRuleCount())
       .isZero();
   }
 
   private void addUserPermission(Organization organization, User user, CreateWsResponse.QualityProfile qProfile) {
-    tester.qProfiles().service().addUser(org.sonarqube.ws.client.qualityprofile.AddUserRequest.builder()
+    tester.qProfiles().service().addUser(new org.sonarqube.ws.client.qualityprofiles.AddUserRequest()
       .setOrganization(organization.getKey())
       .setQualityProfile(qProfile.getName())
       .setLanguage(qProfile.getLanguage())
-      .setUserLogin(user.getLogin())
-      .build());
+      .setLogin(user.getLogin()));
   }
 
   private void addGroupPermission(Organization organization, UserGroups.Group group, CreateWsResponse.QualityProfile qProfile) {
-    tester.qProfiles().service().addGroup(AddGroupRequest.builder()
+    tester.qProfiles().service().addGroup(new AddGroupRequest()
       .setOrganization(organization.getKey())
       .setQualityProfile(qProfile.getName())
       .setLanguage(qProfile.getLanguage())
-      .setGroup(group.getName())
-      .build());
+      .setGroup(group.getName()));
   }
 
   private SearchWsResponse.QualityProfile getProfile(Organization organization, Predicate<SearchWsResponse.QualityProfile> filter) {
     return tester.qProfiles().service().search(new SearchRequest()
-      .setOrganizationKey(organization.getKey())).getProfilesList()
+      .setOrganization(organization.getKey())).getProfilesList()
       .stream()
       .filter(filter)
       .findAny().orElseThrow(IllegalStateException::new);
index 71ff0ad3755ea3e9a38f472ed0cc5cf21381ad8d..3208f9e96a80ebebfdf53a323d2205818919c571 100644 (file)
@@ -31,9 +31,9 @@ import org.sonarqube.qa.util.Tester;
 import org.sonarqube.qa.util.pageobjects.Navigation;
 import org.sonarqube.tests.Category4Suite;
 import org.sonarqube.ws.client.PostRequest;
-import org.sonarqube.ws.client.qualityprofile.AddProjectRequest;
-import org.sonarqube.ws.client.qualityprofile.ChangeParentRequest;
-import org.sonarqube.ws.client.qualityprofile.CreateRequest;
+import org.sonarqube.ws.client.qualityprofiles.AddProjectRequest;
+import org.sonarqube.ws.client.qualityprofiles.ChangeParentRequest;
+import org.sonarqube.ws.client.qualityprofiles.CreateRequest;
 import util.selenium.Selenese;
 import util.user.UserRule;
 
@@ -154,18 +154,16 @@ public class QualityProfilesUiTest {
   }
 
   private void createProfile(String language, String name) {
-    tester.wsClient().qualityProfilesOld().create(CreateRequest.builder()
+    tester.wsClient().qualityprofiles().create(new CreateRequest()
       .setLanguage(language)
-      .setName(name)
-      .build());
+      .setName(name));
   }
 
   private void inheritProfile(String language, String name, String parentName) {
-    tester.wsClient().qualityProfilesOld().changeParent(ChangeParentRequest.builder()
+    tester.wsClient().qualityprofiles().changeParent(new ChangeParentRequest()
       .setLanguage(language)
-      .setProfileName(name)
-      .setParentName(parentName)
-      .build());
+      .setQualityProfile(name)
+      .setParentQualityProfile(parentName));
   }
 
   private static void analyzeProject(String path) {
@@ -173,11 +171,10 @@ public class QualityProfilesUiTest {
   }
 
   private void addProfileToProject(String language, String profileName, String projectKey) {
-    tester.wsClient().qualityProfilesOld().addProject(AddProjectRequest.builder()
+    tester.wsClient().qualityprofiles().addProject(new AddProjectRequest()
       .setLanguage(language)
       .setQualityProfile(profileName)
-      .setProjectKey(projectKey)
-      .build());
+      .setProject(projectKey));
   }
 
   private void deleteProfile(String language, String name) {
index e39af31e2c006bc5279204e967d7b038346dcda8..e880e3007ef41a62adbcf4f574d74b2664ffd6f4 100644 (file)
@@ -27,8 +27,8 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.skyscreamer.jsonassert.JSONAssert;
 import org.skyscreamer.jsonassert.JSONCompareMode;
-import org.sonarqube.tests.Category6Suite;
 import org.sonarqube.qa.util.Tester;
+import org.sonarqube.tests.Category6Suite;
 import org.sonarqube.ws.Organizations.Organization;
 import org.sonarqube.ws.Qualityprofiles.CreateWsResponse;
 import org.sonarqube.ws.Qualityprofiles.SearchWsResponse;
@@ -38,9 +38,9 @@ import org.sonarqube.ws.Qualityprofiles.ShowResponse.QualityProfile;
 import org.sonarqube.ws.client.GetRequest;
 import org.sonarqube.ws.client.PostRequest;
 import org.sonarqube.ws.client.WsResponse;
-import org.sonarqube.ws.client.qualityprofile.ChangelogRequest;
-import org.sonarqube.ws.client.qualityprofile.SearchRequest;
-import org.sonarqube.ws.client.qualityprofile.ShowRequest;
+import org.sonarqube.ws.client.qualityprofiles.ChangelogRequest;
+import org.sonarqube.ws.client.qualityprofiles.SearchRequest;
+import org.sonarqube.ws.client.qualityprofiles.ShowRequest;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
@@ -85,7 +85,7 @@ public class QualityProfilesWsTest {
 
     CompareToSonarWay result = tester.qProfiles().service().show(new ShowRequest()
       .setKey(xooProfile.getKey())
-      .setCompareToSonarWay(true)).getCompareToSonarWay();
+      .setCompareToSonarWay("true")).getCompareToSonarWay();
 
     assertThat(result)
       .extracting(CompareToSonarWay::getProfile, CompareToSonarWay::getProfileName, CompareToSonarWay::getMissingRuleCount)
@@ -110,7 +110,7 @@ public class QualityProfilesWsTest {
     // Check that the profile has no missing rule from the Sonar way profile
     assertThat(tester.qProfiles().service().show(new ShowRequest()
       .setKey(xooProfile.getKey())
-      .setCompareToSonarWay(true)).getCompareToSonarWay())
+      .setCompareToSonarWay("true")).getCompareToSonarWay())
       .extracting(CompareToSonarWay::getProfile, CompareToSonarWay::getProfileName, CompareToSonarWay::getMissingRuleCount)
       .containsExactly(sonarWay.getKey(), sonarWay.getName(), 0L);
   }
@@ -133,35 +133,32 @@ public class QualityProfilesWsTest {
     Organization org = tester.organizations().generate();
     CreateWsResponse.QualityProfile profile = tester.qProfiles().createXooProfile(org);
 
-    String changelog = tester.wsClient().qualityProfilesOld().changelog(ChangelogRequest.builder()
+    String changelog = tester.wsClient().qualityprofiles().changelog(new ChangelogRequest()
       .setOrganization(org.getKey())
       .setLanguage(profile.getLanguage())
-      .setQualityProfile(profile.getName())
-      .build());
+      .setQualityProfile(profile.getName()));
     JSONAssert.assertEquals(EXPECTED_CHANGELOG_EMPTY, changelog, JSONCompareMode.STRICT);
 
     tester.qProfiles().activateRule(profile, RULE_ONE_BUG_PER_LINE);
     tester.qProfiles().activateRule(profile, RULE_ONE_ISSUE_PER_LINE);
 
-    String changelog2 = tester.wsClient().qualityProfilesOld().changelog(ChangelogRequest.builder()
+    String changelog2 = tester.wsClient().qualityprofiles().changelog(new ChangelogRequest()
       .setOrganization(org.getKey())
       .setLanguage(profile.getLanguage())
-      .setQualityProfile(profile.getName())
-      .build());
+      .setQualityProfile(profile.getName()));
     JSONAssert.assertEquals(EXPECTED_CHANGELOG, changelog2, JSONCompareMode.LENIENT);
 
-    String changelog3 = tester.wsClient().qualityProfilesOld().changelog(ChangelogRequest.builder()
+    String changelog3 = tester.wsClient().qualityprofiles().changelog(new ChangelogRequest()
       .setOrganization(org.getKey())
       .setLanguage(profile.getLanguage())
       .setQualityProfile(profile.getName())
-      .setSince("2999-12-31T23:59:59+0000")
-      .build());
+      .setSince("2999-12-31T23:59:59+0000"));
     JSONAssert.assertEquals(EXPECTED_CHANGELOG_EMPTY, changelog3, JSONCompareMode.STRICT);
   }
 
   private SearchWsResponse.QualityProfile getProfile(Organization organization, Predicate<SearchWsResponse.QualityProfile> filter) {
     return tester.qProfiles().service().search(new SearchRequest()
-      .setOrganizationKey(organization.getKey())).getProfilesList()
+      .setOrganization(organization.getKey())).getProfilesList()
       .stream()
       .filter(filter)
       .findAny().orElseThrow(IllegalStateException::new);
index 31cef84c190bab42aac2694d55805450c1fe100b..bac620bd1515bcb33adfdba4fb0464bd88a47487 100644 (file)
@@ -83,8 +83,8 @@ public class RulesWsTest {
   }
 
   private SearchWsResponse.QualityProfile getProfile(Organization organization, Predicate<SearchWsResponse.QualityProfile> filter) {
-    return tester.qProfiles().service().search(new org.sonarqube.ws.client.qualityprofile.SearchRequest()
-      .setOrganizationKey(organization.getKey())).getProfilesList()
+    return tester.qProfiles().service().search(new org.sonarqube.ws.client.qualityprofiles.SearchRequest()
+      .setOrganization(organization.getKey())).getProfilesList()
       .stream()
       .filter(filter)
       .findAny().orElseThrow(IllegalStateException::new);
index 7700bf120f5eeb7676c85a2becceb85c0570e213..3c401d8cd8cd81177f8f9cbc16855627bcc49a87 100644 (file)
@@ -66,13 +66,14 @@ import org.sonarqube.qa.util.Tester;
 import org.sonarqube.ws.Components.Component;
 import org.sonarqube.ws.Measures;
 import org.sonarqube.ws.Measures.Measure;
+import org.sonarqube.ws.MediaTypes;
 import org.sonarqube.ws.client.GetRequest;
 import org.sonarqube.ws.client.HttpConnector;
+import org.sonarqube.ws.client.PostRequest;
 import org.sonarqube.ws.client.WsClient;
 import org.sonarqube.ws.client.WsClientFactories;
 import org.sonarqube.ws.client.components.ShowRequest;
 import org.sonarqube.ws.client.measures.ComponentRequest;
-import org.sonarqube.ws.client.qualityprofile.RestoreRequest;
 import org.sonarqube.ws.client.settings.ResetRequest;
 import org.sonarqube.ws.client.settings.SetRequest;
 
@@ -86,6 +87,8 @@ import static java.util.Locale.ENGLISH;
 import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.fail;
+import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.PARAM_ORGANIZATION;
+import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.RestoreActionParameters.PARAM_BACKUP;
 
 public class ItUtils {
   public static final Splitter LINE_SPLITTER = Splitter.on(System.getProperty("line.separator"));
@@ -402,13 +405,14 @@ public class ItUtils {
     } catch (URISyntaxException e) {
       throw new IllegalArgumentException("Cannot find quality profile xml file '" + resource + "' in classpath");
     }
-    newAdminWsClient(orchestrator)
-      .qualityProfilesOld()
-      .restoreProfile(
-        RestoreRequest.builder()
-          .setBackup(new File(uri))
-          .setOrganization(organization)
-          .build());
+
+    PostRequest httpRequest = new PostRequest("api/qualityprofiles/restore")
+      .setParam(PARAM_ORGANIZATION, organization)
+      .setPart(PARAM_BACKUP, new PostRequest.Part(MediaTypes.XML, new File(uri)));
+    HttpConnector.newBuilder()
+      .url(orchestrator.getServer().getUrl())
+      .credentials(ADMIN_LOGIN, ADMIN_PASSWORD)
+      .build().call(httpRequest);
   }
 
   public static String newOrganizationKey() {