use of com.linkedin.restli.examples.greetings.api.TwoPartKey in project rest.li by linkedin.
the class TestEscapeCharsInStringKeys method testGetWithComplexKey.
@Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestComplexKeysBuilderDataProvider")
public void testGetWithComplexKey(RootBuilderWrapper<ComplexResourceKey<TwoPartKey, TwoPartKey>, Message> builders) throws Exception {
TwoPartKey key = new TwoPartKey();
key.setMajor(key1());
key.setMinor(key2());
TwoPartKey params = new TwoPartKey();
params.setMajor(key1());
params.setMinor(key3());
ComplexResourceKey<TwoPartKey, TwoPartKey> complexKey = new ComplexResourceKey<TwoPartKey, TwoPartKey>(key, params);
Request<Message> request = builders.get().id(complexKey).build();
Message response = getClient().sendRequest(request).get().getEntity();
Assert.assertNotNull(response);
Assert.assertEquals(response.getId(), key.getMajor() + " " + key.getMinor(), "Message should be key1 + ' ' + key2 for complexKey(key1,key2)");
}
Aggregations