]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7286 Add docs on removed api/favourites WS 1577/head
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Mon, 30 Jan 2017 11:45:33 +0000 (12:45 +0100)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Mon, 30 Jan 2017 12:26:36 +0000 (13:26 +0100)
server/sonar-server/src/main/java/org/sonar/server/favorite/FavoriteModule.java
server/sonar-server/src/main/java/org/sonar/server/favorite/ws/FavouritesWs.java [new file with mode: 0644]
server/sonar-server/src/test/java/org/sonar/server/favorite/FavoriteModuleTest.java

index 414aa027e69bf73902e2033bb66366151ff9e807..642bfd3654f03122780237e896c0d0f8000808f8 100644 (file)
@@ -23,6 +23,7 @@ package org.sonar.server.favorite;
 import org.sonar.core.platform.Module;
 import org.sonar.server.favorite.ws.AddAction;
 import org.sonar.server.favorite.ws.FavoritesWs;
+import org.sonar.server.favorite.ws.FavouritesWs;
 import org.sonar.server.favorite.ws.RemoveAction;
 import org.sonar.server.favorite.ws.SearchAction;
 
@@ -31,6 +32,7 @@ public class FavoriteModule extends Module {
   @Override
   protected void configureModule() {
     add(
+      FavouritesWs.class,
       FavoriteFinder.class,
       FavoriteUpdater.class,
       FavoritesWs.class,
diff --git a/server/sonar-server/src/main/java/org/sonar/server/favorite/ws/FavouritesWs.java b/server/sonar-server/src/main/java/org/sonar/server/favorite/ws/FavouritesWs.java
new file mode 100644 (file)
index 0000000..ccd38a8
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact 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();
+  }
+
+}
index 64086da9ce75b1e1c758857b30b0aa1642fade61..63fb4728b772d0cabf5ea73b31da8d206a8b5511 100644 (file)
@@ -30,6 +30,6 @@ public class FavoriteModuleTest {
   public void verify_count_of_added_components() {
     ComponentContainer container = new ComponentContainer();
     new FavoriteModule().configure(container);
-    assertThat(container.size()).isEqualTo(6 + 2);
+    assertThat(container.size()).isEqualTo(7 + 2);
   }
 }