@@ -180,6 +180,23 @@ public void testAppendingToListWithDuplicatesDisallowed() throws Exception {
180180 assertThat (fieldValue , containsInAnyOrder (expectedValues .toArray ()));
181181 }
182182
183+ public void testCopyFromOtherFieldSimple () throws Exception {
184+ IngestDocument ingestDocument = RandomDocumentPicks .randomIngestDocument (random ());
185+ ingestDocument .setFieldValue ("foo" , 1 );
186+ ingestDocument .setFieldValue ("bar" , 2 );
187+ ingestDocument .setFieldValue ("baz" , new ArrayList <>(List .of (3 )));
188+
189+ createAppendProcessor ("bar" , null , "foo" , false ).execute (ingestDocument );
190+ createAppendProcessor ("baz" , null , "bar" , false ).execute (ingestDocument );
191+ createAppendProcessor ("quux" , null , "baz" , false ).execute (ingestDocument );
192+
193+ Map <String , Object > result = ingestDocument .getCtxMap ().getSource ();
194+ assertThat (result .get ("foo" ), equalTo (1 ));
195+ assertThat (result .get ("bar" ), equalTo (List .of (2 , 1 )));
196+ assertThat (result .get ("baz" ), equalTo (List .of (3 , 2 , 1 )));
197+ assertThat (result .get ("quux" ), equalTo (List .of (3 , 2 , 1 )));
198+ }
199+
183200 public void testCopyFromOtherField () throws Exception {
184201 IngestDocument ingestDocument = RandomDocumentPicks .randomIngestDocument (random ());
185202
0 commit comments