@SuppressWarnings("unchecked")
@Test
public void processRequestInContextLogin() throws UnknownHostException {

    Mockito.when(request.getMethod()).thenReturn("GET");
    Mockito.when(request.getSession(Mockito.anyBoolean())).thenReturn(
            session);
    HashMap<String, String[]> params = new HashMap<String, String[]>();
    params.put(ApiConstants.COMMAND, new String[] { "login" });
    params.put(ApiConstants.USERNAME, new String[] { "TEST" });
    params.put(ApiConstants.PASSWORD, new String[] { "TEST-PWD" });
    params.put(ApiConstants.DOMAIN_ID, new String[] { "42" });
    params.put(ApiConstants.DOMAIN, new String[] { "TEST-DOMAIN" });
    Mockito.when(request.getParameterMap()).thenReturn(params);
    servlet.processRequestInContext(request, response);
    Mockito.verify(authManager).getAPIAuthenticator("login");
    Mockito.verify(authenticator).authenticate(Mockito.anyString(), Mockito.anyMap(), Mockito.isA(HttpSession.class),
            Mockito.eq(InetAddress.getByName("127.0.0.1")), Mockito.anyString(), Mockito.isA(StringBuilder.class), Mockito.isA(HttpServletRequest.class), Mockito.isA(HttpServletResponse.class));
}