Search in sources :

Example 1 with JiraTicketsReport

use of com.checkmarx.flow.dto.report.JiraTicketsReport in project cx-flow by checkmarx-ltd.

the class JiraAnalyticsOpenIssueViaCommandLineSteps method validateAnalyticsJsonFile.

@Then("a matching ticket creation data should be recorded in the analytics json file")
public void validateAnalyticsJsonFile() throws CheckmarxException {
    List<String> currentNewIssuesList = jiraService.getCurrentNewIssuesList();
    JiraTicketsReport jiraTicketsReport = (JiraTicketsReport) jsonLoggerTestUtils.getReportNode(JiraTicketsReport.OPERATION, JiraTicketsReport.class);
    HashMap<String, List<String>> jiraTickets = jiraTicketsReport.getJiraTickets();
    int totalNewTickets = jiraTickets.get(JIRA_NEW_STATE).size();
    Assert.assertEquals("Expected to find 1 new JIRA opened ticket record on analytics logs , but found different count: " + totalNewTickets, 1, totalNewTickets);
    Assert.assertEquals("Actual JIRA new ticket's project key on analytics logs is different from expected", jiraService.getCurrentNewIssuesList(), jiraTickets.get(JIRA_NEW_STATE));
}
Also used : List(java.util.List) JiraTicketsReport(com.checkmarx.flow.dto.report.JiraTicketsReport) Then(io.cucumber.java.en.Then)

Example 2 with JiraTicketsReport

use of com.checkmarx.flow.dto.report.JiraTicketsReport in project cx-flow by checkmarx-ltd.

the class JiraAnalyticsUpdateIssueViaCommandLineSteps method validateAnalyticsJsonFile.

@Then("a matching ticket updating data should be recorded in the analytics json file")
public void validateAnalyticsJsonFile() throws CheckmarxException {
    JiraTicketsReport jiraTicketsReport = (JiraTicketsReport) jsonLoggerTestUtils.getReportNode(JiraTicketsReport.OPERATION, JiraTicketsReport.class);
    HashMap<String, List<String>> jiraTickets = jiraTicketsReport.getJiraTickets();
    int totalUpdatedTickets = jiraTickets.get(JIRA_UPDATED_STATE).size();
    int totalClosedTickets = jiraTickets.get(JIRA_CLOSED_STATE).size();
    Assert.assertEquals("Expected to find 1 new JIRA updated ticket record on analytics logs , but found different count: " + totalUpdatedTickets, 1, totalUpdatedTickets);
    Assert.assertEquals("Actual JIRA updated ticket's project key on analytics logs is different from expected", jiraService.getCurrentUpdatedIssuesList(), jiraTickets.get(JIRA_UPDATED_STATE));
    Assert.assertEquals("Expected to find 1 new JIRA closed ticket record on analytics logs , but found different count: " + totalClosedTickets, 1, totalClosedTickets);
    Assert.assertEquals("Actual JIRA closed ticket's project key on analytics logs is different from expected", jiraService.getCurrentClosedIssuesList(), jiraTickets.get(JIRA_CLOSED_STATE));
}
Also used : List(java.util.List) JiraTicketsReport(com.checkmarx.flow.dto.report.JiraTicketsReport) Then(io.cucumber.java.en.Then)

Aggregations

JiraTicketsReport (com.checkmarx.flow.dto.report.JiraTicketsReport)2 Then (io.cucumber.java.en.Then)2 List (java.util.List)2