use of eu.europa.ec.fisheries.schema.audit.search.v1.AuditLogListQuery 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);
}
use of eu.europa.ec.fisheries.schema.audit.search.v1.AuditLogListQuery in project UVMS-Docker by UnionVMS.
the class AssetTestHelper method getAssetAuditLogListQuery.
private static AuditLogListQuery getAssetAuditLogListQuery(AuditObjectTypeEnum auditObjectType) {
AuditLogListQuery auditLogListQuery = AuditHelper.getBasicAuditLogListQuery();
ListCriteria typeListCriteria = new ListCriteria();
typeListCriteria.setKey(SearchKey.TYPE);
typeListCriteria.setValue(auditObjectType.getValue());
auditLogListQuery.getAuditSearchCriteria().add(typeListCriteria);
return auditLogListQuery;
}
use of eu.europa.ec.fisheries.schema.audit.search.v1.AuditLogListQuery in project UVMS-Docker by UnionVMS.
the class AuditHelper method getBasicAuditLogListQuery.
public static AuditLogListQuery getBasicAuditLogListQuery() {
AuditLogListQuery auditLogListQuery = new AuditLogListQuery();
ListPagination listPagination = new ListPagination();
listPagination.setPage(BigInteger.valueOf(1));
listPagination.setListSize(BigInteger.valueOf(500));
auditLogListQuery.setPagination(listPagination);
return auditLogListQuery;
}
use of eu.europa.ec.fisheries.schema.audit.search.v1.AuditLogListQuery in project UVMS-Docker by UnionVMS.
the class AssetTestHelper method assertAssetGroupAuditLogCreated.
public static void assertAssetGroupAuditLogCreated(String guid, AuditOperationEnum auditOperation, Date fromDate) throws Exception {
AuditLogListQuery auditLogListQuery = getAssetAuditLogListQuery(AuditObjectTypeEnum.ASSET_GROUP);
assertAuditLog(guid, auditOperation, auditLogListQuery, fromDate);
}
use of eu.europa.ec.fisheries.schema.audit.search.v1.AuditLogListQuery in project UVMS-Docker by UnionVMS.
the class AssetTestHelper method assertAssetAuditLogCreated.
// ************************************************
// Audit logs
// ************************************************
public static void assertAssetAuditLogCreated(String guid, AuditOperationEnum auditOperation, Date fromDate) throws Exception {
AuditLogListQuery auditLogListQuery = getAssetAuditLogListQuery(AuditObjectTypeEnum.ASSET);
assertAuditLog(guid, auditOperation, auditLogListQuery, fromDate);
}
Aggregations