aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2016-11-25 16:01:22 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2016-11-28 12:22:39 +0100
commit7f7bb7cdb743413ad2180f7936f252dee671ace2 (patch)
treea3653d90a759f9f5ce7e42d028740af840bc7a24
parent19f395b89f54e4c0d7ae48582a3cf16fc24112a0 (diff)
downloadsonarqube-7f7bb7cdb743413ad2180f7936f252dee671ace2.tar.gz
sonarqube-7f7bb7cdb743413ad2180f7936f252dee671ace2.zip
Replace guava by java stream in IssueSearchTest
-rw-r--r--it/it-tests/src/test/java/it/issue/IssueSearchTest.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/it/it-tests/src/test/java/it/issue/IssueSearchTest.java b/it/it-tests/src/test/java/it/issue/IssueSearchTest.java
index 56e562bd2aa..2933fe0a56b 100644
--- a/it/it-tests/src/test/java/it/issue/IssueSearchTest.java
+++ b/it/it-tests/src/test/java/it/issue/IssueSearchTest.java
@@ -19,7 +19,6 @@
*/
package it.issue;
-import com.google.common.collect.Iterables;
import com.sonar.orchestrator.locator.FileLocation;
import java.io.IOException;
import java.text.SimpleDateFormat;
@@ -105,7 +104,7 @@ public class IssueSearchTest extends AbstractIssueTest {
public void search_issues_by_components() {
assertThat(
search(IssueQuery.create().components("com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo")).list())
- .hasSize(34);
+ .hasSize(34);
assertThat(search(IssueQuery.create().components("unknown")).list()).isEmpty();
}
@@ -321,8 +320,11 @@ public class IssueSearchTest extends AbstractIssueTest {
return newAdminWsClient(ORCHESTRATOR).issues().search(request);
}
- private static Component findComponent(Collection<Component> components, final String key) {
- return Iterables.find(components, input -> key.equals(input.key()));
+ private static Component findComponent(Collection<Component> components, String key) {
+ return components.stream()
+ .filter(input -> key.equals(input.key()))
+ .findFirst()
+ .orElseThrow(() -> new IllegalStateException("Component key not found: " + key));
}
}