Skip to content

Commit

Permalink
Update MapperTestCase.java
Browse files Browse the repository at this point in the history
  • Loading branch information
kkrik-es authored Oct 9, 2024
1 parent 2b87e43 commit 2c313dd
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1586,7 +1586,7 @@ public void testSyntheticSourceKeepArrays() throws IOException {
b.endObject();
}));

int elementCount = randomIntBetween(1, 5);
int elementCount = randomIntBetween(2, 5);
CheckedConsumer<XContentBuilder, IOException> buildInput = (XContentBuilder builder) -> {
example.buildInputArray(builder, elementCount);
};
Expand All @@ -1597,10 +1597,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
Expand Down

0 comments on commit 2c313dd

Please sign in to comment.