Skip to content

Commit

Permalink
Merge pull request #1 from sbcd90/feature-findingsAPIenhancements
Browse files Browse the repository at this point in the history
fix integ tests for findings
  • Loading branch information
riysaxen-amzn authored Mar 11, 2024
2 parents 8a7c3d8 + e4e1214 commit e967376
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, Object> 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 {
Expand Down Expand Up @@ -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<String, Object> 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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit e967376

Please sign in to comment.