From 1ea94dda89a93422864023ecd22b273ccd7de26b Mon Sep 17 00:00:00 2001 From: Michal Duda Date: Fri, 19 Feb 2021 16:31:29 +0100 Subject: [PATCH] SONAR-13848 remove deprecated api/favourites/index WS --- .../sonar/server/favorite/FavoriteModule.java | 1 - .../server/favorite/ws/FavoriteWsModule.java | 1 - .../server/favorite/ws/FavouritesWs.java | 41 ------------------- .../favorite/ws/FavoriteWsModuleTest.java | 2 +- 4 files changed, 1 insertion(+), 44 deletions(-) delete mode 100644 server/sonar-webserver-webapi/src/main/java/org/sonar/server/favorite/ws/FavouritesWs.java diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/favorite/FavoriteModule.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/favorite/FavoriteModule.java index 038286b2e99..97602119a7f 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/favorite/FavoriteModule.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/favorite/FavoriteModule.java @@ -28,7 +28,6 @@ public class FavoriteModule extends Module { add( FavoriteFinder.class, FavoriteUpdater.class - ); } diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/favorite/ws/FavoriteWsModule.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/favorite/ws/FavoriteWsModule.java index 8dc5bcb4327..a259de306af 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/favorite/ws/FavoriteWsModule.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/favorite/ws/FavoriteWsModule.java @@ -25,7 +25,6 @@ public class FavoriteWsModule extends Module { @Override protected void configureModule() { add( - FavouritesWs.class, FavoritesWs.class, AddAction.class, RemoveAction.class, diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/favorite/ws/FavouritesWs.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/favorite/ws/FavouritesWs.java deleted file mode 100644 index ea80d18ea29..00000000000 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/favorite/ws/FavouritesWs.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 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.favorite.ws; - -import org.sonar.api.server.ws.WebService; -import org.sonar.server.ws.RemovedWebServiceHandler; - -public class FavouritesWs implements WebService { - - @Override - public void define(Context context) { - NewController controller = context.createController("api/favourites") - .setDescription("Removed since 6.3, please use api/favorites instead") - .setSince("2.6"); - controller.createAction("index") - .setDescription("The web service is removed and you're invited to use api/favorites instead") - .setSince("2.6") - .setDeprecatedSince("6.3") - .setHandler(RemovedWebServiceHandler.INSTANCE) - .setResponseExample(RemovedWebServiceHandler.INSTANCE.getResponseExample()); - controller.done(); - } - -} diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/favorite/ws/FavoriteWsModuleTest.java b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/favorite/ws/FavoriteWsModuleTest.java index 1642fd6c961..2b6c053f0be 100644 --- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/favorite/ws/FavoriteWsModuleTest.java +++ b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/favorite/ws/FavoriteWsModuleTest.java @@ -30,7 +30,7 @@ public class FavoriteWsModuleTest { public void verify_count_of_added_components() { ComponentContainer container = new ComponentContainer(); new FavoriteWsModule().configure(container); - assertThat(container.size()).isEqualTo(COMPONENTS_IN_EMPTY_COMPONENT_CONTAINER + 5); + assertThat(container.size()).isEqualTo(COMPONENTS_IN_EMPTY_COMPONENT_CONTAINER + 4); } -- 2.39.5