Search in sources :

Example 1 with AuditLogListQuery

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);
}
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)

Example 2 with AuditLogListQuery

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

Example 3 with 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;
}
Also used : AuditLogListQuery(eu.europa.ec.fisheries.schema.audit.search.v1.AuditLogListQuery) ListPagination(eu.europa.ec.fisheries.schema.audit.search.v1.ListPagination)

Example 4 with 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);
}
Also used : AuditLogListQuery(eu.europa.ec.fisheries.schema.audit.search.v1.AuditLogListQuery)

Example 5 with AuditLogListQuery

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);
}
Also used : AuditLogListQuery(eu.europa.ec.fisheries.schema.audit.search.v1.AuditLogListQuery)

Aggregations

AuditLogListQuery (eu.europa.ec.fisheries.schema.audit.search.v1.AuditLogListQuery)5 ListCriteria (eu.europa.ec.fisheries.schema.audit.search.v1.ListCriteria)2 ListPagination (eu.europa.ec.fisheries.schema.audit.search.v1.ListPagination)2 AssetListCriteria (eu.europa.ec.fisheries.wsdl.asset.types.AssetListCriteria)2 AuditLogType (eu.europa.ec.fisheries.schema.audit.v1.AuditLogType)1 AbstractRestServiceTest (eu.europa.ec.fisheries.uvms.docker.validation.common.AbstractRestServiceTest)1 HttpResponse (org.apache.http.HttpResponse)1 Test (org.junit.Test)1