aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-server-common/src/test/java
diff options
context:
space:
mode:
authorlukasz-jarocki-sonarsource <lukasz.jarocki@sonarsource.com>2024-01-15 16:43:15 +0100
committersonartech <sonartech@sonarsource.com>2024-01-17 20:02:44 +0000
commitc40c7ea750aabb7ba3e3c4b3c152269358604f1e (patch)
treeed0ecdcffda65da1b7333608305117cc1417c230 /server/sonar-server-common/src/test/java
parentb7d3feab70f86ccd3264f3fe63bf2608ef94beee (diff)
downloadsonarqube-c40c7ea750aabb7ba3e3c4b3c152269358604f1e.tar.gz
sonarqube-c40c7ea750aabb7ba3e3c4b3c152269358604f1e.zip
SONAR-21259 allowing number of issues that will be fixed to be greater than 500 in api/issues/search
Diffstat (limited to 'server/sonar-server-common/src/test/java')
-rw-r--r--server/sonar-server-common/src/test/java/org/sonar/server/issue/SearchRequestTest.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/server/sonar-server-common/src/test/java/org/sonar/server/issue/SearchRequestTest.java b/server/sonar-server-common/src/test/java/org/sonar/server/issue/SearchRequestTest.java
index 6295ee9fd06..be5b755ffb1 100644
--- a/server/sonar-server-common/src/test/java/org/sonar/server/issue/SearchRequestTest.java
+++ b/server/sonar-server-common/src/test/java/org/sonar/server/issue/SearchRequestTest.java
@@ -25,6 +25,7 @@ import org.junit.Test;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
public class SearchRequestTest {
@@ -104,4 +105,13 @@ public class SearchRequestTest {
assertThat(underTest.getScopes()).isNull();
}
+
+ @Test
+ public void setIssues_whenSizeOfTheListIsGreaterThan500_throwException() {
+ List<String> issues = asList(new String[501]);
+ SearchRequest underTest = new SearchRequest();
+ assertThatThrownBy(() -> underTest.setIssues(issues))
+ .isInstanceOf(IllegalArgumentException.class)
+ .hasMessage("Number of issue keys must be less than 500 (got 501)");
+ }
}