use of eu.europa.ec.fisheries.schema.audit.v1.AuditLogType in project UVMS-Docker by UnionVMS.
the class AssetTestHelper method assertAuditLog.
private static void assertAuditLog(String guid, AuditOperationEnum auditOperation, AuditLogListQuery auditLogListQuery, Date fromDate) throws Exception {
ListCriteria typeListCriteria = new ListCriteria();
typeListCriteria.setKey(SearchKey.OPERATION);
typeListCriteria.setValue(auditOperation.getValue());
auditLogListQuery.getAuditSearchCriteria().add(typeListCriteria);
ListCriteria fromDateListCriteria = new ListCriteria();
fromDateListCriteria.setKey(SearchKey.FROM_DATE);
fromDateListCriteria.setValue(DateUtils.parseUTCDateToString(fromDate));
auditLogListQuery.getAuditSearchCriteria().add(fromDateListCriteria);
List<AuditLogType> auditLogs = AuditHelper.getAuditLogs(auditLogListQuery);
boolean found = false;
for (AuditLogType auditLogType : auditLogs) {
if (auditLogType.getAffectedObject().equals(guid)) {
found = true;
}
}
assertTrue(found);
}
Aggregations