aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws-client/src/test
diff options
context:
space:
mode:
authorEvgeny Mandrikov <mandrikov@gmail.com>2011-06-28 14:07:42 +0400
committerEvgeny Mandrikov <mandrikov@gmail.com>2011-06-28 19:22:48 +0400
commit6eabbf7ffb16a904cd288590dd9b13ba37d660c0 (patch)
tree71bb45306114b11f7f4c9be0100dc871d7ca1288 /sonar-ws-client/src/test
parent4e1655566e26035164f644b0a933e7c0e7891436 (diff)
downloadsonarqube-6eabbf7ffb16a904cd288590dd9b13ba37d660c0.tar.gz
sonarqube-6eabbf7ffb16a904cd288590dd9b13ba37d660c0.zip
SONAR-2453,SONAR-2404 Allow search for reviews by resolutions
Diffstat (limited to 'sonar-ws-client/src/test')
-rw-r--r--sonar-ws-client/src/test/java/org/sonar/wsclient/services/ReviewQueryTest.java28
1 files changed, 22 insertions, 6 deletions
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 ddb58c41d83..18fec4bc693 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
@@ -29,7 +29,7 @@ import org.junit.Test;
public class ReviewQueryTest extends QueryTestCase {
@Test
- public void testSimpleQueryForResource() {
+ public void queryForResource() {
Resource resource = mock(Resource.class);
when(resource.getId()).thenReturn(69);
ReviewQuery query = ReviewQuery.createForResource(resource);
@@ -38,14 +38,30 @@ public class ReviewQueryTest extends QueryTestCase {
}
@Test
+ public void queryById() {
+ assertThat(new ReviewQuery().setId(13L).getUrl(), is("/api/reviews?id=13&"));
+ assertThat(new ReviewQuery().setIds(10L, 11L).getUrl(), is("/api/reviews?ids=10,11&"));
+ }
+
+ @Test
+ public void queryByResolution() {
+ ReviewQuery query = new ReviewQuery().setStatuses("RESOLVED").setResolutions("FALSE-POSITIVE");
+ assertThat(query.getUrl(), is("/api/reviews?statuses=RESOLVED&resolutions=FALSE-POSITIVE&"));
+ }
+
+ @Test
public void resourceTreeViolations() {
- ReviewQuery query = new ReviewQuery();
- query.setIds(10L, 11L).setStatuses("OPEN").setSeverities("MINOR", "INFO").setProjectKeysOrIds("com.sonar.foo:bar")
- .setResourceKeysOrIds("2", "3").setAuthorLoginsOrIds("20").setAssigneeLoginsOrIds("admin").setOutput("html")
- .setFalsePositives("without");
+ ReviewQuery query = new ReviewQuery()
+ .setStatuses("OPEN")
+ .setSeverities("MINOR", "INFO")
+ .setProjectKeysOrIds("com.sonar.foo:bar")
+ .setResourceKeysOrIds("2", "3")
+ .setAuthorLoginsOrIds("20")
+ .setAssigneeLoginsOrIds("admin")
+ .setOutput("html");
assertThat(
query.getUrl(),
- is("/api/reviews?ids=10,11&statuses=OPEN&severities=MINOR,INFO&projects=com.sonar.foo%3Abar&resources=2,3&authors=20&assignees=admin&output=html&false_positives=without&"));
+ is("/api/reviews?statuses=OPEN&severities=MINOR,INFO&projects=com.sonar.foo%3Abar&resources=2,3&authors=20&assignees=admin&output=html&"));
}
@Test