File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
modules/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -550,23 +550,21 @@ public void testDatabaseNotReadyYet() throws Exception {
550550 config .put ("field" , "source_field" );
551551 config .put ("database_file" , "GeoLite2-City.mmdb" );
552552
553- Map <String , Object > document = new HashMap <>();
554- document .put ("source_field" , "89.160.20.128" );
555- IngestDocument ingestDocument = RandomDocumentPicks .randomIngestDocument (random (), document );
556-
557553 GeoIpProcessor .DatabaseUnavailableProcessor processor = (GeoIpProcessor .DatabaseUnavailableProcessor ) factory .create (
558554 null ,
559555 null ,
560556 null ,
561557 config ,
562558 null
563559 );
564- processor .execute (ingestDocument );
565- assertThat (ingestDocument .getSourceAndMetadata ().get ("geoip" ), nullValue ());
566- assertThat (
567- ingestDocument .getSourceAndMetadata ().get ("tags" ),
568- equalTo (List .of ("_geoip_database_unavailable_GeoLite2-City.mmdb" ))
569- );
560+
561+ IngestDocument document ;
562+ {
563+ document = RandomDocumentPicks .randomIngestDocument (random (), new HashMap <>(Map .of ("source_field" , "89.160.20.128" )));
564+ processor .execute (document );
565+ assertThat (document .getSourceAndMetadata ().get ("geoip" ), nullValue ());
566+ assertThat (document .getSourceAndMetadata ().get ("tags" ), equalTo (List .of ("_geoip_database_unavailable_GeoLite2-City.mmdb" )));
567+ }
570568 }
571569
572570 copyDatabase ("GeoLite2-City-Test.mmdb" , geoipTmpDir );
You can’t perform that action at this time.
0 commit comments