### Question:
AdminConsoleController { @RequestMapping("/") public ModelAndView index(HttpSession session) throws XMPPException { ExtendedXMPPConnection client = (ExtendedXMPPConnection) session.getAttribute(SESSION_ATTRIBUTE); if (client == null) { return login(); } else if (!client.isConnected()) { return login("Disconnected from XMPP server, please log in again"); } else { ModelAndView mav = new ModelAndView("index"); mav.addObject(MODEL_AUTHENTICATED, getUserName(client)); return mav; } } @Autowired  AdminConsoleController(XMPPTCPConnectionConfiguration connectionConfiguration); @RequestMapping("/") ModelAndView index(HttpSession session); @RequestMapping(value = "/{command}", method = RequestMethod.GET) ModelAndView command(@PathVariable("command") String command, HttpSession session); @RequestMapping(value = "/{command}", method = RequestMethod.POST) ModelAndView submitCommand(@PathVariable("command") String command, HttpServletRequest request,
            HttpSession session); @RequestMapping(value = "/login", method = RequestMethod.POST) ModelAndView login(@RequestParam("username") String username, @RequestParam("password") String password,
            HttpSession session); @RequestMapping(value = "/logout") ModelAndView logout(HttpSession session); static final String SESSION_ATTRIBUTE; static final String SESSION_FIELD; static final Map<String, String> COMMANDS; }### Answer:
@Test public void indexNotAuthenticated() throws XMPPException { ModelAndView mav = controller.index(session); Assert.assertEquals("index", mav.getViewName()); Assert.assertNull(mav.getModel().get("authenticated")); }