9
9
10
10
import co .elastic .logstash .filters .elasticintegration .util .IngestDocumentUtil ;
11
11
import co .elastic .logstash .filters .elasticintegration .util .ResourcesUtil ;
12
+ import org .elasticsearch .cluster .metadata .ProjectId ;
12
13
import org .elasticsearch .ingest .IngestDocument ;
13
14
import org .elasticsearch .ingest .Processor ;
14
15
import org .elasticsearch .ingest .geoip .GeoIpProcessor ;
@@ -35,16 +36,17 @@ class IpDatabaseProviderTest {
35
36
36
37
@ Test
37
38
void loadTestVendoredDatabases () throws Exception {
39
+
38
40
withVendoredGeoIpDatabaseProvider (geoIpDatabaseProvider -> {
39
41
assertAll ("Loaded databases all report valid" ,
40
- () -> assertThat (geoIpDatabaseProvider .isValid ("GeoLite2-ASN.mmdb" ), is (true )),
41
- () -> assertThat (geoIpDatabaseProvider .isValid ("GeoLite2-City.mmdb" ), is (true )),
42
- () -> assertThat (geoIpDatabaseProvider .isValid ("GeoLite2-Country.mmdb" ), is (true )));
42
+ () -> assertThat (geoIpDatabaseProvider .isValid (ProjectId . DEFAULT , "GeoLite2-ASN.mmdb" ), is (true )),
43
+ () -> assertThat (geoIpDatabaseProvider .isValid (ProjectId . DEFAULT , "GeoLite2-City.mmdb" ), is (true )),
44
+ () -> assertThat (geoIpDatabaseProvider .isValid (ProjectId . DEFAULT , "GeoLite2-Country.mmdb" ), is (true )));
43
45
44
46
assertAll ("Non-loaded databases all report invalid" ,
45
- () -> assertThat (geoIpDatabaseProvider .isValid ("GeoLite2-Global.mmdb" ), is (false )),
46
- () -> assertThat (geoIpDatabaseProvider .isValid ("Bananas.mmdb" ), is (false )),
47
- () -> assertThat (geoIpDatabaseProvider .isValid ("Intergalactic.mmdb" ), is (false )));
47
+ () -> assertThat (geoIpDatabaseProvider .isValid (ProjectId . DEFAULT , "GeoLite2-Global.mmdb" ), is (false )),
48
+ () -> assertThat (geoIpDatabaseProvider .isValid (ProjectId . DEFAULT , "Bananas.mmdb" ), is (false )),
49
+ () -> assertThat (geoIpDatabaseProvider .isValid (ProjectId . DEFAULT , "Intergalactic.mmdb" ), is (false )));
48
50
});
49
51
}
50
52
@@ -131,7 +133,7 @@ static void withVendoredGeoIpDatabaseProvider(final ExceptionalConsumer<IpDataba
131
133
}
132
134
133
135
static void withGeoipProcessor (final IpDatabaseProvider geoIpDatabaseProvider , Map <String , Object > config , ExceptionalConsumer <Processor > geoIpProcessorConsumer ) throws Exception {
134
- Processor processor = new GeoIpProcessor .Factory ("geoip" , geoIpDatabaseProvider ).create (Map .of (), null , null , config );
136
+ Processor processor = new GeoIpProcessor .Factory ("geoip" , geoIpDatabaseProvider ).create (Map .of (), null , null , config , null );
135
137
geoIpProcessorConsumer .accept (processor );
136
138
}
137
139
0 commit comments