Search in sources :

Example 1 with TyperefPrimitiveLongAssociationKeyResourceBuilders

use of com.linkedin.restli.examples.greetings.client.TyperefPrimitiveLongAssociationKeyResourceBuilders in project rest.li by linkedin.

the class TestTyperefPrimitiveLongAssociationKeyResource method testGet.

@Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestOptionsDataProvider")
public void testGet(RestliRequestOptions requestOptions) throws RemoteInvocationException {
    GetRequest<Message> req = new TyperefPrimitiveLongAssociationKeyResourceBuilders(requestOptions).get().id(new CompoundKey().append("src", 1).append("dest", 2)).build();
    Response<Message> resp = REST_CLIENT.sendRequest(req).getResponse();
    Message result = resp.getEntity();
    Assert.assertEquals(result.getId(), "1->2");
    Assert.assertEquals(result.getMessage(), "I need some $20");
}
Also used : Message(com.linkedin.restli.examples.greetings.api.Message) CompoundKey(com.linkedin.restli.common.CompoundKey) TyperefPrimitiveLongAssociationKeyResourceBuilders(com.linkedin.restli.examples.greetings.client.TyperefPrimitiveLongAssociationKeyResourceBuilders) Test(org.testng.annotations.Test)

Aggregations

CompoundKey (com.linkedin.restli.common.CompoundKey)1 Message (com.linkedin.restli.examples.greetings.api.Message)1 TyperefPrimitiveLongAssociationKeyResourceBuilders (com.linkedin.restli.examples.greetings.client.TyperefPrimitiveLongAssociationKeyResourceBuilders)1 Test (org.testng.annotations.Test)1