Search in sources :

Example 1 with ListPagination

use of eu.europa.ec.fisheries.schema.movement.search.v1.ListPagination in project UVMS-Docker by UnionVMS.

the class RulesTicketRestIT method getTicketListTest.

/**
 * Gets the ticket list test.
 *
 * @return the ticket list test
 * @throws Exception the exception
 */
@Test
public void getTicketListTest() throws Exception {
    TicketQuery ticketQuery = new TicketQuery();
    ListPagination listPagination = new ListPagination();
    listPagination.setListSize(100);
    listPagination.setPage(1);
    ticketQuery.setPagination(listPagination);
    TicketListCriteria ticketListCriteria = new TicketListCriteria();
    ticketListCriteria.setKey(TicketSearchKey.STATUS);
    ticketListCriteria.setValue("Open");
    ticketQuery.getTicketSearchCriteria().add(ticketListCriteria);
    final HttpResponse response = Request.Post(getBaseUrl() + "rules/rest/tickets/list/" + URLEncoder.encode("vms_admin_com")).setHeader("Content-Type", "application/json").setHeader("Authorization", getValidJwtToken()).bodyByteArray(writeValueAsString(ticketQuery).getBytes()).execute().returnResponse();
    Map<String, Object> dataMap = checkSuccessResponseReturnMap(response);
}
Also used : ListPagination(eu.europa.ec.fisheries.schema.rules.search.v1.ListPagination) HttpResponse(org.apache.http.HttpResponse) TicketQuery(eu.europa.ec.fisheries.schema.rules.search.v1.TicketQuery) TicketListCriteria(eu.europa.ec.fisheries.schema.rules.search.v1.TicketListCriteria) Test(org.junit.Test) AbstractRestServiceTest(eu.europa.ec.fisheries.uvms.docker.validation.common.AbstractRestServiceTest)

Example 2 with ListPagination

use of eu.europa.ec.fisheries.schema.movement.search.v1.ListPagination in project UVMS-Docker by UnionVMS.

the class PollRestIT method getPollableChannelsTest.

/**
 * Gets the pollable channels test.
 *
 * @return the pollable channels test
 * @throws Exception
 *             the exception
 */
@Test
public void getPollableChannelsTest() throws Exception {
    PollableQuery pollableQuery = new PollableQuery();
    ListPagination listPagination = new ListPagination();
    listPagination.setListSize(100);
    listPagination.setPage(1);
    pollableQuery.setPagination(listPagination);
    pollableQuery.getConnectIdList().add("connectId");
    final HttpResponse response = Request.Post(getBaseUrl() + "mobileterminal/rest/poll/pollable").setHeader("Content-Type", "application/json").setHeader("Authorization", getValidJwtToken()).bodyByteArray(writeValueAsString(pollableQuery).getBytes()).execute().returnResponse();
    Map<String, Object> dataMap = checkSuccessResponseReturnMap(response);
}
Also used : ListPagination(eu.europa.ec.fisheries.schema.mobileterminal.types.v1.ListPagination) PollableQuery(eu.europa.ec.fisheries.schema.mobileterminal.polltypes.v1.PollableQuery) HttpResponse(org.apache.http.HttpResponse) Test(org.junit.Test)

Example 3 with ListPagination

use of eu.europa.ec.fisheries.schema.movement.search.v1.ListPagination 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 ListPagination

use of eu.europa.ec.fisheries.schema.movement.search.v1.ListPagination in project UVMS-Docker by UnionVMS.

the class PollRestIT method getPollBySearchCriteriaTest.

/**
 * Gets the poll by search criteria test.
 *
 * @return the poll by search criteria test
 * @throws Exception
 *             the exception
 */
@Test
public void getPollBySearchCriteriaTest() throws Exception {
    PollListQuery pollListQuery = new PollListQuery();
    ListPagination pagination = new ListPagination();
    pollListQuery.setPagination(pagination);
    pagination.setListSize(100);
    pagination.setPage(1);
    PollSearchCriteria pollSearchCriteria = new PollSearchCriteria();
    pollListQuery.setPollSearchCriteria(pollSearchCriteria);
    pollSearchCriteria.setIsDynamic(true);
    final HttpResponse response = Request.Post(getBaseUrl() + "mobileterminal/rest/poll/list").setHeader("Content-Type", "application/json").setHeader("Authorization", getValidJwtToken()).bodyByteArray(writeValueAsString(pollListQuery).getBytes()).execute().returnResponse();
    Map<String, Object> dataMap = checkSuccessResponseReturnMap(response);
}
Also used : ListPagination(eu.europa.ec.fisheries.schema.mobileterminal.types.v1.ListPagination) PollSearchCriteria(eu.europa.ec.fisheries.schema.mobileterminal.polltypes.v1.PollSearchCriteria) HttpResponse(org.apache.http.HttpResponse) PollListQuery(eu.europa.ec.fisheries.schema.mobileterminal.polltypes.v1.PollListQuery) Test(org.junit.Test)

