diff options
author | Godin <mandrikov@gmail.com> | 2010-11-01 16:12:30 +0000 |
---|---|---|
committer | Godin <mandrikov@gmail.com> | 2010-11-01 16:12:30 +0000 |
commit | 4d5ed597d80f8e0a070b52e1c673d14e3597e9e8 (patch) | |
tree | 4f1cf7237b19f47ef50991093e3c1fe47edce2f3 /sonar-ws-client/src/test | |
parent | d4d455365c5d08ede8c5b5c81b8afbb57e70ffb5 (diff) | |
download | sonarqube-4d5ed597d80f8e0a070b52e1c673d14e3597e9e8.tar.gz sonarqube-4d5ed597d80f8e0a070b52e1c673d14e3597e9e8.zip |
SONAR-1897: Add web service to get information about installed plugins
Diffstat (limited to 'sonar-ws-client/src/test')
-rw-r--r-- | sonar-ws-client/src/test/java/org/sonar/wsclient/services/PluginQueryTest.java | 16 | ||||
-rw-r--r-- | sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/PluginUnmarshallerTest.java | 22 |
2 files changed, 38 insertions, 0 deletions
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 new file mode 100644 index 00000000000..49d226852ee --- /dev/null +++ b/sonar-ws-client/src/test/java/org/sonar/wsclient/services/PluginQueryTest.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 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/unmarshallers/PluginUnmarshallerTest.java b/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/PluginUnmarshallerTest.java new file mode 100644 index 00000000000..615407b15b1 --- /dev/null +++ b/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/PluginUnmarshallerTest.java @@ -0,0 +1,22 @@ +package org.sonar.wsclient.unmarshallers; + +import org.junit.Test; +import org.sonar.wsclient.services.Plugin; + +import java.util.List; + +import static org.hamcrest.core.Is.is; +import static org.junit.Assert.assertThat; + +public class PluginUnmarshallerTest { + + @Test + public void toModel() throws Exception { + List<Plugin> plugins = new PluginUnmarshaller().toModels("[{\"key\": \"foo\", \"name\": \"Foo\", \"version\": \"1.0\"}]"); + Plugin plugin = plugins.get(0); + assertThat(plugin.getKey(), is("foo")); + assertThat(plugin.getName(), is("Foo")); + assertThat(plugin.getVersion(), is("1.0")); + } + +} |