diff options
author | Julien Lancelot <julien.lancelot@gmail.com> | 2013-07-01 13:06:38 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@gmail.com> | 2013-07-01 13:06:38 +0200 |
commit | cd6d6438f4c587e578b3cbdb221067b8938e1df4 (patch) | |
tree | e34e0da12a51d72f04de7f63117dd8cc64087c96 /sonar-ws-client | |
parent | 9eae51614a193b9777685d3728f4cb737477466b (diff) | |
download | sonarqube-cd6d6438f4c587e578b3cbdb221067b8938e1df4.tar.gz sonarqube-cd6d6438f4c587e578b3cbdb221067b8938e1df4.zip |
Fix issue in properties WS that was returning all properties instead of one
Diffstat (limited to 'sonar-ws-client')
-rw-r--r-- | sonar-ws-client/src/main/java/org/sonar/wsclient/services/PropertyQuery.java | 4 | ||||
-rw-r--r-- | sonar-ws-client/src/test/java/org/sonar/wsclient/services/PropertyQueryTest.java | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/PropertyQuery.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/PropertyQuery.java index 3fee1d82af9..5e2abc4547f 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/PropertyQuery.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/PropertyQuery.java @@ -46,10 +46,10 @@ public class PropertyQuery extends Query<Property> { @Override public String getUrl() { StringBuilder url = new StringBuilder(BASE_URL); - url.append('?'); if (key != null) { - url.append("id=").append(encode(key)).append("&"); + url.append("/").append(encode(key)); } + url.append('?'); appendUrlParameter(url, "resource", resourceKeyOrId); return url.toString(); } diff --git a/sonar-ws-client/src/test/java/org/sonar/wsclient/services/PropertyQueryTest.java b/sonar-ws-client/src/test/java/org/sonar/wsclient/services/PropertyQueryTest.java index 52d51e16154..fef66ec4658 100644 --- a/sonar-ws-client/src/test/java/org/sonar/wsclient/services/PropertyQueryTest.java +++ b/sonar-ws-client/src/test/java/org/sonar/wsclient/services/PropertyQueryTest.java @@ -43,14 +43,14 @@ public class PropertyQueryTest extends QueryTestCase { @Test public void test_global_property() { PropertyQuery query = PropertyQuery.createForKey("myprop"); - assertThat(query.getUrl(), is("/api/properties?id=myprop&")); + assertThat(query.getUrl(), is("/api/properties/myprop?")); assertThat(query.getModelClass().getName(), is(Property.class.getName())); } @Test public void test_project_property() { PropertyQuery query = PropertyQuery.createForResource("myprop", "my:resource"); - assertThat(query.getUrl(), is("/api/properties?id=myprop&resource=my%3Aresource&")); + assertThat(query.getUrl(), is("/api/properties/myprop?resource=my%3Aresource&")); assertThat(query.getModelClass().getName(), is(Property.class.getName())); } } |