From 1f6a6958150484a5a0dc766b4d794f6ae4bb839a Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Thu, 5 May 2011 15:09:34 +0200 Subject: [PATCH] SONAR-2381 Fix error in Review WS client --- .../src/main/java/org/sonar/wsclient/services/ReviewQuery.java | 2 +- .../test/java/org/sonar/wsclient/services/ReviewQueryTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ReviewQuery.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ReviewQuery.java index 38c3780ce2d..5914e4d3de1 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ReviewQuery.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ReviewQuery.java @@ -230,7 +230,7 @@ public class ReviewQuery extends Query { } public static ReviewQuery createForResource(Resource resource) { - return new ReviewQuery().setId(new Long(resource.getId())); + return new ReviewQuery().setResourceKeysOrIds(resource.getId().toString()); } } diff --git a/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ReviewQueryTest.java b/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ReviewQueryTest.java index bf692cbbcb5..c347fac60b3 100644 --- a/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ReviewQueryTest.java +++ b/sonar-ws-client/src/test/java/org/sonar/wsclient/services/ReviewQueryTest.java @@ -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())); } -- 2.39.5