aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2013-06-04 19:18:54 +0200
committerJulien Lancelot <julien.lancelot@gmail.com>2013-06-04 19:18:54 +0200
commit5ef18dfd1e5214b276fbb9912cb0ce9e8ae44e0c (patch)
tree46401ff5733f009a92a6bce6d9c953f3e70a574e /sonar-core
parent9b81a46f6d32355444ad89293275e8b42a86f991 (diff)
downloadsonarqube-5ef18dfd1e5214b276fbb9912cb0ce9e8ae44e0c.tar.gz
sonarqube-5ef18dfd1e5214b276fbb9912cb0ce9e8ae44e0c.zip
Fix unit test
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueQueryResultTest.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueQueryResultTest.java b/sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueQueryResultTest.java
index 85dcf9ba163..7f442ea19a7 100644
--- a/sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueQueryResultTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueQueryResultTest.java
@@ -26,13 +26,21 @@ import org.sonar.api.issue.internal.DefaultIssue;
import java.util.Arrays;
import java.util.Collections;
+import static com.google.common.collect.Lists.newArrayList;
import static org.fest.assertions.Assertions.assertThat;
public class DefaultIssueQueryResultTest {
+
+ @Test(expected = IllegalArgumentException.class)
+ public void should_first_throw_exception_if_no_issue() {
+ DefaultIssueQueryResult result = new DefaultIssueQueryResult(Collections.<Issue>emptyList());
+ result.first();
+ }
+
@Test
public void test_first_issue() {
- DefaultIssueQueryResult result = new DefaultIssueQueryResult(Collections.<Issue>emptyList());
- assertThat(result.first()).isNull();
+ DefaultIssueQueryResult result = new DefaultIssueQueryResult(newArrayList((Issue) new DefaultIssue()));
+ assertThat(result.first()).isNotNull();
Issue first = new DefaultIssue();
Issue second = new DefaultIssue();