From 5abc879c5664d1095b86c049e7e058acab522ecd Mon Sep 17 00:00:00 2001 From: Kostas Krikellas Date: Wed, 9 Oct 2024 13:08:53 +0300 Subject: [PATCH] update --- .../org/elasticsearch/index/mapper/MapperTestCase.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperTestCase.java b/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperTestCase.java index 7de8a85a51f9c..d8298d49d3ebc 100644 --- a/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperTestCase.java @@ -1570,7 +1570,7 @@ public void testSyntheticSourceKeepArrays() throws IOException { b.endObject(); })); - int elementCount = randomIntBetween(1, 5); + int elementCount = randomIntBetween(2, 5); CheckedConsumer buildInput = (XContentBuilder builder) -> { example.buildInputArray(builder, elementCount); }; @@ -1581,10 +1581,7 @@ public void testSyntheticSourceKeepArrays() throws IOException { builder.endObject(); String expected = Strings.toString(builder); String actual = syntheticSource(mapperAll, buildInput); - // Check for single-element array, the array source is not stored in this case. - if (actual.contains("[") && expected.replace("[", "").replace("]", "").equals(actual) == false) { - assertThat(actual, equalTo(expected)); - } + assertThat(actual, equalTo(expected)); } @Override