Example 5 with ListPagination

use of eu.europa.ec.fisheries.schema.movement.search.v1.ListPagination in project UVMS-Docker by UnionVMS.

the class MovementMovementRestIT method createMovementQueryNumberOfLatestReports.

/**
 * Creates the movement query number of latest reports.
 *
 * @param numberPositions the number positions
 * @return the movement query
 */
private MovementQuery createMovementQueryNumberOfLatestReports(int numberPositions) {
    MovementQuery movementQuery = new MovementQuery();
    movementQuery.setExcludeFirstAndLastSegment(false);
    ListPagination listPagination = new ListPagination();
    listPagination.setListSize(BigInteger.valueOf(1000000));
    listPagination.setPage(BigInteger.valueOf(1));
    movementQuery.setPagination(listPagination);
    ListCriteria listCriteria = new ListCriteria();
    listCriteria.setKey(SearchKey.NR_OF_LATEST_REPORTS);
    listCriteria.setValue("" + numberPositions);
    movementQuery.getMovementSearchCriteria().add(listCriteria);
    RangeCriteria rangeCriteria = new RangeCriteria();
    rangeCriteria.setKey(RangeKeyType.DATE);
    rangeCriteria.setFrom("2017-09-25 15:33:14 +0200");
    rangeCriteria.setTo("2017-10-09 15:33:14 +0200");
    movementQuery.getMovementRangeSearchCriteria().add(rangeCriteria);
    return movementQuery;
}
Also used : MovementQuery(eu.europa.ec.fisheries.schema.movement.search.v1.MovementQuery) RangeCriteria(eu.europa.ec.fisheries.schema.movement.search.v1.RangeCriteria) ListCriteria(eu.europa.ec.fisheries.schema.movement.search.v1.ListCriteria) ListPagination(eu.europa.ec.fisheries.schema.movement.search.v1.ListPagination)

Aggregations

HttpResponse (org.apache.http.HttpResponse)5 Test (org.junit.Test)5 ListPagination (eu.europa.ec.fisheries.schema.mobileterminal.types.v1.ListPagination)3 AuditLogListQuery (eu.europa.ec.fisheries.schema.audit.search.v1.AuditLogListQuery)2 ListPagination (eu.europa.ec.fisheries.schema.audit.search.v1.ListPagination)2 ListCriteria (eu.europa.ec.fisheries.schema.movement.search.v1.ListCriteria)2 ListPagination (eu.europa.ec.fisheries.schema.movement.search.v1.ListPagination)2 MovementQuery (eu.europa.ec.fisheries.schema.movement.search.v1.MovementQuery)2 AbstractRestServiceTest (eu.europa.ec.fisheries.uvms.docker.validation.common.AbstractRestServiceTest)2 PollListQuery (eu.europa.ec.fisheries.schema.mobileterminal.polltypes.v1.PollListQuery)1 PollSearchCriteria (eu.europa.ec.fisheries.schema.mobileterminal.polltypes.v1.PollSearchCriteria)1 PollableQuery (eu.europa.ec.fisheries.schema.mobileterminal.polltypes.v1.PollableQuery)1 MobileTerminalListQuery (eu.europa.ec.fisheries.schema.mobileterminal.types.v1.MobileTerminalListQuery)1 MobileTerminalSearchCriteria (eu.europa.ec.fisheries.schema.mobileterminal.types.v1.MobileTerminalSearchCriteria)1 RangeCriteria (eu.europa.ec.fisheries.schema.movement.search.v1.RangeCriteria)1 ListPagination (eu.europa.ec.fisheries.schema.rules.search.v1.ListPagination)1 TicketListCriteria (eu.europa.ec.fisheries.schema.rules.search.v1.TicketListCriteria)1 TicketQuery (eu.europa.ec.fisheries.schema.rules.search.v1.TicketQuery)1