@Override
public void responseHook(BasicHttpResponse response) {
response.setHeader("Set-Cookie", "foo=bar; path=/;");
}
}));
connection.execute(new AddonList(), apiKey);
Mockit.setUpMock(AbstractHttpClient.class, new MockAbstractHttpClient(new MockHooks() {
@Override
public void beforeAssertions(HttpUriRequest request, HttpContext context) {
Assert.assertEquals(request.getHeaders("Cookie").length, 0, "Cookies should be ignored, but there are cookies present.");
}
}));
// run this twice to ensure the set-cookie was sent from the first request
connection.execute(new AddonList(), apiKey);
Mockit.tearDownMocks(AbstractHttpClient.class);
}