Skip to content

Commit

Permalink
Use JDK8 compatible string repetition
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Widdis <[email protected]>
  • Loading branch information
dbwiddis committed Sep 26, 2024
1 parent fabde0c commit f86d44e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import org.opensearch.test.OpenSearchIntegTestCase;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import static org.opensearch.search.aggregations.AggregationBuilders.terms;
Expand All @@ -58,7 +59,7 @@ public class AggregationsIntegrationIT extends OpenSearchIntegTestCase {

static int numDocs;

private static final String LARGE_STRING = "a".repeat(2000);
private static final String LARGE_STRING = String.join("", Collections.nCopies(2000, "a"));
private static final String LARGE_STRING_EXCEPTION_MESSAGE = "The length of regex ["
+ LARGE_STRING.length()
+ "] used in the request has exceeded the allowed maximum";
Expand Down

0 comments on commit f86d44e

Please sign in to comment.