Search in sources :

Example 1 with TicketListCriteria

use of eu.europa.ec.fisheries.schema.rules.search.v1.TicketListCriteria 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)

Aggregations

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 AbstractRestServiceTest (eu.europa.ec.fisheries.uvms.docker.validation.common.AbstractRestServiceTest)1 HttpResponse (org.apache.http.HttpResponse)1 Test (org.junit.Test)1