Search in sources :

Example 1 with CalendarRefArray

use of com.linkedin.restli.examples.typeref.api.CalendarRefArray in project rest.li by linkedin.

the class TestCustomTypesClient method testCalendarRefArrayQueryParam.

@Test
public void testCalendarRefArrayQueryParam() throws RemoteInvocationException {
    FindRequest<Greeting> findRequest = new CustomTypesRequestBuilders().findByCalendars().addCalendarsParam(new GregorianCalendar()).build();
    Response<CollectionResponse<Greeting>> response = getClient().sendRequest(findRequest).getResponse();
    Assert.assertEquals(response.getEntity().getElements().size(), 0);
    CalendarRefArray calendarRefArray = new CalendarRefArray();
    calendarRefArray.add(new GregorianCalendar());
    findRequest = new CustomTypesRequestBuilders().findByCalendars().calendarsParam(calendarRefArray).build();
    response = getClient().sendRequest(findRequest).getResponse();
    Assert.assertEquals(response.getEntity().getElements().size(), 0);
    List<Calendar> calendars = new ArrayList<Calendar>();
    calendars.add(new GregorianCalendar());
    findRequest = new CustomTypesRequestBuilders().findByCalendars().calendarsParam(calendars).build();
    response = getClient().sendRequest(findRequest).getResponse();
    Assert.assertEquals(response.getEntity().getElements().size(), 0);
}
Also used : Greeting(com.linkedin.restli.examples.greetings.api.Greeting) CustomTypesRequestBuilders(com.linkedin.restli.examples.greetings.client.CustomTypesRequestBuilders) CollectionResponse(com.linkedin.restli.common.CollectionResponse) GregorianCalendar(java.util.GregorianCalendar) Calendar(java.util.Calendar) GregorianCalendar(java.util.GregorianCalendar) ArrayList(java.util.ArrayList) CalendarRefArray(com.linkedin.restli.examples.typeref.api.CalendarRefArray) Test(org.testng.annotations.Test)

Aggregations

CollectionResponse (com.linkedin.restli.common.CollectionResponse)1 Greeting (com.linkedin.restli.examples.greetings.api.Greeting)1 CustomTypesRequestBuilders (com.linkedin.restli.examples.greetings.client.CustomTypesRequestBuilders)1 CalendarRefArray (com.linkedin.restli.examples.typeref.api.CalendarRefArray)1 ArrayList (java.util.ArrayList)1 Calendar (java.util.Calendar)1 GregorianCalendar (java.util.GregorianCalendar)1 Test (org.testng.annotations.Test)1