use of com.linkedin.restli.examples.greetings.client.CustomTypesRequestBuilders in project rest.li by linkedin.
the class TestCustomTypesClient method testCalendarRefActionParam.
@Test
public void testCalendarRefActionParam() throws RemoteInvocationException {
ActionRequest<Integer> actionRequest = new CustomTypesRequestBuilders().actionCalendarAction().calendarParam(new GregorianCalendar()).build();
Response<Integer> response = getClient().sendRequest(actionRequest).getResponse();
Assert.assertEquals(response.getEntity().intValue(), Calendar.getInstance().get(Calendar.YEAR));
}
use of com.linkedin.restli.examples.greetings.client.CustomTypesRequestBuilders in project rest.li by linkedin.
the class TestCustomTypesClient method testCalendarRefQueryParam.
@Test
public void testCalendarRefQueryParam() throws RemoteInvocationException {
FindRequest<Greeting> findRequest = new CustomTypesRequestBuilders().findByCalendar().calendarParam(new GregorianCalendar()).build();
Response<CollectionResponse<Greeting>> response = getClient().sendRequest(findRequest).getResponse();
Assert.assertEquals(response.getEntity().getElements().size(), 0);
}
use of com.linkedin.restli.examples.greetings.client.CustomTypesRequestBuilders in project rest.li by linkedin.
the class TestCustomTypesClient method testIPAddressQueryParam.
// This tests that a typeref that refers to bytes with a custom coercer is serialized correctly when used as a query parameter.
// (See IPAddressSimple.pdsc)
@Test
public void testIPAddressQueryParam() throws RemoteInvocationException, UnknownHostException {
FindRequest<Greeting> findRequest = new CustomTypesRequestBuilders().findByIp().ipParam(Inet4Address.getByName("linkedin.com")).build();
Response<CollectionResponse<Greeting>> response = getClient().sendRequest(findRequest).getResponse();
Assert.assertEquals(response.getEntity().getElements().size(), 0);
}
use of com.linkedin.restli.examples.greetings.client.CustomTypesRequestBuilders 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);
}
Aggregations