Skip to content

Commit

Permalink
error msgs in ApiKeyAggsIT
Browse files Browse the repository at this point in the history
  • Loading branch information
albertzaharovits committed Jun 11, 2024
1 parent a2f17e8 commit 178e235
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,7 @@ public void testFiltersAggs() throws IOException {
""");
ResponseException exception = expectThrows(ResponseException.class, () -> client().performRequest(request));
assertThat(exception.getResponse().toString(), exception.getResponse().getStatusLine().getStatusCode(), is(400));
assertThat(
exception.getMessage(),
containsString("Field [api_key_invalidated] is not allowed for API Key query or aggregation")
);
assertThat(exception.getMessage(), containsString("Field [api_key_invalidated] is not allowed for querying or aggregation"));
}
{
Request request = new Request("GET", "/_security/_query/api_key" + (randomBoolean() ? "?typed_keys" : ""));
Expand Down Expand Up @@ -282,7 +279,7 @@ public void testFiltersAggs() throws IOException {
""");
ResponseException exception = expectThrows(ResponseException.class, () -> client().performRequest(request));
assertThat(exception.getResponse().toString(), exception.getResponse().getStatusLine().getStatusCode(), is(400));
assertThat(exception.getMessage(), containsString("Field [creator.realm] is not allowed for API Key query or aggregation"));
assertThat(exception.getMessage(), containsString("Field [creator.realm] is not allowed for querying or aggregation"));
}
}

Expand Down Expand Up @@ -418,7 +415,7 @@ public void testAggsForType() throws IOException {
""");
ResponseException exception = expectThrows(ResponseException.class, () -> client().performRequest(request));
assertThat(exception.getResponse().toString(), exception.getResponse().getStatusLine().getStatusCode(), is(400));
assertThat(exception.getMessage(), containsString("Field [runtime_key_type] is not allowed for API Key query or aggregation"));
assertThat(exception.getMessage(), containsString("Field [runtime_key_type] is not allowed for querying or aggregation"));
}
}

Expand Down Expand Up @@ -549,7 +546,7 @@ public void testFilterAggs() throws IOException {
""");
ResponseException exception = expectThrows(ResponseException.class, () -> client().performRequest(request));
assertThat(exception.getResponse().toString(), exception.getResponse().getStatusLine().getStatusCode(), is(400));
assertThat(exception.getMessage(), containsString("Field [creator] is not allowed for API Key query or aggregation"));
assertThat(exception.getMessage(), containsString("Field [creator] is not allowed for querying or aggregation"));
}
}

Expand Down

0 comments on commit 178e235

Please sign in to comment.