From f70d66864fa36a37c0fe04f0f6bdcb72c71dbf8f Mon Sep 17 00:00:00 2001 From: Surya Sashank Nistala Date: Tue, 24 Sep 2024 12:57:49 -0700 Subject: [PATCH] add verification that empty index scan is handled gracefully Signed-off-by: Surya Sashank Nistala --- .../resthandler/ThreatIntelMonitorRestApiIT.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/opensearch/securityanalytics/resthandler/ThreatIntelMonitorRestApiIT.java b/src/test/java/org/opensearch/securityanalytics/resthandler/ThreatIntelMonitorRestApiIT.java index 960115254..1f2dd7838 100644 --- a/src/test/java/org/opensearch/securityanalytics/resthandler/ThreatIntelMonitorRestApiIT.java +++ b/src/test/java/org/opensearch/securityanalytics/resthandler/ThreatIntelMonitorRestApiIT.java @@ -141,6 +141,8 @@ public void testCreateThreatIntelMonitor_monitorAliases() throws IOException { final String monitorId = responseBody.get("id").toString(); Assert.assertNotEquals("response is missing Id", Monitor.NO_ID, monitorId); + Response executeResponse = executeAlertingMonitor(monitorId, Collections.emptyMap()); + Assert.assertEquals(200, executeResponse.getStatusLine().getStatusCode()); Response alertingMonitorResponse = getAlertingMonitor(client(), monitorId); Assert.assertEquals(200, alertingMonitorResponse.getStatusLine().getStatusCode()); @@ -154,7 +156,7 @@ public void testCreateThreatIntelMonitor_monitorAliases() throws IOException { } } - Response executeResponse = executeAlertingMonitor(monitorId, Collections.emptyMap()); + executeResponse = executeAlertingMonitor(monitorId, Collections.emptyMap()); Map executeResults = entityAsMap(executeResponse); String matchAllRequest = getMatchAllRequest();