diff --git a/plugin/src/test/java/org/elasticsearch/xpack/security/authc/esnative/NativeRealmIntegTests.java b/plugin/src/test/java/org/elasticsearch/xpack/security/authc/esnative/NativeRealmIntegTests.java index 44fdff501b9..97f3f162061 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/security/authc/esnative/NativeRealmIntegTests.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/security/authc/esnative/NativeRealmIntegTests.java @@ -101,10 +101,11 @@ public class NativeRealmIntegTests extends NativeRealmIntegTestCase { } } - @AwaitsFix(bugUrl = "https://github.com/elastic/x-pack-elasticsearch/pull/1507") public void testDeletingNonexistingUserAndRole() throws Exception { SecurityClient c = securityClient(); - DeleteUserResponse resp = c.prepareDeleteUser("joe").get(); + // first create the index so it exists + c.preparePutUser("joe", "s3kirt".toCharArray(), "role1", "user").get(); + DeleteUserResponse resp = c.prepareDeleteUser("missing").get(); assertFalse("user shouldn't be found", resp.found()); DeleteRoleResponse resp2 = c.prepareDeleteRole("role").get(); assertFalse("role shouldn't be found", resp2.found()); diff --git a/plugin/src/test/java/org/elasticsearch/xpack/security/authz/WriteActionsTests.java b/plugin/src/test/java/org/elasticsearch/xpack/security/authz/WriteActionsTests.java index dd28702f6dc..6afaa3e1d2c 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/security/authz/WriteActionsTests.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/security/authz/WriteActionsTests.java @@ -14,6 +14,7 @@ import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.update.UpdateAction; import org.elasticsearch.action.update.UpdateRequest; import org.elasticsearch.client.Requests; +import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.engine.DocumentMissingException; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.test.SecurityIntegTestCase; @@ -54,7 +55,6 @@ public class WriteActionsTests extends SecurityIntegTestCase { BulkAction.NAME + "[s]"); } - @AwaitsFix(bugUrl = "https://github.com/elastic/x-pack-elasticsearch/issues/1511") public void testDelete() { createIndex("test1", "index1"); client().prepareIndex("test1", "type", "id").setSource("field", "value").get(); @@ -62,9 +62,7 @@ public class WriteActionsTests extends SecurityIntegTestCase { assertThrowsAuthorizationExceptionDefaultUsers(client().prepareDelete("index1", "type", "id")::get, BulkAction.NAME + "[s]"); - assertEquals(RestStatus.NOT_FOUND, client().prepareDelete("test4", "type", "id").get().status()); - - assertThrowsAuthorizationExceptionDefaultUsers(client().prepareDelete("missing", "type", "id")::get, BulkAction.NAME + "[s]"); + expectThrows(IndexNotFoundException.class, () -> client().prepareDelete("test4", "type", "id").get()); } public void testUpdate() {