this.localServer.register("*", new CookieVer0Service());
DefaultHttpClient client = new DefaultHttpClient();
client.getParams().setParameter(ClientPNames.COOKIE_POLICY, CookiePolicy.BEST_MATCH);
CookieStore cookieStore = new BasicCookieStore();
HttpContext context = new BasicHttpContext();
context.setAttribute(ClientContext.COOKIE_STORE, cookieStore);
HttpGet httpget = new HttpGet("/test/");
HttpResponse response1 = client.execute(getServerHttp(), httpget, context);
HttpEntity e1 = response1.getEntity();
if (e1 != null) {
e1.consumeContent();
}
List<Cookie> cookies = cookieStore.getCookies();
Assert.assertNotNull(cookies);
Assert.assertEquals(1, cookies.size());
HttpResponse response2 = client.execute(getServerHttp(), httpget, context);
HttpEntity e2 = response2.getEntity();