From e4e1214205e0e38464ad3719b2f1e9c47425ba35 Mon Sep 17 00:00:00 2001 From: Subhobrata Dey Date: Mon, 11 Mar 2024 05:14:55 +0000 Subject: [PATCH] fix integ tests for findings Signed-off-by: Subhobrata Dey --- .../securityanalytics/findings/FindingIT.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/java/org/opensearch/securityanalytics/findings/FindingIT.java b/src/test/java/org/opensearch/securityanalytics/findings/FindingIT.java index 93711dd43..3e6da5ae0 100644 --- a/src/test/java/org/opensearch/securityanalytics/findings/FindingIT.java +++ b/src/test/java/org/opensearch/securityanalytics/findings/FindingIT.java @@ -592,13 +592,13 @@ public void testGetFindings_bySeverity_success() throws IOException { params.put("severity", "high"); Response getFindingsResponse = makeRequest(client(), "GET", SecurityAnalyticsPlugin.FINDINGS_BASE_URI + "/_search", params, null); Map getFindingsBody = entityAsMap(getFindingsResponse); - Assert.assertEquals(1, getFindingsBody.get("total_findings")); + Assert.assertEquals(2, getFindingsBody.get("total_findings")); // Call GetFindings API for second detector by severity params.clear(); params.put("severity", "critical"); getFindingsResponse = makeRequest(client(), "GET", SecurityAnalyticsPlugin.FINDINGS_BASE_URI + "/_search", params, null); getFindingsBody = entityAsMap(getFindingsResponse); - Assert.assertEquals(1, getFindingsBody.get("total_findings")); + Assert.assertEquals(2, getFindingsBody.get("total_findings")); } public void testGetFindings_bySearchString_success() throws IOException { @@ -712,13 +712,13 @@ public void testGetFindings_bySearchString_success() throws IOException { params.put("searchString", "high"); Response getFindingsResponse = makeRequest(client(), "GET", SecurityAnalyticsPlugin.FINDINGS_BASE_URI + "/_search", params, null); Map getFindingsBody = entityAsMap(getFindingsResponse); - Assert.assertEquals(1, getFindingsBody.get("total_findings")); + Assert.assertEquals(2, getFindingsBody.get("total_findings")); // Call GetFindings API for second detector by searchString 'critical' params.clear(); params.put("searchString", "critical"); getFindingsResponse = makeRequest(client(), "GET", SecurityAnalyticsPlugin.FINDINGS_BASE_URI + "/_search", params, null); getFindingsBody = entityAsMap(getFindingsResponse); - Assert.assertEquals(1, getFindingsBody.get("total_findings")); + Assert.assertEquals(2, getFindingsBody.get("total_findings")); } public void testGetFindings_byStartTimeAndEndTime_success() throws IOException { @@ -845,7 +845,7 @@ public void testGetFindings_byStartTimeAndEndTime_success() throws IOException { params.put("endTime", String.valueOf(endTime2.toEpochMilli())); getFindingsResponse = makeRequest(client(), "GET", SecurityAnalyticsPlugin.FINDINGS_BASE_URI + "/_search", params, null); getFindingsBody = entityAsMap(getFindingsResponse); - Assert.assertEquals(1, getFindingsBody.get("total_findings")); + Assert.assertEquals(2, getFindingsBody.get("total_findings")); } public void testGetFindings_rolloverByMaxAge_success() throws IOException, InterruptedException {