@@ -276,7 +276,7 @@ public void testSortNullValue() throws Exception {
276276 }
277277
278278 public void testDescendingSortWithTargetField () throws Exception {
279- IngestDocument ingestDocument = RandomDocumentPicks .randomIngestDocument (random ());
279+ IngestDocument ingestDocument = RandomDocumentPicks .randomIngestDocument (random (), Collections . emptyMap () );
280280 int numItems = randomIntBetween (1 , 10 );
281281 List <String > fieldValue = new ArrayList <>(numItems );
282282 List <String > expectedResult = new ArrayList <>(numItems );
@@ -289,15 +289,15 @@ public void testDescendingSortWithTargetField() throws Exception {
289289 Collections .sort (expectedResult , Collections .reverseOrder ());
290290
291291 String fieldName = RandomDocumentPicks .addRandomField (random (), ingestDocument , fieldValue );
292- String targetFieldName = RandomDocumentPicks . randomFieldName ( random ()) ;
292+ String targetFieldName = fieldName + "foo" ;
293293 Processor processor = new SortProcessor (randomAlphaOfLength (10 ), fieldName ,
294294 SortOrder .DESCENDING , targetFieldName );
295295 processor .execute (ingestDocument );
296296 assertEquals (ingestDocument .getFieldValue (targetFieldName , List .class ), expectedResult );
297297 }
298298
299299 public void testAscendingSortWithTargetField () throws Exception {
300- IngestDocument ingestDocument = RandomDocumentPicks .randomIngestDocument (random ());
300+ IngestDocument ingestDocument = RandomDocumentPicks .randomIngestDocument (random (), Collections . emptyMap () );
301301 int numItems = randomIntBetween (1 , 10 );
302302 List <String > fieldValue = new ArrayList <>(numItems );
303303 List <String > expectedResult = new ArrayList <>(numItems );
@@ -310,15 +310,15 @@ public void testAscendingSortWithTargetField() throws Exception {
310310 Collections .sort (expectedResult );
311311
312312 String fieldName = RandomDocumentPicks .addRandomField (random (), ingestDocument , fieldValue );
313- String targetFieldName = RandomDocumentPicks . randomFieldName ( random ()) ;
313+ String targetFieldName = fieldName + "foo" ;
314314 Processor processor = new SortProcessor (randomAlphaOfLength (10 ), fieldName ,
315315 SortOrder .ASCENDING , targetFieldName );
316316 processor .execute (ingestDocument );
317317 assertEquals (ingestDocument .getFieldValue (targetFieldName , List .class ), expectedResult );
318318 }
319319
320320 public void testSortWithTargetFieldLeavesOriginalUntouched () throws Exception {
321- IngestDocument ingestDocument = RandomDocumentPicks .randomIngestDocument (random ());
321+ IngestDocument ingestDocument = RandomDocumentPicks .randomIngestDocument (random (), Collections . emptyMap () );
322322 List <Integer > fieldValue = Arrays .asList (1 , 5 , 4 );
323323 List <Integer > expectedResult = new ArrayList <>(fieldValue );
324324 Collections .sort (expectedResult );
0 commit comments