### Question:
HeroController { @GetMapping("/hero") public String viewAllHeros(Model model) { List<Hero> allHeros = heroService.collectAllHeros(); model.addAttribute("heros", allHeros); model.addAttribute("ipAddress", inspectLocalHost()); return "hero/hero.list.html"; } HeroController(HeroService heroService); @GetMapping("/hero") String viewAllHeros(Model model); @GetMapping("/hero/new") String newHero(Model model); @PostMapping("/hero/new") String addNewHero(@ModelAttribute("newHero") NewHeroModel newHeroModel);  }### Answer:
@Test public void viewAllHeros() { Model model = mock(Model.class); String view = subjectUnderTest.viewAllHeros(model); assertThat(view).isEqualTo("hero/hero.list.html"); verify(model).addAttribute(eq("heros"), anyList()); verify(model).addAttribute(eq("ipAddress"), anyString()); verify(heroService).collectAllHeros(); }