]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2381 Fix error in Review WS client
authorFabrice Bellingard <bellingard@gmail.com>
Thu, 5 May 2011 13:09:34 +0000 (15:09 +0200)
committerFabrice Bellingard <bellingard@gmail.com>
Thu, 5 May 2011 13:09:34 +0000 (15:09 +0200)
sonar-ws-client/src/main/java/org/sonar/wsclient/services/ReviewQuery.java
sonar-ws-client/src/test/java/org/sonar/wsclient/services/ReviewQueryTest.java

index 38c3780ce2d2aaa26b472d1b167ebdba6aa319fa..5914e4d3de1047a97d826c4402da21e12dca5fa9 100644 (file)
@@ -230,7 +230,7 @@ public class ReviewQuery extends Query<Review> {
   }
 
   public static ReviewQuery createForResource(Resource resource) {
-    return new ReviewQuery().setId(new Long(resource.getId()));
+    return new ReviewQuery().setResourceKeysOrIds(resource.getId().toString());
   }
 
 }
index bf692cbbcb51bd79a7096452611faf163946f361..c347fac60b3588e087a153f063fc35a10d8354fe 100644 (file)
@@ -33,7 +33,7 @@ public class ReviewQueryTest extends QueryTestCase {
     Resource resource = mock(Resource.class);
     when(resource.getId()).thenReturn(69);
     ReviewQuery query = ReviewQuery.createForResource(resource);
-    assertThat(query.getUrl(), is("/api/reviews?id=69&"));
+    assertThat(query.getUrl(), is("/api/reviews?resources=69&"));
     assertThat(query.getModelClass().getName(), is(Review.class.getName()));
   }