From c40c7ea750aabb7ba3e3c4b3c152269358604f1e Mon Sep 17 00:00:00 2001 From: lukasz-jarocki-sonarsource Date: Mon, 15 Jan 2024 16:43:15 +0100 Subject: SONAR-21259 allowing number of issues that will be fixed to be greater than 500 in api/issues/search --- .../test/java/org/sonar/server/issue/SearchRequestTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'server/sonar-server-common/src/test/java') 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 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)"); + } } -- cgit v1.2.3