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 eef7fc4e50080..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 (expected.replace("[", "").replace("]", "").equals(actual) == false) { - assertThat(actual, equalTo(expected)); - } + assertThat(actual, equalTo(expected)); } @Override