aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws-client
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2013-07-01 13:06:38 +0200
committerJulien Lancelot <julien.lancelot@gmail.com>2013-07-01 13:06:38 +0200
commitcd6d6438f4c587e578b3cbdb221067b8938e1df4 (patch)
treee34e0da12a51d72f04de7f63117dd8cc64087c96 /sonar-ws-client
parent9eae51614a193b9777685d3728f4cb737477466b (diff)
downloadsonarqube-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.java4
-rw-r--r--sonar-ws-client/src/test/java/org/sonar/wsclient/services/PropertyQueryTest.java4
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()));
}
}