]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-11876 Remove ws deprecated in SonarQube 5.X
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Thu, 4 Apr 2019 15:40:25 +0000 (17:40 +0200)
committerSonarTech <sonartech@sonarsource.com>
Thu, 4 Apr 2019 18:21:04 +0000 (20:21 +0200)
* Remove api/profiles WS
* Remove api/resources WS
* Remove api/tests WS
* Remove api/ce/activity?componentQuery parameter
* Remove api/ce/activity?p parameter
* Remove api/issues/assign?me parameter
* Remove api/issues/bulk_change?plan parameter
* Remove 'actionsPlans' and 'reporters' values from api/issues/search?facets
* Remove 'components', 'componentRoots' and 'componentRootUuids' from api/issues/search
* Remove api/rules/create?manual_key parameter
* Remove api/rules/update?debt_XXX parameters
* Remove api/users/search?f parameter

48 files changed:
server/sonar-server/src/main/java/org/sonar/server/ce/ws/ActivityAction.java
server/sonar-server/src/main/java/org/sonar/server/ce/ws/CeWsParameters.java
server/sonar-server/src/main/java/org/sonar/server/component/ws/ComponentsWsModule.java
server/sonar-server/src/main/java/org/sonar/server/component/ws/ResourcesWs.java [deleted file]
server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueQueryFactory.java
server/sonar-server/src/main/java/org/sonar/server/issue/ws/AssignAction.java
server/sonar-server/src/main/java/org/sonar/server/issue/ws/BulkChangeAction.java
server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java
server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java
server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/ProfilesWs.java [deleted file]
server/sonar-server/src/main/java/org/sonar/server/rule/ws/CreateAction.java
server/sonar-server/src/main/java/org/sonar/server/rule/ws/UpdateAction.java
server/sonar-server/src/main/java/org/sonar/server/test/ws/TestsWs.java [deleted file]
server/sonar-server/src/main/java/org/sonar/server/test/ws/package-info.java [deleted file]
server/sonar-server/src/main/java/org/sonar/server/user/ws/SearchAction.java
server/sonar-server/src/test/java/org/sonar/server/ce/ws/ActivityActionTest.java
server/sonar-server/src/test/java/org/sonar/server/component/ws/ComponentsWsModuleTest.java
server/sonar-server/src/test/java/org/sonar/server/component/ws/ResourcesWsTest.java [deleted file]
server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueQueryFactoryTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/ws/AssignActionTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/ws/BulkChangeActionTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionComponentsTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ProfilesWsTest.java [deleted file]
server/sonar-server/src/test/java/org/sonar/server/rule/ws/UpdateActionTest.java
server/sonar-server/src/test/java/org/sonar/server/user/ws/ChangePasswordActionTest.java
server/sonar-server/src/test/java/org/sonar/server/user/ws/CreateActionTest.java
server/sonar-server/src/test/java/org/sonar/server/user/ws/SearchActionTest.java
server/sonar-server/src/test/java/org/sonar/server/user/ws/UpdateActionTest.java
server/sonar-server/src/test/java/org/sonar/server/user/ws/UsersWsTest.java [deleted file]
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/ce/ActivityRequest.java
sonar-ws/src/main/java/org/sonarqube/ws/client/ce/CeService.java
sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssuesWsParameters.java
sonar-ws/src/main/java/org/sonarqube/ws/client/issues/AssignRequest.java
sonar-ws/src/main/java/org/sonarqube/ws/client/issues/BulkChangeRequest.java
sonar-ws/src/main/java/org/sonarqube/ws/client/issues/IssuesService.java
sonar-ws/src/main/java/org/sonarqube/ws/client/issues/SearchRequest.java
sonar-ws/src/main/java/org/sonarqube/ws/client/profiles/ProfilesService.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/profiles/package-info.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/resources/ResourcesService.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/resources/package-info.java [deleted file]
sonar-ws/src/main/java/org/sonarqube/ws/client/rules/CreateRequest.java
sonar-ws/src/main/java/org/sonarqube/ws/client/rules/RulesService.java
sonar-ws/src/main/java/org/sonarqube/ws/client/rules/UpdateRequest.java
sonar-ws/src/main/java/org/sonarqube/ws/client/users/SearchRequest.java
sonar-ws/src/main/java/org/sonarqube/ws/client/users/UsersService.java

index c956af8c87d4316e70a9497600620c8e0aa4714f..b7fc096d6b74765f40c497a9b92f7c6911815340 100644 (file)
@@ -55,14 +55,12 @@ import static java.lang.String.format;
 import static java.util.Arrays.asList;
 import static java.util.Collections.emptyList;
 import static java.util.Collections.singletonList;
-import static org.apache.commons.lang.StringUtils.defaultString;
 import static org.sonar.api.server.ws.WebService.Param.TEXT_QUERY;
 import static org.sonar.api.utils.DateUtils.parseEndingDateOrDateTime;
 import static org.sonar.api.utils.DateUtils.parseStartingDateOrDateTime;
 import static org.sonar.core.util.stream.MoreCollectors.toList;
 import static org.sonar.db.Pagination.forPage;
 import static org.sonar.server.ce.ws.CeWsParameters.PARAM_COMPONENT_ID;
-import static org.sonar.server.ce.ws.CeWsParameters.PARAM_COMPONENT_QUERY;
 import static org.sonar.server.ce.ws.CeWsParameters.PARAM_MAX_EXECUTED_AT;
 import static org.sonar.server.ce.ws.CeWsParameters.PARAM_MIN_SUBMITTED_AT;
 import static org.sonar.server.ce.ws.CeWsParameters.PARAM_ONLY_CURRENTS;
@@ -105,21 +103,12 @@ public class ActivityAction implements CeWsAction {
         new Change("6.1", "field \"logs\" is deprecated and its value is always false"),
         new Change("6.6", "fields \"branch\" and \"branchType\" added"),
         new Change("7.1", "field \"pullRequest\" added"),
-        new Change("7.6", String.format("The use of module keys in parameters '%s' and '%s' is deprecated", TEXT_QUERY, PARAM_COMPONENT_QUERY)))
+        new Change("7.6", format("The use of module keys in parameters '%s' is deprecated", TEXT_QUERY)))
       .setSince("5.2");
 
     action.createParam(PARAM_COMPONENT_ID)
       .setDescription("Id of the component (project) to filter on")
       .setExampleValue(Uuids.UUID_EXAMPLE_03);
