### Question:
CurrentSessionsController { @RequestMapping(method = RequestMethod.GET) public void setupForm(ModelMap modelMap) { List<Session> staticSessions = sessionDao.getAllSessions(); Map<String, List<Session>> sessionsByDateMap = getStaticSessionMap(staticSessions); SimpleDateFormat format = new SimpleDateFormat("dd.MM.yyyy"); String now = format.format(new Date()); List<Session> allSessionsByDate = sessionDao.getAllSessionsByDateAndType(now, SessionType.openspace, SessionType.session); modelMap.put("currentSessions", filterCurrentSessions(allSessionsByDate)); modelMap.put("sessionDays", sessionsByDateMap.keySet()); modelMap.put("sessionMap", sessionsByDateMap); modelMap.put("newsList", newsDao.getAllNews()); }  @RequestMapping(method = RequestMethod.GET) void setupForm(ModelMap modelMap);  }### Answer:
@Test public void testSetupForm() throws Exception { mockMvc.perform(get("/currentSessions")).andExpect(status().isOk()).andExpect(model().attribute("currentSessions", is(empty()))).andExpect(model().attributeExists("sessionDays")) .andExpect(model().attributeExists("sessionMap")).andExpect(view().name("currentSessions")); }