use of eu.bcvsolutions.idm.core.monitoring.service.impl.H2DatabaseMonitoringEvaluator in project CzechIdMng by bcvsolutions.
the class MonitoringReportExecutorIntegrationTest method testExecutor.
@Test
@Transactional
public void testExecutor() throws IOException {
IdmMonitoringDto monitoring = new IdmMonitoringDto();
monitoring.setCheckPeriod(0L);
monitoring.setEvaluatorType(AutowireHelper.getTargetType(h2DatabaseMonitoringEvaluator));
monitoring.setInstanceId(configurationService.getInstanceId());
monitoring = monitoringService.save(monitoring);
monitoringManager.execute(monitoring);
//
// generate report
RptReportDto report = reportExecutor.generate(new RptReportDto(UUID.randomUUID()));
Assert.assertNotNull(report.getData());
List<RptMonitoringResultDto> results = mapper.readValue(attachmentManager.getAttachmentData(report.getData()), new TypeReference<List<RptMonitoringResultDto>>() {
});
//
// test
Assert.assertFalse(results.isEmpty());
Assert.assertTrue(results.stream().anyMatch(r -> r.getEvaluatorType().equals(AutowireHelper.getTargetType(h2DatabaseMonitoringEvaluator))));
//
attachmentManager.deleteAttachments(report);
}
Aggregations