From 47d83d37d84b5549d1e850097b4668d3751e7df3 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 25 May 2016 16:06:55 +0200 Subject: [PATCH] test: remove percolator asserts Original commit: elastic/x-pack-elasticsearch@52469798e260d51c0e5549aaf753ac6a0d05c226 --- .../integration/IndexPrivilegeTests.java | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/IndexPrivilegeTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/IndexPrivilegeTests.java index eb669f0e5d2..5519eea89fa 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/IndexPrivilegeTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/IndexPrivilegeTests.java @@ -405,50 +405,24 @@ public class IndexPrivilegeTests extends AbstractPrivilegeTestCase { assertAccessIsAllowed("admin", "GET", "/" + index + "/foo/1"); assertAccessIsAllowed(user, "GET", "/" + index + "/foo/1/_explain", "{ \"query\" : { \"match_all\" : {} } }"); assertAccessIsAllowed(user, "GET", "/" + index + "/foo/1/_termvector"); - try { - assertAccessIsAllowed(user, "GET", "/" + index + "/foo/_percolate", "{ \"doc\" : { \"foo\" : \"bar\" } }"); - } catch (Throwable e) { - assertThat(e.getMessage(), containsString("field [query] does not exist")); - } assertAccessIsAllowed(user, "GET", "/" + index + "/_suggest", "{ \"sgs\" : { \"text\" : \"foo\", \"term\" : { \"field\" : \"body\" } } }"); assertAccessIsAllowed(user, "GET", "/" + index + "/foo/_mget", "{ \"docs\" : [ { \"_id\": \"1\" }, { \"_id\": \"2\" } ] }"); assertAccessIsAllowed(user, "GET", "/" + index + "/foo/_mtermvectors", "{ \"docs\" : [ { \"_id\": \"1\" }, { \"_id\": \"2\" } ] }"); - - StringBuilder multiPercolate = - new StringBuilder("{\"percolate\" : {\"index\" : \"" + index + "\", \"type\" : \"foo\"}}\n"); - multiPercolate.append("{\"doc\" : {\"message\" : \"some text\"}}\n"); - multiPercolate.append("{\"percolate\" : {\"index\" : \"" + index + "\", \"type\" : \"foo\", \"id\" : \"1\"}}\n"); - multiPercolate.append("{}\n"); - try { - assertAccessIsAllowed(user, "GET", "/" + index + "/foo/_mpercolate", multiPercolate.toString()); - } catch (Throwable e) { - assertThat(e.getMessage(), containsString("field [query] does not exist")); - } - assertUserIsAllowed(user, "search", index); } else { assertAccessIsDenied(user, "GET", "/" + index + "/_count"); assertAccessIsDenied(user, "GET", "/" + index + "/_search"); assertAccessIsDenied(user, "GET", "/" + index + "/foo/1/_explain", "{ \"query\" : { \"match_all\" : {} } }"); assertAccessIsDenied(user, "GET", "/" + index + "/foo/1/_termvector"); - assertAccessIsDenied(user, "GET", "/" + index + "/foo/_percolate", "{ \"doc\" : { \"foo\" : \"bar\" } }"); assertAccessIsDenied(user, "GET", "/" + index + "/_suggest", "{ \"sgs\" : { \"text\" : \"foo\", \"term\" : { \"field\" : \"body\" } } }"); assertAccessIsDenied(user, "GET", "/" + index + "/foo/_mget", "{ \"docs\" : [ { \"_id\": \"1\" }, { \"_id\": \"2\" } ] }"); assertAccessIsDenied(user, "GET", "/" + index + "/foo/_mtermvectors", "{ \"docs\" : [ { \"_id\": \"1\" }, { \"_id\": \"2\" } ] }"); - - StringBuilder multiPercolate = - new StringBuilder("{\"percolate\" : {\"index\" : \"" + index + "\", \"type\" : \"foo\"}}\n"); - multiPercolate.append("{\"doc\" : {\"message\" : \"some text\"}}\n"); - multiPercolate.append("{\"percolate\" : {\"index\" : \"" + index + "\", \"type\" : \"foo\", \"id\" : \"1\"}}\n"); - multiPercolate.append("{}\n"); - assertAccessIsDenied(user, "GET", "/" + index + "/foo/_mpercolate", multiPercolate.toString()); - assertUserIsDenied(user, "search", index); } break;