use of com.linkedin.restli.examples.greetings.client.CookieGetBuilder in project rest.li by linkedin.
the class TestCookieResource method testAddCookies.
/**
* Test the add cookie functionality
*
* @throws RemoteInvocationException
*/
@Test
public void testAddCookies() throws RemoteInvocationException {
CookieGetBuilder builderTmp = new CookieBuilders().get().id(1L);
builderTmp.addCookie(new HttpCookie("C", "3"));
builderTmp.addCookie(new HttpCookie("B", "2"));
builderTmp.addCookie(new HttpCookie("A", "1"));
GetRequest<Greeting> req = builderTmp.build();
Response<Greeting> resp = REST_CLIENT.sendRequest(req).getResponse();
List<HttpCookie> expectedCookies = Arrays.asList(new HttpCookie("3", "C"), new HttpCookie("2", "B"), new HttpCookie("1", "A"));
Assert.assertEquals(resp.getCookies(), expectedCookies);
}
Aggregations