Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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());
}
Expand All @@ -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());
}
Expand Down Expand Up @@ -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 {
Expand Down