Skip to content

Commit

Permalink
Integ test for geoip
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Kwok <[email protected]>
  • Loading branch information
andy-k-improving committed Jan 9, 2025
1 parent e68435f commit 153e62a
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,17 @@ public void testGeoIpEnrichment() {
rows("Test user - USA", "10.1.1.1"),
rows("Test user - Canada", "127.1.1.1"));

// JSONObject resultGeoIp = executeQuery(String.format("search source=%s", TEST_INDEX_GEOIP_REMOTE));
JSONObject resultGeoIp = executeQuery(
String.format("search source=%s | eval enrichmentResult = geoip(\\\"%s\\\",%s)",
TEST_INDEX_GEOIP_REMOTE, "dummycityindex", "ip"));

verifyColumn(resultGeoIp, columnName("name"), columnName("ip"), columnName("enrichmentResult"));
verifyDataRows(resultGeoIp,
rows("Test user - USA", "10.1.1.1", Map.of("country", "USA", "city", "Seattle")),
rows("Test user - Canada", "127.1.1.1", Map.of("country", "Canada", "city", "Vancouver")));

// Expected: iterable with items [[Test user - USA, 10.1.1.1, x], [Test user - Canada, 127.1.1.1, x]] in any order
// but: not matched: <["Test user - USA","10.1.1.1",{"country":"USA","city":"Seattle"}]>
}


Expand Down

0 comments on commit 153e62a

Please sign in to comment.