diff --git a/modules/ingest-geoip/src/yamlRestTest/java/org/elasticsearch/ingest/geoip/IngestGeoIpClientYamlTestSuiteIT.java b/modules/ingest-geoip/src/yamlRestTest/java/org/elasticsearch/ingest/geoip/IngestGeoIpClientYamlTestSuiteIT.java index b5cdf104e125c..6f2f15385d1de 100644 --- a/modules/ingest-geoip/src/yamlRestTest/java/org/elasticsearch/ingest/geoip/IngestGeoIpClientYamlTestSuiteIT.java +++ b/modules/ingest-geoip/src/yamlRestTest/java/org/elasticsearch/ingest/geoip/IngestGeoIpClientYamlTestSuiteIT.java @@ -35,6 +35,7 @@ import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.notNullValue; public class IngestGeoIpClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { @@ -79,10 +80,10 @@ public void waitForDatabases() throws Exception { Map nodes = (Map) response.get("nodes"); assertThat(nodes.size(), equalTo(1)); Map node = (Map) nodes.values().iterator().next(); - List databases = ((List) node.get("databases")).stream() - .map(o -> (String) ((Map) o).get("name")) - .collect(Collectors.toList()); - assertThat(databases, containsInAnyOrder("GeoLite2-City.mmdb", "GeoLite2-Country.mmdb", "GeoLite2-ASN.mmdb")); + List databases = ((List) node.get("databases")); + assertThat(databases, notNullValue()); + List databaseNames = databases.stream().map(o -> (String) ((Map) o).get("name")).collect(Collectors.toList()); + assertThat(databaseNames, containsInAnyOrder("GeoLite2-City.mmdb", "GeoLite2-Country.mmdb", "GeoLite2-ASN.mmdb")); }); }