aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2017-01-30 12:45:33 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2017-01-30 13:26:36 +0100
commit37868d0d6f9c3360695f4ed908854cb2cc0235cb (patch)
treea9a78a3715a59b4d3afb02b0170346a8a4052769
parent4b09a1feb7756139c7516a49d2cb0d0937c1d0d4 (diff)
downloadsonarqube-37868d0d6f9c3360695f4ed908854cb2cc0235cb.tar.gz
sonarqube-37868d0d6f9c3360695f4ed908854cb2cc0235cb.zip
SONAR-7286 Add docs on removed api/favourites WS
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/favorite/FavoriteModule.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/favorite/ws/FavouritesWs.java41
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/favorite/FavoriteModuleTest.java2
3 files changed, 44 insertions, 1 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/favorite/FavoriteModule.java b/server/sonar-server/src/main/java/org/sonar/server/favorite/FavoriteModule.java
index 414aa027e69..642bfd3654f 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/favorite/FavoriteModule.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/favorite/FavoriteModule.java
@@ -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
index 00000000000..ccd38a8b3ca
--- /dev/null
+++ b/server/sonar-server/src/main/java/org/sonar/server/favorite/ws/FavouritesWs.java
@@ -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();
+ }
+
+}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/favorite/FavoriteModuleTest.java b/server/sonar-server/src/test/java/org/sonar/server/favorite/FavoriteModuleTest.java
index 64086da9ce7..63fb4728b77 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/favorite/FavoriteModuleTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/favorite/FavoriteModuleTest.java
@@ -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);
}
}