Skip to content

Commit 70b5f20

Browse files
authored
Assert not null for databases field (#95497) (#95499)
1 parent 0df40fd commit 70b5f20

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

modules/ingest-geoip/src/yamlRestTest/java/org/elasticsearch/ingest/geoip/IngestGeoIpClientYamlTestSuiteIT.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
import static org.hamcrest.Matchers.containsInAnyOrder;
3737
import static org.hamcrest.Matchers.equalTo;
38+
import static org.hamcrest.Matchers.notNullValue;
3839

3940
public class IngestGeoIpClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
4041

@@ -79,10 +80,10 @@ public void waitForDatabases() throws Exception {
7980
Map<?, ?> nodes = (Map<?, ?>) response.get("nodes");
8081
assertThat(nodes.size(), equalTo(1));
8182
Map<?, ?> node = (Map<?, ?>) nodes.values().iterator().next();
82-
List<String> databases = ((List<?>) node.get("databases")).stream()
83-
.map(o -> (String) ((Map<?, ?>) o).get("name"))
84-
.collect(Collectors.toList());
85-
assertThat(databases, containsInAnyOrder("GeoLite2-City.mmdb", "GeoLite2-Country.mmdb", "GeoLite2-ASN.mmdb"));
83+
List<?> databases = ((List<?>) node.get("databases"));
84+
assertThat(databases, notNullValue());
85+
List<String> databaseNames = databases.stream().map(o -> (String) ((Map<?, ?>) o).get("name")).collect(Collectors.toList());
86+
assertThat(databaseNames, containsInAnyOrder("GeoLite2-City.mmdb", "GeoLite2-Country.mmdb", "GeoLite2-ASN.mmdb"));
8687
});
8788
}
8889

0 commit comments

Comments
 (0)