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

    Mockito.when(request.getMethod()).thenReturn("GET");
    Mockito.when(request.getSession(Mockito.anyBoolean())).thenReturn(
            session);
    Mockito.when(session.getAttribute("userid")).thenReturn(1l);
    Mockito.when(session.getAttribute("accountobj")).thenReturn(account);
    HashMap<String, String[]> params = new HashMap<String, String[]>();
    params.put(ApiConstants.COMMAND, new String[] { "logout" });
    Mockito.when(request.getParameterMap()).thenReturn(params);
    Mockito.when(authenticator.getAPIType()).thenReturn(APIAuthenticationType.LOGOUT_API);
    servlet.processRequestInContext(request, response);
    Mockito.verify(authManager).getAPIAuthenticator("logout");
    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));
    Mockito.verify(session).invalidate();
}