Skip to content

Commit ea0c431

Browse files
committed
[Test] Fix RenameProcessorTests.testRenameExistingFieldNullValue() (#29655)
This test fails when the new field name already exists in the ingest document.
1 parent d6c217b commit ea0c431

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/RenameProcessorTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public void testRenameExistingFieldNullValue() throws Exception {
128128
IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random(), new HashMap<>());
129129
String fieldName = RandomDocumentPicks.randomFieldName(random());
130130
ingestDocument.setFieldValue(fieldName, null);
131-
String newFieldName = RandomDocumentPicks.randomFieldName(random());
131+
String newFieldName = randomValueOtherThanMany(ingestDocument::hasField, () -> RandomDocumentPicks.randomFieldName(random()));
132132
Processor processor = new RenameProcessor(randomAlphaOfLength(10), fieldName, newFieldName, false);
133133
processor.execute(ingestDocument);
134134
assertThat(ingestDocument.hasField(fieldName), equalTo(false));

0 commit comments

Comments
 (0)