### Question:
OpenRequestsNotificationsController extends AbstractController { @GetMapping("/notifications/open-requests") public ModelAndView showGenerateTemplateForm(final Model model) { return modelAndView(model).withView("notifications/open-requests") .withObject("projects", requestService.findAllProjects()) .withObject("technologies", requestService.findAllTechnologies()) .withObject("targetPlatforms", TargetPlatform.values()) .build(); } OpenRequestsNotificationsController(final NotificationsTemplateService notificationsTemplateService, final RequestService requestService); @GetMapping("/notifications/open-requests") ModelAndView showGenerateTemplateForm(final Model model); @GetMapping("/notifications/open-requests/template") ModelAndView showGeneratedTemplate(final Model model,
                                              @RequestParam(required = false) final List<String> projects,
                                              @RequestParam(required = false) final List<String> technologies,
                                              @RequestParam(name = "last-updated", required = false) String lastUpdatedSinceDays,
                                              @RequestParam(name = "target-platform") TargetPlatform targetPlatform);  }### Answer:
@Test void showGenerateTemplateForm() throws Exception { final HashSet<String> projects = new HashSet<>(); final HashSet<String> technologies = new HashSet<>(); when(requestService.findAllProjects()).thenReturn(projects); when(requestService.findAllTechnologies()).thenReturn(technologies); this.mockMvc.perform(get("/notifications/open-requests")) .andExpect(MockMvcResultMatchers.status().isOk()) .andExpect(MockMvcResultMatchers.view().name("notifications/open-requests")) .andExpect(MockMvcResultMatchers.model().attribute("projects", sameInstance(projects))) .andExpect(MockMvcResultMatchers.model().attribute("technologies", sameInstance(technologies))) .andExpect(MockMvcResultMatchers.model().attribute("targetPlatforms", TargetPlatform.values())); }