use of com.openmeap.http.HttpHeader in project OpenMEAP by OpenMEAP.
the class AdminTest method testLogin.
public void testLogin() throws Exception {
HttpResponse response = helper.getLogin();
Utils.consumeInputStream(response.getResponseBody());
response = helper.postLogin(AdminTestHelper.ADMIN_USER, AdminTestHelper.ADMIN_PASS);
Assert.assertTrue(response.getStatusCode() == 302);
HttpHeader[] headers = response.getHeaders("Location");
Assert.assertTrue(headers.length == 1);
Assert.assertTrue(headers[0].getValue().equals(helper.getAdminUrl()));
Utils.consumeInputStream(response.getResponseBody());
// Tomcat will shoot you in the face if you don't follow it's redirects
response = helper.getRequestExecuter().get(headers[0].getValue());
Utils.consumeInputStream(response.getResponseBody());
}
Aggregations