diff --git a/src/test/java/org/opensearch/ad/rest/SecureADRestIT.java b/src/test/java/org/opensearch/ad/rest/SecureADRestIT.java index 2f1da2c30..401ed4630 100644 --- a/src/test/java/org/opensearch/ad/rest/SecureADRestIT.java +++ b/src/test/java/org/opensearch/ad/rest/SecureADRestIT.java @@ -408,7 +408,9 @@ public void testCreateAnomalyDetectorWithCustomResultIndex() throws IOException Assert .assertTrue( "got " + exception.getMessage(), - exception.getMessage().contains("no permissions for [indices:admin/aliases, indices:admin/create]") + exception.getMessage().contains("indices:admin/aliases") + && exception.getMessage().contains("indices:admin/create") + && exception.getMessage().contains("no permissions for") ); // User cat has permission to create index