@Test
public void login() throws XMPPException, InterruptedException, IOException, SmackException {

    ModelAndView mav = controller.login(ENTITY, PASSWORD, session);
    
    Mockito.verify(connection).connect();
    Mockito.verify(connection).login(ENTITY, PASSWORD);
    
    Assert.assertNotNull(session.getAttribute(AdminConsoleController.SESSION_ATTRIBUTE));
    Assert.assertEquals("redirect:", mav.getViewName());
}