-    action.createParam(PARAM_COMPONENT_QUERY)
-      .setDescription(format("Limit search to: <ul>" +
-        "<li>component names that contain the supplied string</li>" +
-        "<li>component keys that are exactly the same as the supplied string</li>" +
-        "</ul>" +
-        "Must not be set together with %s.<br />" +
-        "Deprecated and replaced by '%s'", PARAM_COMPONENT_ID, TEXT_QUERY))
-      .setExampleValue("Apache")
-      .setDeprecatedSince("5.5");
     action.createParam(TEXT_QUERY)
       .setDescription(format("Limit search to: <ul>" +
         "<li>component names that contain the supplied string</li>" +
@@ -152,10 +141,6 @@ public class ActivityAction implements CeWsAction {
     action.createParam(PARAM_MAX_EXECUTED_AT)
       .setDescription("Maximum date of end of task processing (inclusive)")
       .setExampleValue("2017-10-19T13:00:00+0200");
-    action.createParam(Param.PAGE)
-      .setDescription("Deprecated parameter")
-      .setDeprecatedSince("5.5")
-      .setDeprecatedKey("pageIndex", "5.4");
     action.createPageSize(100, MAX_PAGE_SIZE);
   }
 
@@ -290,7 +275,7 @@ public class ActivityAction implements CeWsAction {
   private static Request toSearchWsRequest(org.sonar.api.server.ws.Request request) {
     Request activityWsRequest = new Request()
       .setComponentId(request.param(PARAM_COMPONENT_ID))
-      .setQ(defaultString(request.param(TEXT_QUERY), request.param(PARAM_COMPONENT_QUERY)))
+      .setQ(request.param(TEXT_QUERY))
       .setStatus(request.paramAsStrings(PARAM_STATUS))
       .setType(request.param(PARAM_TYPE))
       .setMinSubmittedAt(request.param(PARAM_MIN_SUBMITTED_AT))
@@ -299,7 +284,7 @@ public class ActivityAction implements CeWsAction {
       .setPs(String.valueOf(request.mandatoryParamAsInt(Param.PAGE_SIZE)));
 
     checkRequest(activityWsRequest.getComponentId() == null || activityWsRequest.getQ() == null, "%s and %s must not be set at the same time",
-      PARAM_COMPONENT_ID, PARAM_COMPONENT_QUERY);
+      PARAM_COMPONENT_ID, TEXT_QUERY);
     return activityWsRequest;
   }
 
@@ -314,14 +299,19 @@ public class ActivityAction implements CeWsAction {
     private List<String> status;
     private String type;
 
+    Request() {
+      // Nothing to do
+    }
+
     /**
      * Example value: "AU-TpxcA-iU5OvuD2FL0"
      */
-    private Request setComponentId(String componentId) {
+    private Request setComponentId(@Nullable String componentId) {
       this.componentId = componentId;
       return this;
     }
 
+    @CheckForNull
     private String getComponentId() {
       return componentId;
     }
@@ -329,11 +319,12 @@ public class ActivityAction implements CeWsAction {
     /**
      * Example value: "2017-10-19T13:00:00+0200"
      */
-    private Request setMaxExecutedAt(String maxExecutedAt) {
+    private Request setMaxExecutedAt(@Nullable String maxExecutedAt) {
       this.maxExecutedAt = maxExecutedAt;
       return this;
     }
 
+    @CheckForNull
     private String getMaxExecutedAt() {
       return maxExecutedAt;
     }
@@ -341,11 +332,12 @@ public class ActivityAction implements CeWsAction {
     /**
      * Example value: "2017-10-19T13:00:00+0200"
      */
-    private Request setMinSubmittedAt(String minSubmittedAt) {
+    private Request setMinSubmittedAt(@Nullable String minSubmittedAt) {
       this.minSubmittedAt = minSubmittedAt;
       return this;
     }
 
+    @CheckForNull
     private String getMinSubmittedAt() {
       return minSubmittedAt;
     }
@@ -383,11 +375,12 @@ public class ActivityAction implements CeWsAction {
     /**
      * Example value: "Apache"
      */
-    private Request setQ(String q) {
+    private Request setQ(@Nullable String q) {
       this.q = q;
       return this;
     }
 
+    @CheckForNull
     private String getQ() {
       return q;
     }
@@ -403,11 +396,12 @@ public class ActivityAction implements CeWsAction {
      *   <li>"IN_PROGRESS"</li>
      * </ul>
      */
-    private Request setStatus(List<String> status) {
+    private Request setStatus(@Nullable List<String> status) {
       this.status = status;
       return this;
     }
 
+    @CheckForNull
     private List<String> getStatus() {
       return status;
     }
@@ -419,11 +413,12 @@ public class ActivityAction implements CeWsAction {
      *   <li>"REPORT"</li>
      * </ul>
      */
-    private Request setType(String type) {
+    private Request setType(@Nullable String type) {
       this.type = type;
       return this;
     }
 
+    @CheckForNull
     private String getType() {
       return type;
     }
index 5b88b6377ef862f914ae8c3079801398cd40962a..6ee0856c4867a5c98d1bab48d5f7cce602aecf47 100644 (file)
@@ -26,7 +26,6 @@ public class CeWsParameters {
   public static final String PARAM_COMPONENT_ID = "componentId";
   public static final String DEPRECATED_PARAM_COMPONENT_KEY = "componentKey";
   public static final String PARAM_COMPONENT = "component";
-  public static final String PARAM_COMPONENT_QUERY = "componentQuery";
   public static final String PARAM_TYPE = "type";
   public static final String PARAM_STATUS = "status";
   public static final String PARAM_ONLY_CURRENTS = "onlyCurrents";
index d594f0b477196623b90ab699f2785b92f941d703..ce1d5b8c298f982e8c1de7fa1dd2131fad630fc6 100644 (file)
@@ -25,7 +25,6 @@ public class ComponentsWsModule extends Module {
   @Override
   protected void configureModule() {
     add(
-      ResourcesWs.class,
       ComponentsWs.class,
       // actions
       AppAction.class,
diff --git a/server/sonar-server/src/main/java/org/sonar/server/component/ws/ResourcesWs.java b/server/sonar-server/src/main/java/org/sonar/server/component/ws/ResourcesWs.java
deleted file mode 100644 (file)
index 1fadc7b..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2019 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.sonar.server.component.ws;
-
-import org.sonar.api.server.ws.WebService;
-import org.sonar.server.ws.RemovedWebServiceHandler;
-
-public class ResourcesWs implements WebService {
-
-  @Override
-  public void define(Context context) {
-    NewController controller = context.createController("api/resources")
-      .setDescription("Removed since 6.3, please use api/components and api/measures instead")
-      .setSince("2.10");
-    defineIndexAction(controller);
-    controller.done();
-  }
-
-  private static void defineIndexAction(NewController controller) {
-    controller.createAction("index")
-      .setDescription("The web service is removed and you're invited to use the alternatives: " +
-        "<ul>" +
-        "<li>if you need one component without measures: api/components/show</li>" +
-        "<li>if you need one component with measures: api/measures/component</li>" +
-        "<li>if you need several components without measures: api/components/tree</li>" +
-        "<li>if you need several components with measures: api/measures/component_tree</li>" +
-        "</ul>")
-      .setSince("2.10")
-      .setDeprecatedSince("5.4")
-      .setHandler(RemovedWebServiceHandler.INSTANCE)
-      .setResponseExample(RemovedWebServiceHandler.INSTANCE.getResponseExample());
-  }
-
-}
index 361b43b9300499a15c26b27d73267ea42256dfaa..863e2967a146ed1f7d3a8cd8f732dad29b48fb08 100644 (file)
@@ -67,9 +67,7 @@ import static org.sonar.core.util.stream.MoreCollectors.toHashSet;
 import static org.sonar.core.util.stream.MoreCollectors.toList;
 import static org.sonar.core.util.stream.MoreCollectors.toSet;
 import static org.sonar.core.util.stream.MoreCollectors.uniqueIndex;
-import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_COMPONENTS;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_COMPONENT_KEYS;
-import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_COMPONENT_ROOTS;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_COMPONENT_UUIDS;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_CREATED_AFTER;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_CREATED_IN_LAST;
@@ -187,8 +185,7 @@ public class IssueQueryFactory {
     boolean effectiveOnComponentOnly = false;
 
     checkArgument(atMostOneNonNullElement(components, componentUuids, componentKeys, componentRootUuids, componentRoots),
-      "At most one of the following parameters can be provided: %s, %s, %s, %s, %s",
-      PARAM_COMPONENT_KEYS, PARAM_COMPONENT_UUIDS, PARAM_COMPONENTS, PARAM_COMPONENT_ROOTS, PARAM_COMPONENT_UUIDS);
+      "At most one of the following parameters can be provided: %s and %s", PARAM_COMPONENT_KEYS, PARAM_COMPONENT_UUIDS);
 
     if (componentRootUuids != null) {
       allComponents.addAll(getComponentsFromUuids(session, componentRootUuids));
index a071fdbb4f2527eb43158c7a3588f6fec279d156..07074faed34157aae129f1e5ff94bb4ff580cdd3 100644 (file)
@@ -22,10 +22,8 @@ package org.sonar.server.issue.ws;
 import com.google.common.base.Strings;
 import com.google.common.io.Resources;
 import java.util.Date;
-import java.util.Optional;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
-import org.apache.commons.lang.BooleanUtils;
 import org.sonar.api.rules.RuleType;
 import org.sonar.api.server.ws.Change;
 import org.sonar.api.server.ws.Request;
@@ -56,7 +54,6 @@ import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_ASSIGNEE;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_ISSUE;
 
 public class AssignAction implements IssuesWsAction {
-  private static final String DEPRECATED_PARAM_ME = "me";
   private static final String ASSIGN_TO_ME_VALUE = "_me";
 
   private final System2 system2;
@@ -97,10 +94,6 @@ public class AssignAction implements IssuesWsAction {
     action.createParam(PARAM_ASSIGNEE)
       .setDescription("Login of the assignee. When not set, it will unassign the issue. Use '%s' to assign to current user", ASSIGN_TO_ME_VALUE)
       .setExampleValue("admin");
-    action.createParam(DEPRECATED_PARAM_ME)
-      .setDescription("(deprecated) Assign the issue to the logged-in user. Replaced by the parameter assignee=_me")
-      .setDeprecatedSince("5.2")
-      .setBooleanPossibleValues();
   }
 
   @Override
@@ -116,7 +109,7 @@ public class AssignAction implements IssuesWsAction {
     try (DbSession dbSession = dbClient.openSession(false)) {
       IssueDto issueDto = issueFinder.getByKey(dbSession, issueKey);
       DefaultIssue issue = issueDto.toDefaultIssue();
-      checkArgument(issue.type() != RuleType.SECURITY_HOTSPOT,"It is not allowed to assign a security hotspot");
+      checkArgument(issue.type() != RuleType.SECURITY_HOTSPOT, "Assigning security hotspots is not allowed");
       UserDto user = getUser(dbSession, login);
       if (user != null) {
         checkMembership(dbSession, issueDto, user);
@@ -132,10 +125,7 @@ public class AssignAction implements IssuesWsAction {
   @CheckForNull
   private String getAssignee(Request request) {
     String assignee = emptyToNull(request.param(PARAM_ASSIGNEE));
-    if (ASSIGN_TO_ME_VALUE.equals(assignee) || BooleanUtils.isTrue(request.paramAsBoolean(DEPRECATED_PARAM_ME))) {
-      return userSession.getLogin();
-    }
-    return assignee;
+    return ASSIGN_TO_ME_VALUE.equals(assignee) ? userSession.getLogin() : assignee;
   }
 
   @CheckForNull
@@ -148,7 +138,7 @@ public class AssignAction implements IssuesWsAction {
 
   private void checkMembership(DbSession dbSession, IssueDto issueDto, UserDto user) {
     String projectUuid = requireNonNull(issueDto.getProjectUuid());
-    ComponentDto project = Optional.ofNullable(dbClient.componentDao().selectByUuid(dbSession, projectUuid).orElse(null))
+    ComponentDto project = dbClient.componentDao().selectByUuid(dbSession, projectUuid)
       .orElseThrow(() -> new IllegalStateException(format("Unknown project %s", projectUuid)));
     OrganizationDto organizationDto = dbClient.organizationDao().selectByUuid(dbSession, project.getOrganizationUuid())
       .orElseThrow(() -> new IllegalStateException(format("Unknown organizationMember %s", project.getOrganizationUuid())));
index 31e2af3961855140a80b83002efe8dddcaa8d4c1..d3fba0d5bc237a5fb2dc14e50ba9db8027e87362 100644 (file)
@@ -55,8 +55,8 @@ import org.sonar.server.issue.Action;
 import org.sonar.server.issue.AddTagsAction;
 import org.sonar.server.issue.AssignAction;
 import org.sonar.server.issue.IssueChangePostProcessor;
-import org.sonar.server.issue.WebIssueStorage;
 import org.sonar.server.issue.RemoveTagsAction;
+import org.sonar.server.issue.WebIssueStorage;
 import org.sonar.server.issue.notification.IssueChangeNotification;
 import org.sonar.server.notification.NotificationManager;
 import org.sonar.server.user.UserSession;
@@ -94,7 +94,6 @@ import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_ASSIGN;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_COMMENT;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_DO_TRANSITION;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_ISSUES;
-import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_PLAN;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_REMOVE_TAGS;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_SEND_NOTIFICATIONS;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_SET_SEVERITY;
@@ -155,9 +154,6 @@ public class BulkChangeAction implements IssuesWsAction {
       .setPossibleValues(RuleType.names())
       .setSince("5.5")
       .setDeprecatedKey("set_type.type", "6.2");
-    action.createParam(PARAM_PLAN)
-      .setDescription("In 5.5, action plans are dropped. Has no effect. To plan the list of issues to a specific action plan (key), or unlink all the issues from an action plan")
-      .setDeprecatedSince("5.5");
     action.createParam(PARAM_DO_TRANSITION)
       .setDescription("Transition")
       .setExampleValue(REOPEN)
index 326a3689ce4680ca6cbc621b9742d3f4ec0cbf45..1ee42083bcf9607875b3a541e514d57439ddcd55 100644 (file)
@@ -85,7 +85,6 @@ import static org.sonar.server.ws.KeyExamples.KEY_PROJECT_EXAMPLE_001;
 import static org.sonar.server.ws.KeyExamples.KEY_PULL_REQUEST_EXAMPLE_001;
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.ACTION_SEARCH;
-import static org.sonarqube.ws.client.issue.IssuesWsParameters.DEPRECATED_PARAM_ACTION_PLANS;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.DEPRECATED_PARAM_AUTHORS;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.FACET_MODE;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.FACET_MODE_COUNT;
@@ -96,10 +95,7 @@ import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_ASSIGNED;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_ASSIGNEES;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_AUTHOR;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_BRANCH;
-import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_COMPONENTS;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_COMPONENT_KEYS;
-import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_COMPONENT_ROOTS;
-import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_COMPONENT_ROOT_UUIDS;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_COMPONENT_UUIDS;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_CREATED_AFTER;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_CREATED_AT;
@@ -117,7 +113,6 @@ import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_OWASP_TOP_1
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_PROJECTS;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_PROJECT_KEYS;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_PULL_REQUEST;
-import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_REPORTERS;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_RESOLUTIONS;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_RESOLVED;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_RULES;
@@ -140,10 +135,8 @@ public class SearchAction implements IssuesWsAction, Startable {
     PARAM_SEVERITIES,
     PARAM_STATUSES,
     PARAM_RESOLUTIONS,
-    DEPRECATED_PARAM_ACTION_PLANS,
     PARAM_RULES,
     PARAM_ASSIGNEES,
-    PARAM_REPORTERS,
     DEPRECATED_PARAM_AUTHORS,
     PARAM_AUTHOR,
     PARAM_DIRECTORIES,
@@ -188,9 +181,9 @@ public class SearchAction implements IssuesWsAction, Startable {
       .setHandler(this)
       .setDescription(
         "Search for issues.<br>" +
-          "At most one of the following parameters can be provided at the same time: %s, %s, %s, %s, %s.<br>" +
+          "At most one of the following parameters can be provided at the same time: %s and %s.<br>" +
           "Requires the 'Browse' permission on the specified project(s).",
-        PARAM_COMPONENT_KEYS, PARAM_COMPONENT_UUIDS, PARAM_COMPONENTS, PARAM_COMPONENT_ROOT_UUIDS, PARAM_COMPONENT_ROOTS)
+        PARAM_COMPONENT_KEYS, PARAM_COMPONENT_UUIDS)
       .setSince("3.6")
       .setChangelog(
         new Change("7.7", format("Value '%s' in parameter '%s' is deprecated, please use '%s' instead", DEPRECATED_PARAM_AUTHORS, FACETS, PARAM_AUTHOR)),
@@ -307,9 +300,7 @@ public class SearchAction implements IssuesWsAction, Startable {
   private static void addComponentRelatedParams(WebService.NewAction action) {
     action.createParam(PARAM_ON_COMPONENT_ONLY)
       .setDescription("Return only issues at a component's level, not on its descendants (modules, directories, files, etc). " +
-        "This parameter is only considered when componentKeys or componentUuids is set. " +
-        "Using the deprecated componentRoots or componentRootUuids parameters will set this parameter to false. " +
-        "Using the deprecated components parameter will set this parameter to true.")
+        "This parameter is only considered when componentKeys or componentUuids is set.")
       .setBooleanPossibleValues()
       .setDefaultValue("false");
 
@@ -318,10 +309,6 @@ public class SearchAction implements IssuesWsAction, Startable {
         "A component can be a portfolio, project, module, directory or file.")
       .setExampleValue(KEY_PROJECT_EXAMPLE_001);
 
-    action.createParam(PARAM_COMPONENTS)
-      .setDeprecatedSince("5.1")
-      .setDescription("If used, will have the same meaning as componentKeys AND onComponentOnly=true.");
-
     action.createParam(PARAM_COMPONENT_UUIDS)
       .setDescription("To retrieve issues associated to a specific list of components their sub-components (comma-separated list of component IDs). " +
         INTERNAL_PARAMETER_DISCLAIMER +
@@ -329,14 +316,6 @@ public class SearchAction implements IssuesWsAction, Startable {
       .setDeprecatedSince("6.5")
       .setExampleValue("584a89f2-8037-4f7b-b82c-8b45d2d63fb2");
 
-    action.createParam(PARAM_COMPONENT_ROOTS)
-      .setDeprecatedSince("5.1")
-      .setDescription("If used, will have the same meaning as componentKeys AND onComponentOnly=false.");
-
-    action.createParam(PARAM_COMPONENT_ROOT_UUIDS)
-      .setDeprecatedSince("5.1")
-      .setDescription("If used, will have the same meaning as componentUuids AND onComponentOnly=false.");
-
     action.createParam(PARAM_PROJECTS)
       .setDescription("To retrieve issues associated to a specific list of projects (comma-separated list of project keys). " +
         INTERNAL_PARAMETER_DISCLAIMER +
@@ -532,10 +511,7 @@ public class SearchAction implements IssuesWsAction, Startable {
       .setAssigneesUuid(getLogins(dbSession, request.paramAsStrings(PARAM_ASSIGNEES)))
       .setAuthors(request.hasParam(PARAM_AUTHOR) ? request.multiParam(PARAM_AUTHOR) : request.paramAsStrings(DEPRECATED_PARAM_AUTHORS))
       .setComponentKeys(request.paramAsStrings(PARAM_COMPONENT_KEYS))
-      .setComponentRootUuids(request.paramAsStrings(PARAM_COMPONENT_ROOT_UUIDS))
-      .setComponentRoots(request.paramAsStrings(PARAM_COMPONENT_ROOTS))
       .setComponentUuids(request.paramAsStrings(PARAM_COMPONENT_UUIDS))
-      .setComponents(request.paramAsStrings(PARAM_COMPONENTS))
       .setCreatedAfter(request.param(PARAM_CREATED_AFTER))
       .setCreatedAt(request.param(PARAM_CREATED_AT))
       .setCreatedBefore(request.param(PARAM_CREATED_BEFORE))
index 01ca67bc742f423926214e5457a5e3bd247fd9e8..6a595e18ffaa9f3e0117c4be54b368915254acb3 100644 (file)
@@ -166,7 +166,6 @@ import org.sonar.server.qualityprofile.QProfileRulesImpl;
 import org.sonar.server.qualityprofile.QProfileTreeImpl;
 import org.sonar.server.qualityprofile.RuleActivator;
 import org.sonar.server.qualityprofile.index.ActiveRuleIndexer;
-import org.sonar.server.qualityprofile.ws.ProfilesWs;
 import org.sonar.server.qualityprofile.ws.QProfilesWsModule;
 import org.sonar.server.root.ws.RootWsModule;
 import org.sonar.server.rule.CommonRuleDefinitionsImpl;
@@ -198,7 +197,6 @@ import org.sonar.server.startup.LogServerId;
 import org.sonar.server.telemetry.TelemetryClient;
 import org.sonar.server.telemetry.TelemetryDaemon;
 import org.sonar.server.telemetry.TelemetryDataLoader;
-import org.sonar.server.test.ws.TestsWs;
 import org.sonar.server.text.MacroInterpreter;
 import org.sonar.server.ui.DeprecatedViews;
 import org.sonar.server.ui.PageDecorations;
@@ -288,7 +286,6 @@ public class PlatformLevel4 extends PlatformLevel {
       XMLProfileSerializer.class,
       AnnotationProfileParser.class,
       QProfileComparison.class,
-      ProfilesWs.class,
       QProfileTreeImpl.class,
       QProfileRulesImpl.class,
       RuleActivator.class,
@@ -471,9 +468,6 @@ public class PlatformLevel4 extends PlatformLevel {
       NotificationWsModule.class,
       EmailsWsModule.class,
 
-      // Tests
-      TestsWs.class,
-
       // Settings
       PersistentSettings.class,
       PropertiesWs.class,
diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/ProfilesWs.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/ProfilesWs.java
deleted file mode 100644 (file)
index fe7190b..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2019 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.sonar.server.qualityprofile.ws;
-
-import org.sonar.api.server.ws.WebService;
-import org.sonar.server.ws.RemovedWebServiceHandler;
-
-/**
- * List of quality profiles WS implemented in Rails.
- * New WS on quality profiles MUST be declared in {@link org.sonar.server.qualityprofile.ws.QProfilesWs}
- */
-public class ProfilesWs implements WebService {
-
-  public static final String API_ENDPOINT = "api/profiles";
-
-  @Override
-  public void define(Context context) {
-    NewController controller = context.createController(API_ENDPOINT)
-      .setDescription("Removed since 6.3, please use api/qualityprofiles instead")
-      .setSince("4.4");
-    defineListAction(controller);
-    defineIndexAction(controller);
-    controller.done();
-  }
-
-  private static void defineIndexAction(NewController controller) {
-    controller.createAction("index")
-      .setDescription("Get a profile.<br/>" +
-        "The web service is removed and you're invited to use api/qualityprofiles/search instead")
-      .setSince("3.3")
-      .setDeprecatedSince("5.2")
-      .setHandler(RemovedWebServiceHandler.INSTANCE)
-      .setResponseExample(RemovedWebServiceHandler.INSTANCE.getResponseExample());
-  }
-
-  private static void defineListAction(NewController controller) {
-    controller.createAction("list")
-      .setDescription("Get a list of profiles.<br/>" +
-        "The web service is removed and you're invited to use api/qualityprofiles/search instead")
-      .setSince("3.3")
-      .setDeprecatedSince("5.2")
-      .setHandler(RemovedWebServiceHandler.INSTANCE)
-      .setResponseExample(RemovedWebServiceHandler.INSTANCE.getResponseExample());
-  }
-}
index 79abe98437453280a428eda0ad630d7a6aa8868f..6cae5e46adfcc4ab254160392c3db5711585a429 100644 (file)
@@ -95,12 +95,6 @@ public class CreateAction implements RulesWsAction {
       .setDescription("Key of the custom rule")
       .setExampleValue("Todo_should_not_be_used");
 
-    action
-      .createParam("manual_key")
-      .setDescription("Manual rules are no more supported. This parameter is ignored")
-      .setExampleValue("Error_handling")
-      .setDeprecatedSince("5.5");
-
     action
       .createParam(PARAM_TEMPLATE_KEY)
       .setDescription("Key of the template rule in order to create a custom rule (mandatory for custom rule)")
index 3f4d47dfd644131542f52edccd096151fed29fad..40278e60e52302ab8f556c694f64d79b339bdfa9 100644 (file)
@@ -50,7 +50,6 @@ import static com.google.common.collect.Sets.newHashSet;
 import static java.lang.String.format;
 import static java.util.Collections.singletonList;
 import static java.util.Optional.ofNullable;
-import static org.apache.commons.lang.StringUtils.defaultIfEmpty;
 import static org.sonar.db.permission.OrganizationPermission.ADMINISTER_QUALITY_PROFILES;
 import static org.sonar.server.rule.ws.CreateAction.KEY_MAXIMUM_LENGTH;
 import static org.sonar.server.rule.ws.CreateAction.NAME_MAXIMUM_LENGTH;
@@ -62,11 +61,8 @@ public class UpdateAction implements RulesWsAction {
   public static final String PARAM_TAGS = "tags";
   public static final String PARAM_MARKDOWN_NOTE = "markdown_note";
   public static final String PARAM_REMEDIATION_FN_TYPE = "remediation_fn_type";
-  public static final String DEPRECATED_PARAM_REMEDIATION_FN_TYPE = "debt_remediation_fn_type";
   public static final String PARAM_REMEDIATION_FN_BASE_EFFORT = "remediation_fn_base_effort";
-  public static final String DEPRECATED_PARAM_REMEDIATION_FN_OFFSET = "debt_remediation_fn_offset";
   public static final String PARAM_REMEDIATION_FN_GAP_MULTIPLIER = "remediation_fy_gap_multiplier";
-  public static final String DEPRECATED_PARAM_REMEDIATION_FN_COEFF = "debt_remediation_fy_coeff";
   public static final String PARAM_NAME = "name";
   public static final String PARAM_DESCRIPTION = "markdown_description";
   public static final String PARAM_SEVERITY = "severity";
@@ -124,26 +120,16 @@ public class UpdateAction implements RulesWsAction {
       .setPossibleValues(DebtRemediationFunction.Type.values())
       .setSince("5.5");
 
-    action.createParam(DEPRECATED_PARAM_REMEDIATION_FN_TYPE)
-      .setDeprecatedSince("5.5")
-      .setPossibleValues(DebtRemediationFunction.Type.values());
-
     action.createParam(PARAM_REMEDIATION_FN_BASE_EFFORT)
       .setDescription("Base effort of the remediation function of the rule")
       .setExampleValue("1d")
       .setSince("5.5");
 
-    action.createParam(DEPRECATED_PARAM_REMEDIATION_FN_OFFSET)
-      .setDeprecatedSince("5.5");
-
     action.createParam(PARAM_REMEDIATION_FN_GAP_MULTIPLIER)
       .setDescription("Gap multiplier of the remediation function of the rule")
       .setExampleValue("3min")
       .setSince("5.5");
 
-    action.createParam(DEPRECATED_PARAM_REMEDIATION_FN_COEFF)
-      .setDeprecatedSince("5.5");
-
     action
       .createParam(PARAM_NAME)
       .setMaximumLength(NAME_MAXIMUM_LENGTH)
@@ -251,15 +237,15 @@ public class UpdateAction implements RulesWsAction {
   }
 
   private static void readDebt(Request request, RuleUpdate update) {
-    String value = defaultIfEmpty(request.param(PARAM_REMEDIATION_FN_TYPE), request.param(DEPRECATED_PARAM_REMEDIATION_FN_TYPE));
+    String value = request.param(PARAM_REMEDIATION_FN_TYPE);
     if (value != null) {
       if (StringUtils.isBlank(value)) {
         update.setDebtRemediationFunction(null);
       } else {
         DebtRemediationFunction fn = new DefaultDebtRemediationFunction(
           DebtRemediationFunction.Type.valueOf(value),
-          defaultIfEmpty(request.param(PARAM_REMEDIATION_FN_GAP_MULTIPLIER), request.param(DEPRECATED_PARAM_REMEDIATION_FN_COEFF)),
-          defaultIfEmpty(request.param(PARAM_REMEDIATION_FN_BASE_EFFORT), request.param(DEPRECATED_PARAM_REMEDIATION_FN_OFFSET)));
+          request.param(PARAM_REMEDIATION_FN_GAP_MULTIPLIER),
+          request.param(PARAM_REMEDIATION_FN_BASE_EFFORT));
         update.setDebtRemediationFunction(fn);
       }
     }
diff --git a/server/sonar-server/src/main/java/org/sonar/server/test/ws/TestsWs.java b/server/sonar-server/src/main/java/org/sonar/server/test/ws/TestsWs.java
deleted file mode 100644 (file)
index fb477f7..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2019 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.sonar.server.test.ws;
-
-import org.sonar.api.server.ws.Change;
-import org.sonar.api.server.ws.WebService;
-import org.sonar.server.ws.RemovedWebServiceHandler;
-
-public class TestsWs implements WebService {
-
-  @Override
-  public void define(Context context) {
-    NewController controller = context.createController("api/tests")
-      .setSince("4.4")
-      .setDescription("Removed in 7.6");
-
-    controller.createAction("covered_files")
-      .setDescription("This web API is no longer supported")
-      .setSince("4.4")
-      .setDeprecatedSince("5.6")
-      .setChangelog(new Change("7.6", "This action has been removed"))
-      .setResponseExample(RemovedWebServiceHandler.INSTANCE.getResponseExample())
-      .setHandler(RemovedWebServiceHandler.INSTANCE);
-
-    controller
-      .createAction("list")
-      .setDescription("This web API is no longer supported")
-      .setSince("5.2")
-      .setDeprecatedSince("5.6")
-      .setChangelog(new Change("7.6", "This action has been removed"))
-      .setResponseExample(RemovedWebServiceHandler.INSTANCE.getResponseExample())
-      .setHandler(RemovedWebServiceHandler.INSTANCE);
-
-    controller.done();
-  }
-
-}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/test/ws/package-info.java b/server/sonar-server/src/main/java/org/sonar/server/test/ws/package-info.java
deleted file mode 100644 (file)
index a06b322..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2019 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.
- */
-@ParametersAreNonnullByDefault
-package org.sonar.server.test.ws;
-
-import javax.annotation.ParametersAreNonnullByDefault;
index d1c996b0e1fe2d6397a740e4d689b7b88d54aa83..1fc93cb4f1a83c7f2932b95d41466d2b1a00e0fd 100644 (file)
 package org.sonar.server.user.ws;
 
 import com.google.common.collect.Multimap;
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.function.Function;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
 import org.sonar.api.server.ws.Change;
@@ -50,7 +48,6 @@ import static com.google.common.base.MoreObjects.firstNonNull;
 import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Strings.emptyToNull;
 import static java.util.Optional.ofNullable;
-import static org.sonar.api.server.ws.WebService.Param.FIELDS;
 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.TEXT_QUERY;
@@ -58,16 +55,6 @@ import static org.sonar.api.utils.DateUtils.formatDateTime;
 import static org.sonar.api.utils.Paging.forPageIndex;
 import static org.sonar.core.util.stream.MoreCollectors.toList;
 import static org.sonar.server.es.SearchOptions.MAX_LIMIT;
-import static org.sonar.server.user.ws.UserJsonWriter.FIELD_ACTIVE;
-import static org.sonar.server.user.ws.UserJsonWriter.FIELD_AVATAR;
-import static org.sonar.server.user.ws.UserJsonWriter.FIELD_EMAIL;
-import static org.sonar.server.user.ws.UserJsonWriter.FIELD_EXTERNAL_IDENTITY;
-import static org.sonar.server.user.ws.UserJsonWriter.FIELD_EXTERNAL_PROVIDER;
-import static org.sonar.server.user.ws.UserJsonWriter.FIELD_GROUPS;
-import static org.sonar.server.user.ws.UserJsonWriter.FIELD_LOCAL;
-import static org.sonar.server.user.ws.UserJsonWriter.FIELD_NAME;
-import static org.sonar.server.user.ws.UserJsonWriter.FIELD_SCM_ACCOUNTS;
-import static org.sonar.server.user.ws.UserJsonWriter.FIELD_TOKENS_COUNT;
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
 import static org.sonarqube.ws.Users.SearchWsResponse.Groups;
 import static org.sonarqube.ws.Users.SearchWsResponse.ScmAccounts;
@@ -114,8 +101,6 @@ public class SearchAction implements UsersWsAction {
       .setHandler(this)
       .setResponseExample(getClass().getResource("search-example.json"));
 
-    action.createFieldsParam(UserJsonWriter.FIELDS)
-      .setDeprecatedSince("5.4");
     action.addPagingParams(50, MAX_LIMIT);
 
     action.createParam(TEXT_QUERY)
@@ -131,7 +116,6 @@ public class SearchAction implements UsersWsAction {
 
   private Users.SearchWsResponse doHandle(SearchRequest request) {
     SearchOptions options = new SearchOptions().setPage(request.getPage(), request.getPageSize());
-    List<String> fields = request.getPossibleFields();
     SearchResult<UserDoc> result = userIndex.search(UserQuery.builder().setTextQuery(request.getQuery()).build(), options);
     try (DbSession dbSession = dbClient.openSession(false)) {
       List<String> logins = result.getDocs().stream().map(UserDoc::login).collect(toList());
@@ -139,14 +123,13 @@ public class SearchAction implements UsersWsAction {
       List<UserDto> users = dbClient.userDao().selectByOrderedLogins(dbSession, logins);
       Map<String, Integer> tokenCountsByLogin = dbClient.userTokenDao().countTokensByUsers(dbSession, users);
       Paging paging = forPageIndex(request.getPage()).withPageSize(request.getPageSize()).andTotal((int) result.getTotal());
-      return buildResponse(users, groupsByLogin, tokenCountsByLogin, fields, paging);
+      return buildResponse(users, groupsByLogin, tokenCountsByLogin, paging);
     }
   }
 
-  private SearchWsResponse buildResponse(List<UserDto> users, Multimap<String, String> groupsByLogin, Map<String, Integer> tokenCountsByLogin,
-    @Nullable List<String> fields, Paging paging) {
+  private SearchWsResponse buildResponse(List<UserDto> users, Multimap<String, String> groupsByLogin, Map<String, Integer> tokenCountsByLogin, Paging paging) {
     SearchWsResponse.Builder responseBuilder = newBuilder();
-    users.forEach(user -> responseBuilder.addUsers(towsUser(user, firstNonNull(tokenCountsByLogin.get(user.getUuid()), 0), groupsByLogin.get(user.getLogin()), fields)));
+    users.forEach(user -> responseBuilder.addUsers(towsUser(user, firstNonNull(tokenCountsByLogin.get(user.getUuid()), 0), groupsByLogin.get(user.getLogin()))));
     responseBuilder.getPagingBuilder()
       .setPageIndex(paging.pageIndex())
       .setPageSize(paging.pageSize())
@@ -155,43 +138,30 @@ public class SearchAction implements UsersWsAction {
     return responseBuilder.build();
   }
 
-  private User towsUser(UserDto user, @Nullable Integer tokensCount, Collection<String> groups, @Nullable Collection<String> fields) {
-    User.Builder userBuilder = User.newBuilder()
-      .setLogin(user.getLogin());
-    setIfNeeded(FIELD_NAME, fields, user.getName(), userBuilder::setName);
+  private User towsUser(UserDto user, @Nullable Integer tokensCount, Collection<String> groups) {
+    User.Builder userBuilder = User.newBuilder().setLogin(user.getLogin());
+    ofNullable(user.getName()).ifPresent(userBuilder::setName);
     if (userSession.isLoggedIn()) {
-      setIfNeeded(FIELD_AVATAR, fields, emptyToNull(user.getEmail()), u -> userBuilder.setAvatar(avatarResolver.create(user)));
-      setIfNeeded(FIELD_ACTIVE, fields, user.isActive(), userBuilder::setActive);
-      setIfNeeded(FIELD_LOCAL, fields, user.isLocal(), userBuilder::setLocal);
-      setIfNeeded(FIELD_EXTERNAL_PROVIDER, fields, user.getExternalIdentityProvider(), userBuilder::setExternalProvider);
-      setIfNeeded(isNeeded(FIELD_SCM_ACCOUNTS, fields) && !user.getScmAccountsAsList().isEmpty(), user.getScmAccountsAsList(),
-        scm -> userBuilder.setScmAccounts(ScmAccounts.newBuilder().addAllScmAccounts(scm)));
+      ofNullable(emptyToNull(user.getEmail())).ifPresent(u -> userBuilder.setAvatar(avatarResolver.create(user)));
+      userBuilder.setActive(user.isActive());
+      userBuilder.setLocal(user.isLocal());
+      ofNullable(user.getExternalIdentityProvider()).ifPresent(userBuilder::setExternalProvider);
+      if (!user.getScmAccountsAsList().isEmpty()) {
+        userBuilder.setScmAccounts(ScmAccounts.newBuilder().addAllScmAccounts(user.getScmAccountsAsList()));
+      }
     }
     if (userSession.isSystemAdministrator() || Objects.equals(userSession.getUuid(), user.getUuid())) {
-      setIfNeeded(FIELD_EMAIL, fields, user.getEmail(), userBuilder::setEmail);
-      setIfNeeded(isNeeded(FIELD_GROUPS, fields) && !groups.isEmpty(), groups,
-        g -> userBuilder.setGroups(Groups.newBuilder().addAllGroups(g)));
-      setIfNeeded(FIELD_EXTERNAL_IDENTITY, fields, user.getExternalLogin(), userBuilder::setExternalIdentity);
-      setIfNeeded(FIELD_TOKENS_COUNT, fields, tokensCount, userBuilder::setTokensCount);
+      ofNullable(user.getEmail()).ifPresent(userBuilder::setEmail);
+      if (!groups.isEmpty()) {
+        userBuilder.setGroups(Groups.newBuilder().addAllGroups(groups));
+      }
+      ofNullable(user.getExternalLogin()).ifPresent(userBuilder::setExternalIdentity);
+      ofNullable(tokensCount).ifPresent(userBuilder::setTokensCount);
       ofNullable(user.getLastConnectionDate()).ifPresent(date -> userBuilder.setLastConnectionDate(formatDateTime(date)));
     }
     return userBuilder.build();
   }
 
-  private static <PARAM> void setIfNeeded(String field, @Nullable Collection<String> fields, @Nullable PARAM parameter, Function<PARAM, ?> setter) {
-    setIfNeeded(isNeeded(field, fields), parameter, setter);
-  }
-
-  private static <PARAM> void setIfNeeded(boolean condition, @Nullable PARAM parameter, Function<PARAM, ?> setter) {
-    if (parameter != null && condition) {
-      setter.apply(parameter);
-    }
-  }
-
-  private static boolean isNeeded(String field, @Nullable Collection<String> fields) {
-    return fields == null || fields.isEmpty() || fields.contains(field);
-  }
-
   private static SearchRequest toSearchRequest(Request request) {
     int pageSize = request.mandatoryParamAsInt(PAGE_SIZE);
     checkArgument(pageSize <= MAX_PAGE_SIZE, "The '%s' parameter must be less than %s", PAGE_SIZE, MAX_PAGE_SIZE);
@@ -199,7 +169,6 @@ public class SearchAction implements UsersWsAction {
       .setQuery(request.param(TEXT_QUERY))
       .setPage(request.mandatoryParamAsInt(PAGE))
       .setPageSize(pageSize)
-      .setPossibleFields(request.paramAsStrings(FIELDS))
       .build();
   }
 
@@ -208,13 +177,11 @@ public class SearchAction implements UsersWsAction {
     private final Integer page;
     private final Integer pageSize;
     private final String query;
-    private final List<String> possibleFields;
 
     private SearchRequest(Builder builder) {
       this.page = builder.page;
       this.pageSize = builder.pageSize;
       this.query = builder.query;
-      this.possibleFields = builder.additionalFields;
     }
 
     @CheckForNull
@@ -232,10 +199,6 @@ public class SearchAction implements UsersWsAction {
       return query;
     }
 
-    public List<String> getPossibleFields() {
-      return possibleFields;
-    }
-
     public static Builder builder() {
       return new Builder();
     }
@@ -245,7 +208,6 @@ public class SearchAction implements UsersWsAction {
     private Integer page;
     private Integer pageSize;
     private String query;
-    private List<String> additionalFields = new ArrayList<>();
 
     private Builder() {
       // enforce factory method use
@@ -266,11 +228,6 @@ public class SearchAction implements UsersWsAction {
       return this;
     }
 
-    public Builder setPossibleFields(List<String> possibleFields) {
-      this.additionalFields = possibleFields;
-      return this;
-    }
-
     public SearchRequest build() {
       return new SearchRequest(this);
     }
index aaa1d871f1462ebf9f57483d2b88e2fe255c8883..8df62cca4f7b3dd906e730769947fee3b54c9a86 100644 (file)
@@ -63,6 +63,7 @@ import static java.util.Collections.emptyList;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.tuple;
 import static org.mockito.Mockito.mock;
+import static org.sonar.api.server.ws.WebService.Param.TEXT_QUERY;
 import static org.sonar.api.utils.DateUtils.formatDate;
 import static org.sonar.api.utils.DateUtils.formatDateTime;
 import static org.sonar.db.ce.CeActivityDto.Status.FAILED;
@@ -74,7 +75,6 @@ import static org.sonar.db.ce.CeTaskCharacteristicDto.BRANCH_TYPE_KEY;
 import static org.sonar.db.ce.CeTaskCharacteristicDto.PULL_REQUEST;
 import static org.sonar.db.component.BranchType.LONG;
 import static org.sonar.server.ce.ws.CeWsParameters.PARAM_COMPONENT_ID;
-import static org.sonar.server.ce.ws.CeWsParameters.PARAM_COMPONENT_QUERY;
 import static org.sonar.server.ce.ws.CeWsParameters.PARAM_MAX_EXECUTED_AT;
 import static org.sonar.server.ce.ws.CeWsParameters.PARAM_MIN_SUBMITTED_AT;
 import static org.sonar.server.ce.ws.CeWsParameters.PARAM_STATUS;
@@ -290,7 +290,7 @@ public class ActivityActionTest {
     insertActivity("T2", zookeeper, SUCCESS);
     insertActivity("T3", eclipse, SUCCESS);
 
-    ActivityResponse activityResponse = call(ws.newRequest().setParam(PARAM_COMPONENT_QUERY, "apac"));
+    ActivityResponse activityResponse = call(ws.newRequest().setParam(TEXT_QUERY, "apac"));
 
     assertThat(activityResponse.getTasksList()).extracting("id").containsOnly("T1", "T2");
   }
@@ -302,7 +302,7 @@ public class ActivityActionTest {
     logInAsSystemAdministrator();
     insertActivity("T2", apacheView, SUCCESS);
 
-    ActivityResponse activityResponse = call(ws.newRequest().setParam(PARAM_COMPONENT_QUERY, "apac"));
+    ActivityResponse activityResponse = call(ws.newRequest().setParam(TEXT_QUERY, "apac"));
 
     assertThat(activityResponse.getTasksList()).extracting("id").containsOnly("T2");
   }
@@ -314,7 +314,7 @@ public class ActivityActionTest {
     logInAsSystemAdministrator();
     insertActivity("T2", apacheApp, SUCCESS);
 
-    ActivityResponse activityResponse = call(ws.newRequest().setParam(PARAM_COMPONENT_QUERY, "apac"));
+    ActivityResponse activityResponse = call(ws.newRequest().setParam(TEXT_QUERY, "apac"));
 
     assertThat(activityResponse.getTasksList()).extracting(Task::getId).containsOnly("T2");
   }
@@ -459,11 +459,11 @@ public class ActivityActionTest {
   @Test
   public void fail_if_both_filters_on_component_id_and_name() {
     expectedException.expect(BadRequestException.class);
-    expectedException.expectMessage("componentId and componentQuery must not be set at the same time");
+    expectedException.expectMessage("componentId and q must not be set at the same time");
 
     ws.newRequest()
       .setParam("componentId", "ID1")
-      .setParam("componentQuery", "apache")
+      .setParam("q", "apache")
       .setMediaType(MediaTypes.PROTOBUF)
       .execute();
   }
index a575f36e9d79430e094cc59f33280e127d943700..f209f3c21b59a69c68fa65aa10ee462f82d480a2 100644 (file)
@@ -30,6 +30,6 @@ public class ComponentsWsModuleTest {
   public void verify_count_of_added_components() {
     ComponentContainer container = new ComponentContainer();
     new ComponentsWsModule().configure(container);
-    assertThat(container.size()).isEqualTo(COMPONENTS_IN_EMPTY_COMPONENT_CONTAINER + 8);
+    assertThat(container.size()).isEqualTo(COMPONENTS_IN_EMPTY_COMPONENT_CONTAINER + 7);
   }
 }
diff --git a/server/sonar-server/src/test/java/org/sonar/server/component/ws/ResourcesWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/component/ws/ResourcesWsTest.java
deleted file mode 100644 (file)
index dc838e8..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2019 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.sonar.server.component.ws;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.sonar.api.server.ws.WebService;
-import org.sonar.server.ws.RemovedWebServiceHandler;
-import org.sonar.server.ws.WsTester;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class ResourcesWsTest {
-
-  WebService.Controller controller;
-
-  @Before
-  public void setUp() {
-    WsTester tester = new WsTester(new ResourcesWs());
-    controller = tester.controller("api/resources");
-  }
-
-  @Test
-  public void define_controller() {
-    assertThat(controller).isNotNull();
-    assertThat(controller.since()).isEqualTo("2.10");
-    assertThat(controller.description()).isNotEmpty();
-    assertThat(controller.actions()).hasSize(1);
-  }
-
-  @Test
-  public void define_index_action() {
-    WebService.Action action = controller.action("index");
-    assertThat(action).isNotNull();
-    assertThat(action.handler()).isInstanceOf(RemovedWebServiceHandler.class);
-    assertThat(action.responseExampleAsString()).isNotEmpty();
-    assertThat(action.params()).isEmpty();
-  }
-
-}
index 4c262bee499ee8ef83d6bd53947d03a502a6ac16..2a321a15480118ec19c600b89eb3dc096f005f94 100644 (file)
@@ -212,11 +212,11 @@ public class IssueQueryFactoryTest {
   @Test
   public void fail_if_components_and_components_uuid_params_are_set_at_the_same_time() {
     SearchRequest request = new SearchRequest()
-      .setComponentKeys(asList("foo"))
-      .setComponentUuids(asList("bar"));
+      .setComponentKeys(singletonList("foo"))
+      .setComponentUuids(singletonList("bar"));
 
     expectedException.expect(IllegalArgumentException.class);
-    expectedException.expectMessage("At most one of the following parameters can be provided: componentKeys, componentUuids, components, componentRoots, componentUuids");
+    expectedException.expectMessage("At most one of the following parameters can be provided: componentKeys and componentUuids");
 
     underTest.create(request);
   }
@@ -224,11 +224,11 @@ public class IssueQueryFactoryTest {
   @Test
   public void fail_if_both_componentRoots_and_componentRootUuids_params_are_set() {
     SearchRequest request = new SearchRequest()
-      .setComponentRoots(asList("foo"))
-      .setComponentRootUuids(asList("bar"));
+      .setComponentRoots(singletonList("foo"))
+      .setComponentRootUuids(singletonList("bar"));
 
     expectedException.expect(IllegalArgumentException.class);
-    expectedException.expectMessage("At most one of the following parameters can be provided: componentKeys, componentUuids, components, componentRoots, componentUuids");
+    expectedException.expectMessage("At most one of the following parameters can be provided: componentKeys and componentUuids");
 
     underTest.create(request);
   }
index d901f322ed897e59d2725d25e5224658bbfd0cc3..7943f9e5f20effc5d04b1794d15b48b9f3658e6b 100644 (file)
@@ -38,9 +38,9 @@ import org.sonar.server.exceptions.NotFoundException;
 import org.sonar.server.exceptions.UnauthorizedException;
 import org.sonar.server.issue.IssueFieldsSetter;
 import org.sonar.server.issue.IssueFinder;
-import org.sonar.server.issue.WebIssueStorage;
 import org.sonar.server.issue.IssueUpdater;
 import org.sonar.server.issue.TestIssueChangePostProcessor;
+import org.sonar.server.issue.WebIssueStorage;
 import org.sonar.server.issue.index.IssueIndexer;
 import org.sonar.server.issue.index.IssueIteratorFactory;
 import org.sonar.server.notification.NotificationManager;
@@ -123,21 +123,6 @@ public class AssignActionTest {
     assertThat(issueChangePostProcessor.wasCalled()).isFalse();
   }
 
-  @Test
-  public void assign_to_me_using_deprecated_me_param() {
-    IssueDto issue = newIssueWithBrowsePermission();
-
-    ws.newRequest()
-      .setParam("issue", issue.getKey())
-      .setParam("me", "true")
-      .execute();
-
-    checkIssueAssignee(issue.getKey(), CURRENT_USER_UUID);
-    Optional<IssueDto> optionalIssueDto = dbClient.issueDao().selectByKey(session, issue.getKey());
-    assertThat(optionalIssueDto).isPresent();
-    assertThat(optionalIssueDto.get().getAssigneeUuid()).isEqualTo(CURRENT_USER_UUID);
-  }
-
   @Test
   public void unassign() {
     IssueDto issue = newIssueWithBrowsePermission();
@@ -205,7 +190,7 @@ public class AssignActionTest {
     UserDto arthur = insertUser("arthur");
 
     expectedException.expect(IllegalArgumentException.class);
-    expectedException.expectMessage("It is not allowed to assign a security hotspot");
+    expectedException.expectMessage("Assigning security hotspots is not allowed");
 
     ws.newRequest()
       .setParam("issue", issueDto.getKey())
index 82b76d306744a072f065f20e480313362a72c8c1..4af1280a20409f0abfb32ac035adecd8f56f2bec 100644 (file)
@@ -649,7 +649,7 @@ public class BulkChangeActionTest {
     assertThat(action.key()).isEqualTo("bulk_change");
     assertThat(action.isPost()).isTrue();
     assertThat(action.isInternal()).isFalse();
-    assertThat(action.params()).hasSize(10);
+    assertThat(action.params()).hasSize(9);
     assertThat(action.responseExample()).isNotNull();
   }
 
index 9b30a5b98a3853397b972ca380c72282571d3f64..9a4bacc317dad51d753392ae741ec5599f620a59 100644 (file)
@@ -75,7 +75,6 @@ import static org.sonar.db.component.ComponentTesting.newSubView;
 import static org.sonar.db.component.ComponentTesting.newView;
 import static org.sonar.db.issue.IssueTesting.newIssue;
 import static org.sonarqube.ws.client.component.ComponentsWsParameters.PARAM_BRANCH;
-import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_COMPONENTS;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_COMPONENT_KEYS;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_COMPONENT_UUIDS;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_DIRECTORIES;
@@ -289,12 +288,12 @@ public class SearchActionComponentsTest {
     indexIssues();
 
     ws.newRequest()
-      .setParam(PARAM_COMPONENTS, file.getDbKey())
+      .setParam(PARAM_COMPONENT_KEYS, file.getKey())
       .execute()
       .assertJson(this.getClass(), "search_by_file_key.json");
 
     ws.newRequest()
-      .setParam(PARAM_COMPONENTS, unitTest.getDbKey())
+      .setParam(PARAM_COMPONENT_KEYS, unitTest.getKey())
       .execute()
       .assertJson(this.getClass(), "search_by_test_key.json");
   }
index 2a5a338f4f0ab88edf44ce6892abfd452446847d..1f44c1786777cea0de7630dc314de1ed2cb99ca5 100644 (file)
@@ -92,7 +92,7 @@ import static org.sonar.db.issue.IssueTesting.newDto;
 import static org.sonar.server.tester.UserSessionRule.standalone;
 import static org.sonarqube.ws.client.component.ComponentsWsParameters.PARAM_BRANCH;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_ADDITIONAL_FIELDS;
-import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_COMPONENTS;
+import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_COMPONENT_KEYS;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_CREATED_AFTER;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_HIDE_COMMENTS;
 import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_PAGE_INDEX;
@@ -430,7 +430,7 @@ public class SearchActionTest {
     session.commit();
     indexIssues();
 
-    ws.newRequest().setParam(PARAM_COMPONENTS, file.getDbKey()).execute()
+    ws.newRequest().setParam(PARAM_COMPONENT_KEYS, file.getKey()).execute()
       .assertJson(this.getClass(), "apply_paging_with_one_component.json");
   }
 
@@ -850,7 +850,7 @@ public class SearchActionTest {
     assertThat(def.responseExampleAsString()).isNotEmpty();
 
     assertThat(def.params()).extracting("key").containsExactlyInAnyOrder(
-      "additionalFields", "asc", "assigned", "assignees", "authors", "author", "componentKeys", "componentRootUuids", "componentRoots", "componentUuids", "components", "branch",
+      "additionalFields", "asc", "assigned", "assignees", "authors", "author", "componentKeys", "componentUuids", "branch",
       "pullRequest", "organization",
       "createdAfter", "createdAt", "createdBefore", "createdInLast", "directories", "facetMode", "facets", "fileUuids", "issues", "languages", "moduleUuids", "onComponentOnly",
       "p", "projects", "ps", "resolutions", "resolved", "rules", "s", "severities", "sinceLeakPeriod",
diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ProfilesWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ProfilesWsTest.java
deleted file mode 100644 (file)
index 9aeb479..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2019 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.sonar.server.qualityprofile.ws;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.sonar.api.server.ws.WebService;
-import org.sonar.server.ws.RemovedWebServiceHandler;
-import org.sonar.server.ws.WsTester;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class ProfilesWsTest {
-
-  private WsTester ws;
-
-  @Before
-  public void setUp() {
-    ws = new WsTester(new ProfilesWs());
-  }
-
-  @Test
-  public void define_controller() {
-    WebService.Controller controller = controller();
-    assertThat(controller).isNotNull();
-    assertThat(controller.path()).isEqualTo("api/profiles");
-    assertThat(controller.description()).isNotEmpty();
-    assertThat(controller.actions()).hasSize(2);
-  }
-
-  @Test
-  public void define_index_action() {
-    WebService.Controller controller = ws.controller("api/profiles");
-
-    WebService.Action restoreProfiles = controller.action("index");
-    assertThat(restoreProfiles).isNotNull();
-    assertThat(restoreProfiles.handler()).isInstanceOf(RemovedWebServiceHandler.class);
-    assertThat(restoreProfiles.responseExampleAsString()).isNotEmpty();
-    assertThat(restoreProfiles.params()).isEmpty();
-  }
-
-  @Test
-  public void define_list_action() {
-    WebService.Controller controller = controller();
-
-    WebService.Action listProfiles = controller.action("list");
-    assertThat(listProfiles).isNotNull();
-    assertThat(listProfiles.handler()).isInstanceOf(RemovedWebServiceHandler.class);
-    assertThat(listProfiles.responseExampleAsString()).isNotEmpty();
-    assertThat(listProfiles.params()).isEmpty();
-  }
-
-  private WebService.Controller controller() {
-    return ws.controller("api/profiles");
-  }
-}
index 786e22c52880c9544fb5b4732d2fed8a766bb151..a11505feed626adbf54b84e5b2c37ce367caaa8c 100644 (file)
@@ -32,7 +32,6 @@ import org.sonar.db.DbTester;
 import org.sonar.db.organization.OrganizationDto;
 import org.sonar.db.rule.RuleDefinitionDto;
 import org.sonar.db.rule.RuleMetadataDto;
-import org.sonar.db.rule.RuleTesting;
 import org.sonar.db.user.UserDto;
 import org.sonar.server.es.EsClient;
 import org.sonar.server.es.EsTester;
@@ -60,9 +59,6 @@ import static org.sonar.api.server.debt.DebtRemediationFunction.Type.LINEAR_OFFS
 import static org.sonar.db.permission.OrganizationPermission.ADMINISTER_QUALITY_PROFILES;
 import static org.sonar.db.rule.RuleTesting.setSystemTags;
 import static org.sonar.db.rule.RuleTesting.setTags;
-import static org.sonar.server.rule.ws.UpdateAction.DEPRECATED_PARAM_REMEDIATION_FN_COEFF;
-import static org.sonar.server.rule.ws.UpdateAction.DEPRECATED_PARAM_REMEDIATION_FN_OFFSET;
-import static org.sonar.server.rule.ws.UpdateAction.DEPRECATED_PARAM_REMEDIATION_FN_TYPE;
 import static org.sonar.server.rule.ws.UpdateAction.PARAM_KEY;
 import static org.sonar.server.rule.ws.UpdateAction.PARAM_MARKDOWN_NOTE;
 import static org.sonar.server.rule.ws.UpdateAction.PARAM_ORGANIZATION;
@@ -106,7 +102,7 @@ public class UpdateActionTest {
     assertThat(ws.getDef().responseExampleAsString()).isNotNull();
     assertThat(ws.getDef().description()).isNotNull();
   }
-  
+
   @Test
   public void update_custom_rule() {
     logInAsQProfileAdministrator();
@@ -249,46 +245,6 @@ public class UpdateActionTest {
     assertThat(metadataOfSpecificOrg.getRemediationBaseEffort()).isEqualTo(newEffort);
   }
 
-  @Test
-  public void update_custom_rule_with_deprecated_remediation_function_parameters() {
-    logInAsQProfileAdministrator();
-
-    RuleDefinitionDto rule = RuleTesting.newRule()
-      .setDefRemediationFunction(LINEAR_OFFSET.toString())
-      .setDefRemediationGapMultiplier("10d")
-      .setDefRemediationBaseEffort("5min");
-    db.rules().insert(rule);
-
-    String newType = LINEAR_OFFSET.toString();
-    String newCoeff = "11d";
-    String newOffset = "6min";
-
-    Rules.UpdateResponse result = ws.newRequest().setMethod("POST")
-      .setParam(PARAM_KEY, rule.getKey().toString())
-      .setParam(DEPRECATED_PARAM_REMEDIATION_FN_TYPE, newType)
-      .setParam(DEPRECATED_PARAM_REMEDIATION_FN_COEFF, newCoeff)
-      .setParam(DEPRECATED_PARAM_REMEDIATION_FN_OFFSET, newOffset)
-      .executeProtobuf(Rules.UpdateResponse.class);
-
-    Rules.Rule updatedRule = result.getRule();
-    assertThat(updatedRule).isNotNull();
-
-    assertThat(updatedRule.getKey()).isEqualTo(rule.getKey().toString());
-    assertThat(updatedRule.getDefaultRemFnType()).isEqualTo(rule.getDefRemediationFunction());
-    assertThat(updatedRule.getDefaultRemFnGapMultiplier()).isEqualTo(rule.getDefRemediationGapMultiplier());
-    assertThat(updatedRule.getDefaultRemFnBaseEffort()).isEqualTo(rule.getDefRemediationBaseEffort());
-    assertThat(updatedRule.getEffortToFixDescription()).isEqualTo(rule.getGapDescription());
-
-    assertThat(updatedRule.getRemFnType()).isEqualTo(newType);
-    assertThat(updatedRule.getDebtRemFnCoeff()).isEqualTo(newCoeff);
-    assertThat(updatedRule.getDebtRemFnOffset()).isEqualTo(newOffset);
-
-    assertThat(updatedRule.getRemFnType()).isEqualTo(newType);
-    assertThat(updatedRule.getRemFnGapMultiplier()).isEqualTo(newCoeff);
-    assertThat(updatedRule.getRemFnBaseEffort()).isEqualTo(newOffset);
-    assertThat(updatedRule.getGapDescription()).isEqualTo(rule.getGapDescription());
-  }
-
   @Test
   public void update_note() {
     OrganizationDto organization = db.organizations().insert();
index 37edde0c6f8f35ab917c8fca1f879c1c605ee50d..a20573fc2ca841b9af6c74e09e4769058d6e66f6 100644 (file)
@@ -24,6 +24,7 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.sonar.api.config.internal.MapSettings;
+import org.sonar.api.server.ws.WebService;
 import org.sonar.api.utils.System2;
 import org.sonar.api.utils.internal.AlwaysIncreasingSystem2;
 import org.sonar.db.DbTester;
@@ -196,6 +197,14 @@ public class ChangePasswordActionTest {
       .execute();
   }
 
+  @Test
+  public void test_definition() {
+    WebService.Action action = tester.getDef();
+    assertThat(action).isNotNull();
+    assertThat(action.isPost()).isTrue();
+    assertThat(action.params()).hasSize(3);
+  }
+
   private void createLocalUser() {
     db.users().insertUser(newLocalUser("john", "John", "john@email.com"));
   }
index e01fb412b8ce33d117ad77603543325b284cc0cb..b8c693cc2834d43b029bac58e1a96f8fcc3c2b12 100644 (file)
@@ -27,6 +27,7 @@ import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.mockito.ArgumentCaptor;
 import org.sonar.api.config.internal.MapSettings;
+import org.sonar.api.server.ws.WebService;
 import org.sonar.api.utils.System2;
 import org.sonar.api.utils.internal.AlwaysIncreasingSystem2;
 import org.sonar.core.config.CorePropertyDefinitions;
@@ -379,6 +380,14 @@ public class CreateActionTest {
     executeRequest("john");
   }
 
+  @Test
+  public void test_definition() {
+    WebService.Action action = tester.getDef();
+    assertThat(action).isNotNull();
+    assertThat(action.isPost()).isTrue();
+    assertThat(action.params()).hasSize(7);
+  }
+
   private CreateWsResponse executeRequest(String login) {
     return call(CreateRequest.builder()
       .setLogin(login)
index 8e820541c6d5271663d272927c511e0fda85d965..ff98570dbdf2531ecd210583236f4fdb27178762 100644 (file)
@@ -22,6 +22,7 @@ package org.sonar.server.user.ws;
 import java.util.stream.IntStream;
 import org.junit.Rule;
 import org.junit.Test;
+import org.sonar.api.server.ws.WebService;
 import org.sonar.api.server.ws.WebService.Param;
 import org.sonar.api.utils.System2;
 import org.sonar.db.DbTester;
@@ -289,51 +290,18 @@ public class SearchActionTest {
     userSession.logIn(user);
     assertThat(ws.newRequest().setParam("q", user.getLogin())
       .executeProtobuf(SearchWsResponse.class).getUsersList())
-      .extracting(User::getLogin, User::getName, User::getEmail, User::getExternalIdentity, User::getExternalProvider,
-        User::hasScmAccounts, User::hasAvatar, User::hasGroups, User::getTokensCount, User::hasLastConnectionDate)
-      .containsExactlyInAnyOrder(
-        tuple(user.getLogin(), user.getName(), user.getEmail(), user.getExternalLogin(), user.getExternalIdentityProvider(), true, true, true, 2, true));
+        .extracting(User::getLogin, User::getName, User::getEmail, User::getExternalIdentity, User::getExternalProvider,
+          User::hasScmAccounts, User::hasAvatar, User::hasGroups, User::getTokensCount, User::hasLastConnectionDate)
+        .containsExactlyInAnyOrder(
+          tuple(user.getLogin(), user.getName(), user.getEmail(), user.getExternalLogin(), user.getExternalIdentityProvider(), true, true, true, 2, true));
 
     userSession.logIn(otherUser);
     assertThat(ws.newRequest().setParam("q", user.getLogin())
       .executeProtobuf(SearchWsResponse.class).getUsersList())
-      .extracting(User::getLogin, User::getName, User::hasEmail, User::hasExternalIdentity, User::hasExternalProvider,
-        User::hasScmAccounts, User::hasAvatar, User::hasGroups, User::hasTokensCount, User::hasLastConnectionDate)
-      .containsExactlyInAnyOrder(
-        tuple(user.getLogin(), user.getName(), false, false, true, true, true, false, false, false));
-  }
-
-  @Test
-  public void search_with_fields() {
-    UserDto user = db.users().insertUser();
-    GroupDto group = db.users().insertGroup(db.getDefaultOrganization());
-    db.users().insertMember(group, user);
-    userIndexer.indexOnStartup(null);
-    userSession.logIn().setSystemAdministrator();
-
-    assertThat(ws.newRequest()
-      .setParam(Param.FIELDS, "scmAccounts")
-      .executeProtobuf(SearchWsResponse.class)
-      .getUsersList())
-        .extracting(User::getLogin, User::hasName, User::hasScmAccounts, User::hasAvatar, User::hasGroups)
-        .containsExactlyInAnyOrder(tuple(user.getLogin(), false, true, false, false));
-    assertThat(ws.newRequest()
-      .setParam(Param.FIELDS, "groups")
-      .executeProtobuf(SearchWsResponse.class)
-      .getUsersList())
-        .extracting(User::getLogin, User::hasName, User::hasScmAccounts, User::hasAvatar, User::hasGroups)
-        .containsExactlyInAnyOrder(tuple(user.getLogin(), false, false, false, true));
-    assertThat(ws.newRequest()
-      .setParam(Param.FIELDS, "")
-      .executeProtobuf(SearchWsResponse.class)
-      .getUsersList())
-        .extracting(User::getLogin, User::hasName, User::hasScmAccounts, User::hasAvatar, User::hasGroups)
-        .containsExactlyInAnyOrder(tuple(user.getLogin(), true, true, true, true));
-    assertThat(ws.newRequest()
-      .executeProtobuf(SearchWsResponse.class)
-      .getUsersList())
-        .extracting(User::getLogin, User::hasName, User::hasScmAccounts, User::hasAvatar, User::hasGroups)
-        .containsExactlyInAnyOrder(tuple(user.getLogin(), true, true, true, true));
+        .extracting(User::getLogin, User::getName, User::hasEmail, User::hasExternalIdentity, User::hasExternalProvider,
+          User::hasScmAccounts, User::hasAvatar, User::hasGroups, User::hasTokensCount, User::hasLastConnectionDate)
+        .containsExactlyInAnyOrder(
+          tuple(user.getLogin(), user.getName(), false, false, true, true, true, false, false, false));
   }
 
   @Test
@@ -404,4 +372,13 @@ public class SearchActionTest {
     assertJson(response).isSimilarTo(getClass().getResource("search-example.json"));
   }
 
+  @Test
+  public void test_definition() {
+    WebService.Action action = ws.getDef();
+    assertThat(action).isNotNull();
+    assertThat(action.isPost()).isFalse();
+    assertThat(action.responseExampleAsString()).isNotEmpty();
+    assertThat(action.params()).hasSize(3);
+  }
+
 }
index 47adf248ac9d0daf3635146fd8b5734d1c0cb306..efab9c999c068185bcfad3b6645d722a3b3b2357 100644 (file)
@@ -25,6 +25,7 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.sonar.api.config.internal.MapSettings;
+import org.sonar.api.server.ws.WebService;
 import org.sonar.api.utils.System2;
 import org.sonar.db.DbClient;
 import org.sonar.db.DbSession;
@@ -273,6 +274,14 @@ public class UpdateActionTest {
       .execute();
   }
 
+  @Test
+  public void test_definition() {
+    WebService.Action action = ws.getDef();
+    assertThat(action).isNotNull();
+    assertThat(action.isPost()).isTrue();
+    assertThat(action.params()).hasSize(5);
+  }
+
   private void createUser() {
     UserDto userDto = newUserDto()
       .setEmail("john@email.com")
diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/ws/UsersWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/ws/UsersWsTest.java
deleted file mode 100644 (file)
index a8c6d6c..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2019 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.sonar.server.user.ws;
-
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.sonar.api.server.ws.WebService;
-import org.sonar.db.DbClient;
-import org.sonar.db.DbTester;
-import org.sonar.server.authentication.CredentialsLocalAuthentication;
-import org.sonar.server.issue.ws.AvatarResolver;
-import org.sonar.server.tester.UserSessionRule;
-import org.sonar.server.user.UserUpdater;
-import org.sonar.server.user.index.UserIndex;
-import org.sonar.server.ws.WsTester;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.mock;
-
-public class UsersWsTest {
-  @Rule
-  public UserSessionRule userSessionRule = UserSessionRule.standalone();
-  @Rule
-  public DbTester db = DbTester.create();
-
-  private WebService.Controller controller;
-  private CredentialsLocalAuthentication localAuthentication = new CredentialsLocalAuthentication(db.getDbClient());
-
-  @Before
-  public void setUp() {
-    WsTester tester = new WsTester(new UsersWs(
-      new CreateAction(mock(DbClient.class), mock(UserUpdater.class), userSessionRule),
-      new UpdateAction(mock(UserUpdater.class), userSessionRule, mock(UserJsonWriter.class), mock(DbClient.class)),
-      new ChangePasswordAction(mock(DbClient.class), mock(UserUpdater.class), userSessionRule, localAuthentication),
-      new SearchAction(userSessionRule, mock(UserIndex.class), mock(DbClient.class), mock(AvatarResolver.class))));
-    controller = tester.controller("api/users");
-  }
-
-  @Test
-  public void define_controller() {
-    assertThat(controller).isNotNull();
-    assertThat(controller.description()).isNotEmpty();
-    assertThat(controller.since()).isEqualTo("3.6");
-    assertThat(controller.actions()).hasSize(4);
-  }
-
-  @Test
-  public void define_search_action() {
-    WebService.Action action = controller.action("search");
-    assertThat(action).isNotNull();
-    assertThat(action.isPost()).isFalse();
-    assertThat(action.responseExampleAsString()).isNotEmpty();
-    assertThat(action.params()).hasSize(4);
-  }
-
-  @Test
-  public void define_create_action() {
-    WebService.Action action = controller.action("create");
-    assertThat(action).isNotNull();
-    assertThat(action.isPost()).isTrue();
-    assertThat(action.params()).hasSize(7);
-  }
-
-  @Test
-  public void define_update_action() {
-    WebService.Action action = controller.action("update");
-    assertThat(action).isNotNull();
-    assertThat(action.isPost()).isTrue();
-    assertThat(action.params()).hasSize(5);
-  }
-
-  @Test
-  public void define_change_password_action() {
-    WebService.Action action = controller.action("change_password");
-    assertThat(action).isNotNull();
-    assertThat(action.isPost()).isTrue();
-    assertThat(action.params()).hasSize(3);
-  }
-
-}
index d83de740725cfbca701953236dd3f6ca8db90e0a..587899c7824295252b2b2c8304841a2ad12793cc 100644 (file)
@@ -44,7 +44,6 @@ import org.sonarqube.ws.client.notifications.NotificationsService;
 import org.sonarqube.ws.client.organizations.OrganizationsService;
 import org.sonarqube.ws.client.permissions.PermissionsService;
 import org.sonarqube.ws.client.plugins.PluginsService;
-import org.sonarqube.ws.client.profiles.ProfilesService;
 import org.sonarqube.ws.client.projectanalyses.ProjectAnalysesService;
 import org.sonarqube.ws.client.projectbadges.ProjectBadgesService;
 import org.sonarqube.ws.client.projectbranches.ProjectBranchesService;
@@ -56,7 +55,6 @@ import org.sonarqube.ws.client.projecttags.ProjectTagsService;
 import org.sonarqube.ws.client.properties.PropertiesService;
 import org.sonarqube.ws.client.qualitygates.QualitygatesService;
 import org.sonarqube.ws.client.qualityprofiles.QualityprofilesService;
-import org.sonarqube.ws.client.resources.ResourcesService;
 import org.sonarqube.ws.client.roots.RootsService;
 import org.sonarqube.ws.client.rules.RulesService;
 import org.sonarqube.ws.client.securityreports.SecurityReportsService;
@@ -109,7 +107,6 @@ class DefaultWsClient implements WsClient {
   private final OrganizationsService organizationsService;
   private final PermissionsService permissionsService;
   private final PluginsService pluginsService;
-  private final ProfilesService profilesService;
   private final ProjectAnalysesService projectAnalysesService;
   private final ProjectBadgesService projectBadgesService;
   private final ProjectBranchesService projectBranchesService;
@@ -121,7 +118,6 @@ class DefaultWsClient implements WsClient {
   private final PropertiesService propertiesService;
   private final QualitygatesService qualitygatesService;
   private final QualityprofilesService qualityprofilesService;
-  private final ResourcesService resourcesService;
   private final RootsService rootsService;
   private final RulesService rulesService;
   private final ServerService serverService;
@@ -167,7 +163,6 @@ class DefaultWsClient implements WsClient {
     this.organizationsService = new OrganizationsService(wsConnector);
     this.permissionsService = new PermissionsService(wsConnector);
     this.pluginsService = new PluginsService(wsConnector);
-    this.profilesService = new ProfilesService(wsConnector);
     this.projectAnalysesService = new ProjectAnalysesService(wsConnector);
     this.projectBadgesService = new ProjectBadgesService(wsConnector);
     this.projectBranchesService = new ProjectBranchesService(wsConnector);
@@ -179,7 +174,6 @@ class DefaultWsClient implements WsClient {
     this.propertiesService = new PropertiesService(wsConnector);
     this.qualitygatesService = new QualitygatesService(wsConnector);
     this.qualityprofilesService = new QualityprofilesService(wsConnector);
-    this.resourcesService = new ResourcesService(wsConnector);
     this.rootsService = new RootsService(wsConnector);
     this.rulesService = new RulesService(wsConnector);
     this.serverService = new ServerService(wsConnector);
@@ -321,11 +315,6 @@ class DefaultWsClient implements WsClient {
     return pluginsService;
   }
 
-  @Override
-  public ProfilesService profiles() {
-    return profilesService;
-  }
-
   @Override
   public ProjectAnalysesService projectAnalyses() {
     return projectAnalysesService;
@@ -381,11 +370,6 @@ class DefaultWsClient implements WsClient {
     return qualityprofilesService;
   }
 
-  @Override
-  public ResourcesService resources() {
-    return resourcesService;
-  }
-
   @Override
   public RootsService roots() {
     return rootsService;
index 30df290cd004d5f1dc2898f31efda9be8d6979d4..5fdba68259d86099400c9aa9ec47ef56cf0b25cd 100644 (file)
@@ -44,7 +44,6 @@ import org.sonarqube.ws.client.notifications.NotificationsService;
 import org.sonarqube.ws.client.organizations.OrganizationsService;
 import org.sonarqube.ws.client.permissions.PermissionsService;
 import org.sonarqube.ws.client.plugins.PluginsService;
-import org.sonarqube.ws.client.profiles.ProfilesService;
 import org.sonarqube.ws.client.projectanalyses.ProjectAnalysesService;
 import org.sonarqube.ws.client.projectbadges.ProjectBadgesService;
 import org.sonarqube.ws.client.projectbranches.ProjectBranchesService;
@@ -56,7 +55,6 @@ import org.sonarqube.ws.client.projecttags.ProjectTagsService;
 import org.sonarqube.ws.client.properties.PropertiesService;
 import org.sonarqube.ws.client.qualitygates.QualitygatesService;
 import org.sonarqube.ws.client.qualityprofiles.QualityprofilesService;
-import org.sonarqube.ws.client.resources.ResourcesService;
 import org.sonarqube.ws.client.roots.RootsService;
 import org.sonarqube.ws.client.rules.RulesService;
 import org.sonarqube.ws.client.securityreports.SecurityReportsService;
@@ -144,8 +142,6 @@ public interface WsClient {
 
   PluginsService plugins();
 
-  ProfilesService profiles();
-
   ProjectAnalysesService projectAnalyses();
 
   ProjectBadgesService projectBadges();
@@ -168,8 +164,6 @@ public interface WsClient {
 
   QualityprofilesService qualityprofiles();
 
-  ResourcesService resources();
-
   RootsService roots();
 
   RulesService rules();
index ad47a8c0a8b411f4ac7d9a40908724b0c88a190d..9b4cafe70aeb785b322237553e7726c7fa76dd28 100644 (file)
@@ -32,11 +32,9 @@ import javax.annotation.Generated;
 public class ActivityRequest {
 
   private String componentId;
-  private String componentQuery;
   private String maxExecutedAt;
   private String minSubmittedAt;
   private String onlyCurrents;
-  private String p;
   private String ps;
   private String q;
   private List<String> status;
@@ -54,20 +52,6 @@ public class ActivityRequest {
     return componentId;
   }
 
-  /**
-   * Example value: "Apache"
-   * @deprecated since 5.5
-   */
-  @Deprecated
-  public ActivityRequest setComponentQuery(String componentQuery) {
-    this.componentQuery = componentQuery;
-    return this;
-  }
-
-  public String getComponentQuery() {
-    return componentQuery;
-  }
-
   /**
    * Example value: "2017-10-19T13:00:00+0200"
    */
@@ -110,19 +94,6 @@ public class ActivityRequest {
     return onlyCurrents;
   }
 
-  /**
-   * @deprecated since 5.5
-   */
-  @Deprecated
-  public ActivityRequest setP(String p) {
-    this.p = p;
-    return this;
-  }
-
-  public String getP() {
-    return p;
-  }
-
   /**
    * Example value: "20"
    */
index 2269d55f60f2561df3cb75716e72263dc072239e..030f8d30c839f58d047b2193f515dcaecf2fed0b 100644 (file)
@@ -57,11 +57,9 @@ public class CeService extends BaseService {
     return call(
       new GetRequest(path("activity"))
         .setParam("componentId", request.getComponentId())
-        .setParam("componentQuery", request.getComponentQuery())
         .setParam("maxExecutedAt", request.getMaxExecutedAt())
         .setParam("minSubmittedAt", request.getMinSubmittedAt())
         .setParam("onlyCurrents", request.getOnlyCurrents())
-        .setParam("p", request.getP())
         .setParam("ps", request.getPs())
         .setParam("q", request.getQ())
         .setParam("status", request.getStatus() == null ? null : request.getStatus().stream().collect(Collectors.joining(",")))
index 041813066b138d03068e579c1af3d9448b96de3f..551ee1e4130fbcb5c52b2aad9fd2a4d7468b2500 100644 (file)
@@ -52,11 +52,8 @@ public class IssuesWsParameters {
   public static final String PARAM_STATUSES = "statuses";
   public static final String PARAM_RESOLUTIONS = "resolutions";
   public static final String PARAM_RESOLVED = "resolved";
-  public static final String PARAM_COMPONENTS = "components";
   public static final String PARAM_COMPONENT_KEYS = "componentKeys";
   public static final String PARAM_COMPONENT_UUIDS = "componentUuids";
-  public static final String PARAM_COMPONENT_ROOTS = "componentRoots";
-  public static final String PARAM_COMPONENT_ROOT_UUIDS = "componentRootUuids";
   public static final String PARAM_MODULE_UUIDS = "moduleUuids";
   public static final String PARAM_PROJECTS = "projects";
   public static final String PARAM_PROJECT_KEYS = "projectKeys";
@@ -70,23 +67,10 @@ public class IssuesWsParameters {
   public static final String PARAM_ASSIGN = "assign";
   public static final String PARAM_SET_SEVERITY = "set_severity";
   public static final String PARAM_SET_TYPE = "set_type";
-  public static final String PARAM_PLAN = "plan";
   public static final String PARAM_DO_TRANSITION = "do_transition";
   public static final String PARAM_ADD_TAGS = "add_tags";
   public static final String PARAM_REMOVE_TAGS = "remove_tags";
   public static final String PARAM_SEND_NOTIFICATIONS = "sendNotifications";
-
-  /**
-   * @deprecated since 5.5, action plan feature has been removed
-   */
-  @Deprecated
-  public static final String DEPRECATED_PARAM_ACTION_PLANS = "actionPlans";
-
-  /**
-   * @deprecated since 5.5, manual issue feature has been dropped.
-   */
-  @Deprecated
-  public static final String PARAM_REPORTERS = "reporters";
   public static final String PARAM_ASSIGNEES = "assignees";
 
   /**
@@ -103,12 +87,6 @@ public class IssuesWsParameters {
   public static final String PARAM_SANS_TOP_25 = "sansTop25";
   public static final String PARAM_CWE = "cwe";
   public static final String PARAM_ASSIGNED = "assigned";
-
-  /**
-   * @deprecated since 5.5, action plan feature has been removed
-   */
-  @Deprecated
-  public static final String PARAM_PLANNED = "planned";
   public static final String PARAM_HIDE_COMMENTS = "hideComments";
   public static final String PARAM_CREATED_AFTER = "createdAfter";
   public static final String PARAM_CREATED_AT = "createdAt";
index 525b7878ccddb8b3e9f580068d60df4c1b8bd69b..dd377affe65269069506dbb59ba9f1416f158fb3 100644 (file)
@@ -33,7 +33,6 @@ public class AssignRequest {
 
   private String assignee;
   private String issue;
-  private String me;
 
   /**
    * Example value: "admin"
@@ -60,23 +59,4 @@ public class AssignRequest {
     return issue;
   }
 
-  /**
-   * Possible values:
-   * <ul>
-   *   <li>"true"</li>
-   *   <li>"false"</li>
-   *   <li>"yes"</li>
-   *   <li>"no"</li>
-   * </ul>
-   * @deprecated since 5.2
-   */
-  @Deprecated
-  public AssignRequest setMe(String me) {
-    this.me = me;
-    return this;
-  }
-
-  public String getMe() {
-    return me;
-  }
 }
index 29a2305259b99dc4c6b101b47db5303c4e66f3d7..cc9a67ef188bd4d19c6eb780852f4770157e590f 100644 (file)
@@ -36,7 +36,6 @@ public class BulkChangeRequest {
   private List<String> comment;
   private String doTransition;
   private List<String> issues;
-  private List<String> plan;
   private String removeTags;
   private String sendNotifications;
   private List<String> setSeverity;
@@ -113,19 +112,6 @@ public class BulkChangeRequest {
     return issues;
   }
 
-  /**
-   * @deprecated since 5.5
-   */
-  @Deprecated
-  public BulkChangeRequest setPlan(List<String> plan) {
-    this.plan = plan;
-    return this;
-  }
-
-  public List<String> getPlan() {
-    return plan;
-  }
-
   /**
    * Example value: "security,java8"
    */
index bd898f434d99f9828d88fd8025cb0db96657e069..5ba7108f34633b1f4c388bd92bbc2d66494838b6 100644 (file)
@@ -75,8 +75,7 @@ public class IssuesService extends BaseService {
     return call(
       new PostRequest(path("assign"))
         .setParam("assignee", request.getAssignee())
-        .setParam("issue", request.getIssue())
-        .setParam("me", request.getMe()),
+        .setParam("issue", request.getIssue()),
       AssignResponse.parser());
   }
 
@@ -112,7 +111,6 @@ public class IssuesService extends BaseService {
         .setParam("comment", request.getComment() == null ? null : request.getComment().stream().collect(Collectors.joining(",")))
         .setParam("do_transition", request.getDoTransition())
         .setParam("issues", request.getIssues() == null ? null : request.getIssues().stream().collect(Collectors.joining(",")))
-        .setParam("plan", request.getPlan() == null ? null : request.getPlan().stream().collect(Collectors.joining(",")))
         .setParam("remove_tags", request.getRemoveTags())
         .setParam("sendNotifications", request.getSendNotifications())
         .setParam("set_severity", request.getSetSeverity() == null ? null : request.getSetSeverity().stream().collect(Collectors.joining(",")))
@@ -214,10 +212,7 @@ public class IssuesService extends BaseService {
         .setParam("authors", request.getAuthors() == null ? null : request.getAuthors().stream().collect(Collectors.joining(",")))
         .setParam("branch", request.getBranch())
         .setParam("componentKeys", request.getComponentKeys() == null ? null : request.getComponentKeys().stream().collect(Collectors.joining(",")))
-        .setParam("componentRootUuids", request.getComponentRootUuids())
-        .setParam("componentRoots", request.getComponentRoots())
         .setParam("componentUuids", request.getComponentUuids() == null ? null : request.getComponentUuids().stream().collect(Collectors.joining(",")))
-        .setParam("components", request.getComponents())
         .setParam("createdAfter", request.getCreatedAfter())
         .setParam("createdAt", request.getCreatedAt())
         .setParam("createdBefore", request.getCreatedBefore())
index 08407bcda0ee57dc0b7fef2217800109c8d6c479..8d2c4cd012d33721816fe68b1aea5701ae257439 100644 (file)
@@ -39,10 +39,7 @@ public class SearchRequest {
   private List<String> authors;
   private String branch;
   private List<String> componentKeys;
-  private String componentRootUuids;
-  private String componentRoots;
   private List<String> componentUuids;
-  private String components;
   private String createdAfter;
   private String createdAt;
   private String createdBefore;
@@ -194,32 +191,6 @@ public class SearchRequest {
     return componentKeys;
   }
 
-  /**
-   * @deprecated since 5.1
-   */
-  @Deprecated
-  public SearchRequest setComponentRootUuids(String componentRootUuids) {
-    this.componentRootUuids = componentRootUuids;
-    return this;
-  }
-
-  public String getComponentRootUuids() {
-    return componentRootUuids;
-  }
-
-  /**
-   * @deprecated since 5.1
-   */
-  @Deprecated
-  public SearchRequest setComponentRoots(String componentRoots) {
-    this.componentRoots = componentRoots;
-    return this;
-  }
-
-  public String getComponentRoots() {
-    return componentRoots;
-  }
-
   /**
    * Example value: "584a89f2-8037-4f7b-b82c-8b45d2d63fb2"
    * @deprecated since 6.5
@@ -234,19 +205,6 @@ public class SearchRequest {
     return componentUuids;
   }
 
-  /**
-   * @deprecated since 5.1
-   */
-  @Deprecated
-  public SearchRequest setComponents(String components) {
-    this.components = components;
-    return this;
-  }
-
-  public String getComponents() {
-    return components;
-  }
-
   /**
    * Example value: "2017-10-19 or 2017-10-19T13:00:00+0200"
    */
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/profiles/ProfilesService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/profiles/ProfilesService.java
deleted file mode 100644 (file)
index c1b2f9c..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2019 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.profiles;
-
-import java.util.stream.Collectors;
-import javax.annotation.Generated;
-import org.sonarqube.ws.MediaTypes;
-import org.sonarqube.ws.client.BaseService;
-import org.sonarqube.ws.client.GetRequest;
-import org.sonarqube.ws.client.PostRequest;
-import org.sonarqube.ws.client.WsConnector;
-
-/**
- * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/profiles">Further information about this web service online</a>
- */
-@Generated("sonar-ws-generator")
-public class ProfilesService extends BaseService {
-
-  public ProfilesService(WsConnector wsConnector) {
-    super(wsConnector, "api/profiles");
-  }
-
-  /**
-   *
-   * This is part of the internal API.
-   * This is a GET request.
-   * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/profiles/index">Further information about this action online (including a response example)</a>
-   * @since 3.3
-   * @deprecated since 5.2
-   */
-  @Deprecated
-  public String index() {
-    return call(
-      new GetRequest(path("index"))
-        .setMediaType(MediaTypes.JSON)
-      ).content();
-  }
-
-  /**
-   *
-   * This is part of the internal API.
-   * This is a GET request.
-   * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/profiles/list">Further information about this action online (including a response example)</a>
-   * @since 3.3
-   * @deprecated since 5.2
-   */
-  @Deprecated
-  public String list() {
-    return call(
-      new GetRequest(path("list"))
-        .setMediaType(MediaTypes.JSON)
-      ).content();
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/profiles/package-info.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/profiles/package-info.java
deleted file mode 100644 (file)
index 006b0a0..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2019 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.
- */
-@ParametersAreNonnullByDefault
-@Generated("sonar-ws-generator")
-package org.sonarqube.ws.client.profiles;
-
-import javax.annotation.ParametersAreNonnullByDefault;
-import javax.annotation.Generated;
-
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/resources/ResourcesService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/resources/ResourcesService.java
deleted file mode 100644 (file)
index 1fb3839..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2019 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.resources;
-
-import javax.annotation.Generated;
-import org.sonarqube.ws.MediaTypes;
-import org.sonarqube.ws.client.BaseService;
-import org.sonarqube.ws.client.GetRequest;
-import org.sonarqube.ws.client.WsConnector;
-
-/**
- * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/resources">Further information about this web service online</a>
- */
-@Generated("sonar-ws-generator")
-public class ResourcesService extends BaseService {
-
-  public ResourcesService(WsConnector wsConnector) {
-    super(wsConnector, "api/resources");
-  }
-
-  /**
-   *
-   * This is part of the internal API.
-   * This is a GET request.
-   * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/resources/index">Further information about this action online (including a response example)</a>
-   * @since 2.10
-   * @deprecated since 5.4
-   */
-  @Deprecated
-  public String index() {
-    return call(
-      new GetRequest(path("index"))
-        .setMediaType(MediaTypes.JSON)
-      ).content();
-  }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/resources/package-info.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/resources/package-info.java
deleted file mode 100644 (file)
index 8896933..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2019 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.
- */
-@ParametersAreNonnullByDefault
-@Generated("sonar-ws-generator")
-package org.sonarqube.ws.client.resources;
-
-import javax.annotation.ParametersAreNonnullByDefault;
-import javax.annotation.Generated;
-
index 4f4258db45f2000dd91ecfd2beac3db1ee1e8b8f..12ee49ce9f2d4f962a0a3eaf65fa6911d1379cd0 100644 (file)
@@ -32,7 +32,6 @@ import javax.annotation.Generated;
 public class CreateRequest {
 
   private String customKey;
-  private String manualKey;
   private String markdownDescription;
   private String name;
   private List<String> params;
@@ -55,20 +54,6 @@ public class CreateRequest {
     return customKey;
   }
 
-  /**
-   * Example value: "Error_handling"
-   * @deprecated since 5.5
-   */
-  @Deprecated
-  public CreateRequest setManualKey(String manualKey) {
-    this.manualKey = manualKey;
-    return this;
-  }
-
-  public String getManualKey() {
-    return manualKey;
-  }
-
   /**
    * This is a mandatory parameter.
    * Example value: "Description of my custom rule"
index 9765e85ed3f8272560ad69e02d96702217f736a9..9e0f771a90b1d614a67bfc1fcd6899d8fdb82b0b 100644 (file)
@@ -68,7 +68,6 @@ public class RulesService extends BaseService {
     call(
       new PostRequest(path("create"))
         .setParam("custom_key", request.getCustomKey())
-        .setParam("manual_key", request.getManualKey())
         .setParam("markdown_description", request.getMarkdownDescription())
         .setParam("name", request.getName())
         .setParam("params", request.getParams() == null ? null : request.getParams().stream().collect(Collectors.joining(",")))
@@ -204,10 +203,6 @@ public class RulesService extends BaseService {
   public void update(UpdateRequest request) {
     call(
       new PostRequest(path("update"))
-        .setParam("debt_remediation_fn_offset", request.getDebtRemediationFnOffset())
-        .setParam("debt_remediation_fn_type", request.getDebtRemediationFnType())
-        .setParam("debt_remediation_fy_coeff", request.getDebtRemediationFyCoeff())
-        .setParam("debt_sub_characteristic", request.getDebtSubCharacteristic())
         .setParam("key", request.getKey())
         .setParam("markdown_description", request.getMarkdownDescription())
         .setParam("markdown_note", request.getMarkdownNote())
index bb36c8fbc36e91637cd6f288012a2923e93057a6..c741af1eaccbea4f43fbc28b5becd0c59a1e6b3e 100644 (file)
@@ -31,10 +31,6 @@ import javax.annotation.Generated;
 @Generated("sonar-ws-generator")
 public class UpdateRequest {
 
-  private String debtRemediationFnOffset;
-  private String debtRemediationFnType;
-  private String debtRemediationFyCoeff;
-  private String debtSubCharacteristic;
   private String key;
   private String markdownDescription;
   private String markdownNote;
@@ -48,64 +44,6 @@ public class UpdateRequest {
   private String status;
   private List<String> tags;
 
-  /**
-   * @deprecated since 5.5
-   */
-  @Deprecated
-  public UpdateRequest setDebtRemediationFnOffset(String debtRemediationFnOffset) {
-    this.debtRemediationFnOffset = debtRemediationFnOffset;
-    return this;
-  }
-
-  public String getDebtRemediationFnOffset() {
-    return debtRemediationFnOffset;
-  }
-
-  /**
-   * Possible values:
-   * <ul>
-   *   <li>"LINEAR"</li>
-   *   <li>"LINEAR_OFFSET"</li>
-   *   <li>"CONSTANT_ISSUE"</li>
-   * </ul>
-   * @deprecated since 5.5
-   */
-  @Deprecated
-  public UpdateRequest setDebtRemediationFnType(String debtRemediationFnType) {
-    this.debtRemediationFnType = debtRemediationFnType;
-    return this;
-  }
-
-  public String getDebtRemediationFnType() {
-    return debtRemediationFnType;
-  }
-
-  /**
-   * @deprecated since 5.5
-   */
-  @Deprecated
-  public UpdateRequest setDebtRemediationFyCoeff(String debtRemediationFyCoeff) {
-    this.debtRemediationFyCoeff = debtRemediationFyCoeff;
-    return this;
-  }
-
-  public String getDebtRemediationFyCoeff() {
-    return debtRemediationFyCoeff;
-  }
-
-  /**
-   * @deprecated since 5.5
-   */
-  @Deprecated
-  public UpdateRequest setDebtSubCharacteristic(String debtSubCharacteristic) {
-    this.debtSubCharacteristic = debtSubCharacteristic;
-    return this;
-  }
-
-  public String getDebtSubCharacteristic() {
-    return debtSubCharacteristic;
-  }
-
   /**
    * This is a mandatory parameter.
    * Example value: "javascript:NullCheck"
index e3cfead6dae58075762bf8032d9242a19879f9bb..3b206b526e2eb4812fdc3e08b9e7d70a3af97dc2 100644 (file)
@@ -31,36 +31,10 @@ import javax.annotation.Generated;
 @Generated("sonar-ws-generator")
 public class SearchRequest {
 
-  private List<String> f;
   private String p;
   private String ps;
   private String q;
 
-  /**
-   * Possible values:
-   * <ul>
-   *   <li>"name"</li>
-   *   <li>"email"</li>
-   *   <li>"avatart"</li>
-   *   <li>"scmAccounts"</li>
-   *   <li>"groups"</li>
-   *   <li>"active"</li>
-   *   <li>"local"</li>
-   *   <li>"externalIdentity"</li>
-   *   <li>"externalProvider"</li>
-   * </ul>
-   * @deprecated since 5.4
-   */
-  @Deprecated
-  public SearchRequest setF(List<String> f) {
-    this.f = f;
-    return this;
-  }
-
-  public List<String> getF() {
-    return f;
-  }
-
   /**
    * Example value: "42"
    */
index dcbda8e2c2b68544982292069947830e93e54727..c96a7aa4930ec3f46947844bef18980ed578cc6a 100644 (file)
@@ -149,7 +149,6 @@ public class UsersService extends BaseService {
   public SearchWsResponse search(SearchRequest request) {
     return call(
       new GetRequest(path("search"))
-        .setParam("f", request.getF() == null ? null : request.getF().stream().collect(Collectors.joining(",")))
         .setParam("p", request.getP())
         .setParam("ps", request.getPs())
         .setParam("q", request.getQ()),