diff --git a/plugin/src/test/java/org/elasticsearch/xpack/watcher/security/BasicSecurityTests.java b/plugin/src/test/java/org/elasticsearch/xpack/watcher/security/BasicSecurityTests.java index 8a9f68fc361..b42e5b96314 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/watcher/security/BasicSecurityTests.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/watcher/security/BasicSecurityTests.java @@ -58,7 +58,9 @@ public class BasicSecurityTests extends AbstractWatcherIntegrationTestCase { } public void testWatcherMonitorRole() throws Exception { - assertAcked(client().admin().indices().prepareCreate(Watch.INDEX)); + if (client().admin().indices().prepareExists(Watch.INDEX).get().isExists() == false) { + assertAcked(client().admin().indices().prepareCreate(Watch.INDEX)); + } // stats and get watch apis require at least monitor role: String token = basicAuthHeaderValue("test", new SecuredString("changeme".toCharArray()));