### Question:
SearchSessionsController { @RequestMapping(method = RequestMethod.GET) public void setupForm(ModelMap modelMap) { modelMap.put("searchFormData", new SearchFormData()); modelMap.put("sessionsList", new ArrayList<Session>()); modelMap.put("newsList", newsDao.getAllNews()); }  @ModelAttribute("searchFormData") SearchFormData getSearchFormData(); @RequestMapping(method = RequestMethod.GET) void setupForm(ModelMap modelMap); @RequestMapping(method = RequestMethod.POST) ModelAndView searchSessions(ModelMap modelMap, @ModelAttribute("searchFormData") SearchFormData formData);  }### Answer:
@Test public void testSetupForm() throws Exception { mockMvc.perform(get("/searchSessions")).andExpect(status().isOk()).andExpect(model().attributeExists("searchFormData")).andExpect(model().attributeExists("sessionsList")) .andExpect(model().attribute("sessionsList", is(empty()))).andExpect(view().name("searchSessions")); }