Search in sources :

Example 1 with CustomLongRefArray

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

the class TestCustomTypesClient method testCustomLongArrayOnAction.

@Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestBuilderDataProvider")
public void testCustomLongArrayOnAction(RootBuilderWrapper<Long, Greeting> builders) throws RemoteInvocationException {
    CustomLongRefArray ls = new CustomLongRefArray();
    ls.add(new CustomLong(1L));
    ls.add(new CustomLong(2L));
    Request<CustomLongRefArray> request = builders.<CustomLongRefArray>action("ArrayAction").setActionParam("Ls", ls).build();
    CustomLongRefArray elements = getClient().sendRequest(request).getResponse().getEntity();
    Assert.assertEquals(elements.size(), 2);
    Assert.assertEquals(elements.get(0).toLong().longValue(), 1L);
    Assert.assertEquals(elements.get(1).toLong().longValue(), 2L);
}
Also used : CustomLongRefArray(com.linkedin.restli.examples.typeref.api.CustomLongRefArray) CustomLong(com.linkedin.restli.examples.custom.types.CustomLong) Test(org.testng.annotations.Test)

Aggregations

CustomLong (com.linkedin.restli.examples.custom.types.CustomLong)1 CustomLongRefArray (com.linkedin.restli.examples.typeref.api.CustomLongRefArray)1 Test (org.testng.annotations.Test)1