use of org.apache.syncope.common.lib.report.AuditReportletConf in project syncope by apache.
the class ReportITCase method auditReport.
@Test
public void auditReport() throws IOException {
AuditLoggerName auditLoggerName = new AuditLoggerName(AuditElements.EventCategoryType.LOGIC, "UserLogic", null, "selfRead", AuditElements.Result.SUCCESS);
try {
LoggerTO loggerTO = new LoggerTO();
loggerTO.setKey(auditLoggerName.toLoggerName());
loggerTO.setLevel(LoggerLevel.DEBUG);
loggerService.update(LoggerType.AUDIT, loggerTO);
ImplementationTO auditReportlet = new ImplementationTO();
auditReportlet.setKey("UserReportletConf" + getUUIDString());
auditReportlet.setEngine(ImplementationEngine.JAVA);
auditReportlet.setType(ImplementationType.REPORTLET);
auditReportlet.setBody(POJOHelper.serialize(new AuditReportletConf("auditReportlet" + getUUIDString())));
Response response = implementationService.create(auditReportlet);
auditReportlet.setKey(response.getHeaderString(RESTHeaders.RESOURCE_KEY));
ReportTO report = new ReportTO();
report.setName("auditReport" + getUUIDString());
report.setActive(true);
report.getReportlets().add(auditReportlet.getKey());
report.setTemplate("sample");
report = createReport(report);
String execKey = execReport(report.getKey());
checkExport(execKey, ReportExecExportFormat.XML);
report = reportService.read(report.getKey());
assertNotNull(report.getLastExec());
} finally {
loggerService.delete(LoggerType.AUDIT, auditLoggerName.toLoggerName());
}
}
Aggregations