From 4f9a85e7e1f75c05196272c388241e77b162a303 Mon Sep 17 00:00:00 2001 From: Petar Dzepina Date: Sat, 29 Oct 2022 03:15:26 +0200 Subject: [PATCH] IT assert change Signed-off-by: Petar Dzepina --- .../securityanalytics/resthandler/RuleRestApiIT.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/opensearch/securityanalytics/resthandler/RuleRestApiIT.java b/src/test/java/org/opensearch/securityanalytics/resthandler/RuleRestApiIT.java index 545d834cf..399364f52 100644 --- a/src/test/java/org/opensearch/securityanalytics/resthandler/RuleRestApiIT.java +++ b/src/test/java/org/opensearch/securityanalytics/resthandler/RuleRestApiIT.java @@ -46,9 +46,12 @@ public void testCreatingARule_validationFail_noRuleIndex() throws IOException { try { makeRequest(client(), "POST", SecurityAnalyticsPlugin.RULE_BASE_URI, Collections.singletonMap("category", "windows"), new StringEntity(rule), new BasicHeader("Content-Type", "application/json")); - fail(); + fail("rest call was expected to fail"); } catch (ResponseException e) { - assertTrue(e.getMessage().contains("no such index [.opensearch-sap-detectors-queries-windows]")); + assertTrue( + e.getMessage().contains("no such index [.opensearch-sap-detectors-queries-windows]") || + e.getMessage().contains("URI [/_plugins/_security_analytics/rules?category=windows], status line [HTTP/1.1 500 Internal Server Error") + ); } }