aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws-client
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2010-11-05 15:16:21 +0000
committersimonbrandhof <simon.brandhof@gmail.com>2010-11-05 15:16:21 +0000
commitfeec99a308549901f0ad927e0d7a88956444cd9f (patch)
tree62bba08897d60f2a51503d7f543c0685334ee6e7 /sonar-ws-client
parent35c9e60c985300140cf1a3899f85a537e519a9cc (diff)
downloadsonarqube-feec99a308549901f0ad927e0d7a88956444cd9f.tar.gz
sonarqube-feec99a308549901f0ad927e0d7a88956444cd9f.zip
SONAR-1897 URL /api/plugins conflicts with existing web service extension point. Rename to /api/updatecenter/installed_plugins
Diffstat (limited to 'sonar-ws-client')
-rw-r--r--sonar-ws-client/src/main/java/org/sonar/wsclient/services/PluginQuery.java19
-rw-r--r--sonar-ws-client/src/main/java/org/sonar/wsclient/services/UpdateCenterQuery.java29
-rw-r--r--sonar-ws-client/src/test/java/org/sonar/wsclient/services/PluginQueryTest.java16
-rw-r--r--sonar-ws-client/src/test/java/org/sonar/wsclient/services/UpdateCenterQueryTest.java16
4 files changed, 45 insertions, 35 deletions
diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/PluginQuery.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/PluginQuery.java
deleted file mode 100644
index 6ba030cf03c..00000000000
--- a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/PluginQuery.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.sonar.wsclient.services;
-
-/**
- * @since 2.4
- */
-public class PluginQuery extends Query<Plugin> {
-
- public static final String BASE_URL = "/api/plugins";
-
- @Override
- public Class<Plugin> getModelClass() {
- return Plugin.class;
- }
-
- @Override
- public String getUrl() {
- return BASE_URL;
- }
-}
diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/UpdateCenterQuery.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/UpdateCenterQuery.java
new file mode 100644
index 00000000000..f25bd86ebc7
--- /dev/null
+++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/UpdateCenterQuery.java
@@ -0,0 +1,29 @@
+package org.sonar.wsclient.services;
+
+/**
+ * @since 2.4
+ */
+public class UpdateCenterQuery extends Query<Plugin> {
+
+ public static final String BASE_URL = "/api/updatecenter/";
+ private String action;
+
+ private UpdateCenterQuery(String action) {
+ this.action = action;
+ }
+
+ @Override
+ public Class<Plugin> getModelClass() {
+ return Plugin.class;
+ }
+
+ @Override
+ public String getUrl() {
+ return BASE_URL + action;
+ }
+
+ public static UpdateCenterQuery createForInstalledPlugins() {
+ return new UpdateCenterQuery("installed_plugins");
+ }
+
+}
diff --git a/sonar-ws-client/src/test/java/org/sonar/wsclient/services/PluginQueryTest.java b/sonar-ws-client/src/test/java/org/sonar/wsclient/services/PluginQueryTest.java
deleted file mode 100644
index 49d226852ee..00000000000
--- a/sonar-ws-client/src/test/java/org/sonar/wsclient/services/PluginQueryTest.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package org.sonar.wsclient.services;
-
-import org.junit.Test;
-
-import static org.hamcrest.Matchers.is;
-import static org.junit.Assert.assertThat;
-
-public class PluginQueryTest {
-
- @Test
- public void index() {
- PluginQuery query = new PluginQuery();
- assertThat(query.getUrl(), is("/api/plugins"));
- }
-
-}
diff --git a/sonar-ws-client/src/test/java/org/sonar/wsclient/services/UpdateCenterQueryTest.java b/sonar-ws-client/src/test/java/org/sonar/wsclient/services/UpdateCenterQueryTest.java
new file mode 100644
index 00000000000..a7be24f929d
--- /dev/null
+++ b/sonar-ws-client/src/test/java/org/sonar/wsclient/services/UpdateCenterQueryTest.java
@@ -0,0 +1,16 @@
+package org.sonar.wsclient.services;
+
+import org.junit.Test;
+
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertThat;
+
+public class UpdateCenterQueryTest {
+
+ @Test
+ public void index() {
+ UpdateCenterQuery query = UpdateCenterQuery.createForInstalledPlugins();
+ assertThat(query.getUrl(), is("/api/updatecenter/installed_plugins"));
+ }
+
+}