aboutsummaryrefslogtreecommitdiffstats
path: root/it
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-11-18 08:11:09 +0100
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-11-18 08:11:09 +0100
commit678d27506f2c945273ce9703933d19ea79723a34 (patch)
treeaf3f8b821521679e0c2a5e5f9d9e54d845bf587c /it
parent01570a451806cce75fd66b9e02a4631d4ba5509e (diff)
downloadsonarqube-678d27506f2c945273ce9703933d19ea79723a34.tar.gz
sonarqube-678d27506f2c945273ce9703933d19ea79723a34.zip
SONAR-6947 api/issues/search use issue.SearchWsRequest
Diffstat (limited to 'it')
-rw-r--r--it/it-tests/src/test/java/it/issue/CommonRulesTest.java17
1 files changed, 14 insertions, 3 deletions
diff --git a/it/it-tests/src/test/java/it/issue/CommonRulesTest.java b/it/it-tests/src/test/java/it/issue/CommonRulesTest.java
index 074f32e2e85..fcd14f5061f 100644
--- a/it/it-tests/src/test/java/it/issue/CommonRulesTest.java
+++ b/it/it-tests/src/test/java/it/issue/CommonRulesTest.java
@@ -23,10 +23,13 @@ import com.sonar.orchestrator.locator.FileLocation;
import java.util.List;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.sonar.wsclient.issue.Issue;
-import org.sonar.wsclient.issue.IssueQuery;
+import org.sonarqube.ws.Issues.Issue;
+import org.sonarqube.ws.client.WsClient;
+import org.sonarqube.ws.client.issue.SearchWsRequest;
+import static java.util.Collections.singletonList;
import static org.assertj.core.api.Assertions.assertThat;
+import static util.ItUtils.newAdminWsClient;
import static util.ItUtils.runProjectAnalysis;
public class CommonRulesTest extends AbstractIssueTest {
@@ -34,6 +37,8 @@ public class CommonRulesTest extends AbstractIssueTest {
public static final String FILE_KEY = "common-rules-project:src/Sample.xoo";
public static final String TEST_FILE_KEY = "common-rules-project:test/SampleTest.xoo";
+ private static WsClient adminWsClient;
+
@BeforeClass
public static void setUp() {
ORCHESTRATOR.resetData();
@@ -43,6 +48,8 @@ public class CommonRulesTest extends AbstractIssueTest {
runProjectAnalysis(ORCHESTRATOR, "issue/common-rules",
"sonar.cpd.xoo.minimumTokens", "2",
"sonar.cpd.xoo.minimumLines", "2");
+
+ adminWsClient = newAdminWsClient(ORCHESTRATOR);
}
@Test
@@ -79,6 +86,10 @@ public class CommonRulesTest extends AbstractIssueTest {
}
private List<Issue> findIssues(String componentKey, String ruleKey) {
- return searchIssues(IssueQuery.create().components(componentKey).rules(ruleKey));
+ return adminWsClient.issuesWsClient().search(
+ new SearchWsRequest()
+ .setComponents(singletonList(componentKey))
+ .setRules(singletonList(ruleKey)))
+ .getIssuesList();
}
}