Skip to content

Commit

Permalink
Fix failing test in EsqlSecurityIT
Browse files Browse the repository at this point in the history
  • Loading branch information
quux00 committed Sep 11, 2024
1 parent 28c1c5c commit 7ca990c
Showing 1 changed file with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,11 @@ public void testAllowedIndices() throws Exception {
Response resp = runESQLCommand(user, "from index-user1 | stats sum=sum(value)");
assertOK(resp);
Map<String, Object> responseMap = entityAsMap(resp);
MapMatcher matcher = responseMatcher().entry("took", ((Integer) responseMap.get("took")).intValue())
.entry("columns", List.of(Map.of("name", "sum", "type", "double")))
MapMatcher mapMatcher = responseMatcher();
if (responseMap.get("took") != null) {
mapMatcher = mapMatcher.entry("took", ((Integer)responseMap.get("took")).intValue());
}
MapMatcher matcher = mapMatcher.entry("columns", List.of(Map.of("name", "sum", "type", "double")))
.entry("values", List.of(List.of(43.0d)));
assertMap(responseMap, matcher);
}
Expand All @@ -160,8 +163,11 @@ public void testAllowedIndices() throws Exception {
Response resp = runESQLCommand(user, "from index-user2 | stats sum=sum(value)");
assertOK(resp);
Map<String, Object> responseMap = entityAsMap(resp);
MapMatcher matcher = responseMatcher().entry("took", ((Integer) responseMap.get("took")).intValue())
.entry("columns", List.of(Map.of("name", "sum", "type", "double")))
MapMatcher mapMatcher = responseMatcher();
if (responseMap.get("took") != null) {
mapMatcher = mapMatcher.entry("took", ((Integer)responseMap.get("took")).intValue());
}
MapMatcher matcher = mapMatcher.entry("columns", List.of(Map.of("name", "sum", "type", "double")))
.entry("values", List.of(List.of(72.0d)));
assertMap(responseMap, matcher);
}
Expand All @@ -170,8 +176,11 @@ public void testAllowedIndices() throws Exception {
Response resp = runESQLCommand("metadata1_read2", "from " + index + " | stats sum=sum(value)");
assertOK(resp);
Map<String, Object> responseMap = entityAsMap(resp);
MapMatcher matcher = responseMatcher().entry("took", ((Integer) responseMap.get("took")).intValue())
.entry("columns", List.of(Map.of("name", "sum", "type", "double")))
MapMatcher mapMatcher = responseMatcher();
if (responseMap.get("took") != null) {
mapMatcher = mapMatcher.entry("took", ((Integer)responseMap.get("took")).intValue());
}
MapMatcher matcher = mapMatcher.entry("columns", List.of(Map.of("name", "sum", "type", "double")))
.entry("values", List.of(List.of(72.0d)));
assertMap(responseMap, matcher);
}
Expand Down

0 comments on commit 7ca990c

Please sign in to comment.