Watcher: Fix BasicSecurityTests.testWatcherMonitorRole
The test tried to create a watches index, that could have been
created by the test infrastructure already (to check if aliases
are supported).
relates elastic/x-pack-elasticsearch#837
Original commit: elastic/x-pack-elasticsearch@29714b23686cea245ba36d77cd699461ad0760c6
@@ -58,7 +58,9 @@ public class BasicSecurityTests extends AbstractWatcherIntegrationTestCase {
}
public void testWatcherMonitorRole() throws Exception {
+ 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()));
