Search in sources :

Example 1 with AuditLogType

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);
}
Also used : AuditLogType(eu.europa.ec.fisheries.schema.audit.v1.AuditLogType) ListCriteria(eu.europa.ec.fisheries.schema.audit.search.v1.ListCriteria) AssetListCriteria(eu.europa.ec.fisheries.wsdl.asset.types.AssetListCriteria)

Aggregations

ListCriteria (eu.europa.ec.fisheries.schema.audit.search.v1.ListCriteria)1 AuditLogType (eu.europa.ec.fisheries.schema.audit.v1.AuditLogType)1 AssetListCriteria (eu.europa.ec.fisheries.wsdl.asset.types.AssetListCriteria)1