diff --git a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/AppendProcessorTests.java b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/AppendProcessorTests.java index e5afa5e1b18f4..8388e3b2229ef 100644 --- a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/AppendProcessorTests.java +++ b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/AppendProcessorTests.java @@ -34,6 +34,7 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.not; +import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.Matchers.sameInstance; public class AppendProcessorTests extends ESTestCase { @@ -84,7 +85,7 @@ public void testAppendValuesToNonExistingList() throws Exception { values.add(value); appendProcessor = createAppendProcessor(field, value, null, true, false); } else { - int valuesSize = randomIntBetween(0, 10); + int valuesSize = randomIntBetween(1, 10); for (int i = 0; i < valuesSize; i++) { values.add(scalar.randomValue()); } @@ -108,7 +109,7 @@ public void testConvertScalarToList() throws Exception { values.add(value); appendProcessor = createAppendProcessor(field, value, null, true, false); } else { - int valuesSize = randomIntBetween(0, 10); + int valuesSize = randomIntBetween(1, 10); for (int i = 0; i < valuesSize; i++) { values.add(scalar.randomValue()); } @@ -295,9 +296,13 @@ public void testAppendingToNonExistingListEmptyStringAndEmptyValuesDisallowed() appendProcessor = createAppendProcessor(field, allValues, null, true, true); } appendProcessor.execute(ingestDocument); - List list = ingestDocument.getFieldValue(field, List.class); + List list = ingestDocument.getFieldValue(field, List.class, true); assertThat(list, not(sameInstance(values))); - assertThat(list, equalTo(values)); + if (values.isEmpty()) { + assertThat(list, nullValue()); + } else { + assertThat(list, equalTo(values)); + } } public void testCopyFromOtherFieldSimple() throws Exception { diff --git a/muted-tests.yml b/muted-tests.yml index 927b38fd36bdf..42a6b0639cb15 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -588,15 +588,6 @@ tests: - class: org.elasticsearch.xpack.core.HealthApiFeatureSetUsageTests method: testEqualsAndHashcode issue: https://github.com/elastic/elasticsearch/issues/136648 -- class: org.elasticsearch.ingest.common.AppendProcessorTests - method: testAppendingToNonExistingListEmptyStringAndEmptyValuesDisallowed - issue: https://github.com/elastic/elasticsearch/issues/136657 -- class: org.elasticsearch.ingest.common.AppendProcessorTests - method: testAppendValuesToNonExistingList - issue: https://github.com/elastic/elasticsearch/issues/136662 -- class: org.elasticsearch.ingest.common.AppendProcessorTests - method: testConvertScalarToList - issue: https://github.com/elastic/elasticsearch/issues/136667 - class: org.elasticsearch.xpack.downsample.ILMDownsampleDisruptionIT method: testILMDownsampleRollingRestart issue: https://github.com/elastic/elasticsearch/issues/136585