Search in sources :

Example 21 with InsightsAssessmentReportTemplate

use of com.cognizant.devops.platformdal.assessmentreport.InsightsAssessmentReportTemplate in project Insights by CognizantOneDevOps.

the class AssessmentReportServiceTest method testGrafanaPDFUpdateReportTemplate.

@Test(priority = 46)
public void testGrafanaPDFUpdateReportTemplate() throws InsightsCustomException {
    try {
        grafanaPDFreportTemplateJson.addProperty("reportId", grafanaReportId);
        int grafanaReportId = assessmentService.editReportTemplate(grafanaPDFreportTemplateJson);
        InsightsAssessmentReportTemplate report = (InsightsAssessmentReportTemplate) reportConfigDAL.getReportTemplateByReportId(grafanaReportId);
        assessmentReportDataInit();
        Assert.assertNotNull(report);
        Assert.assertTrue(report.getReportsKPIConfig().size() > 0);
        Assert.assertNotEquals(grafanaReportId, -1);
    } catch (AssertionError e) {
        Assert.fail(e.getMessage());
    }
}
Also used : InsightsAssessmentReportTemplate(com.cognizant.devops.platformdal.assessmentreport.InsightsAssessmentReportTemplate) Test(org.testng.annotations.Test)

Example 22 with InsightsAssessmentReportTemplate

use of com.cognizant.devops.platformdal.assessmentreport.InsightsAssessmentReportTemplate in project Insights by CognizantOneDevOps.

the class ReportTemplateKPIContentServiceTest method testSaveReportTemplate.

@Test(priority = 7)
public void testSaveReportTemplate() throws InsightsCustomException {
    try {
        int response = assessmentService.saveKpiDefinition(convertStringIntoJson(registerkpi));
        kpiIdList.add(response);
        reportId = assessmentService.saveTemplateReport(convertStringIntoJson(reportTemplateSave));
        InsightsAssessmentReportTemplate report = (InsightsAssessmentReportTemplate) reportConfigDAL.getReportTemplateByReportId(reportId);
        Assert.assertNotNull(report);
        Assert.assertTrue(report.getReportsKPIConfig().size() > 0);
    } catch (AssertionError e) {
        Assert.fail(e.getMessage());
    }
}
Also used : InsightsAssessmentReportTemplate(com.cognizant.devops.platformdal.assessmentreport.InsightsAssessmentReportTemplate) Test(org.testng.annotations.Test)

Example 23 with InsightsAssessmentReportTemplate

use of com.cognizant.devops.platformdal.assessmentreport.InsightsAssessmentReportTemplate in project Insights by CognizantOneDevOps.

the class ReportTemplateKPIContentServiceTest method testEditReportTemplate.

@Test(priority = 10)
public void testEditReportTemplate() throws InsightsCustomException {
    try {
        int response = assessmentService.saveKpiDefinition(convertStringIntoJson(registerSecondkpi));
        kpiIdList.add(response);
        editReportTemplate = editReportTemplate.replace("reportIdData", String.valueOf(reportId));
        log.debug(" editReportTemplate  {} ", editReportTemplate);
        reportId = assessmentService.editReportTemplate(convertStringIntoJson(editReportTemplate));
        InsightsAssessmentReportTemplate report = (InsightsAssessmentReportTemplate) reportConfigDAL.getReportTemplateByReportId(reportId);
        Assert.assertNotNull(report);
        Assert.assertTrue(report.getReportsKPIConfig().size() >= 2);
    } catch (AssertionError e) {
        Assert.fail(e.getMessage());
    }
}
Also used : InsightsAssessmentReportTemplate(com.cognizant.devops.platformdal.assessmentreport.InsightsAssessmentReportTemplate) Test(org.testng.annotations.Test)

Aggregations

InsightsAssessmentReportTemplate (com.cognizant.devops.platformdal.assessmentreport.InsightsAssessmentReportTemplate)23 InsightsCustomException (com.cognizant.devops.platformcommons.exception.InsightsCustomException)14 JsonObject (com.google.gson.JsonObject)11 IOException (java.io.IOException)10 JsonArray (com.google.gson.JsonArray)9 Test (org.testng.annotations.Test)9 InsightsWorkflowConfiguration (com.cognizant.devops.platformdal.workflow.InsightsWorkflowConfiguration)5 JsonElement (com.google.gson.JsonElement)5 NoResultException (javax.persistence.NoResultException)5 InsightsKPIConfig (com.cognizant.devops.platformdal.assessmentreport.InsightsKPIConfig)4 FileNotFoundException (java.io.FileNotFoundException)4 InsightsAssessmentConfiguration (com.cognizant.devops.platformdal.assessmentreport.InsightsAssessmentConfiguration)3 InsightsReportsKPIConfig (com.cognizant.devops.platformdal.assessmentreport.InsightsReportsKPIConfig)3 JsonIOException (com.google.gson.JsonIOException)3 JsonSyntaxException (com.google.gson.JsonSyntaxException)3 LinkedHashSet (java.util.LinkedHashSet)3 MultipartFile (org.springframework.web.multipart.MultipartFile)3 SkipException (org.testng.SkipException)3 InsightsReportTemplateConfigFiles (com.cognizant.devops.platformdal.assessmentreport.InsightsReportTemplateConfigFiles)2 FileInputStream (java.io.FileInputStream)2