use of eu.europa.ec.fisheries.schema.audit.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);
}
use of eu.europa.ec.fisheries.schema.audit.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);
}
use of eu.europa.ec.fisheries.schema.audit.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;
}
use of eu.europa.ec.fisheries.schema.audit.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);
}
use of eu.europa.ec.fisheries.schema.audit.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;
}
Aggregations