### Question:
CustomerController { @GetMapping("/") public String index(Model model) { Iterable<Customer> customers = customerService.findAll(); model.addAttribute("customers", customers); return "index"; } CustomerController(CustomerService customerService); @GetMapping("/") String index(Model model); @GetMapping("/insertMain") String insertMain(Model model); @PostMapping("/insertComplete") String insertComplete(
            @Validated CustomerForm customerForm,
            BindingResult bindingResult);  }### Answer:
@Test @DisplayName("全顧客を検索してindex画面に遷移する") public void indexTest() { Method indexMethod = assertDoesNotThrow(() -> CustomerController.class.getMethod("index", Model.class)); GetMapping getMapping = indexMethod.getAnnotation(GetMapping.class); ExtendedModelMap model = new ExtendedModelMap(); String logicalViewName = customerController.index(model); Object customersObj = model.get("customers"); assertAll( () -> assertNotNull(getMapping), () -> assertEquals("/", getMapping.value()[0]), () -> assertEquals("index", logicalViewName), () -> assertNotNull(customersObj), () -> assertTrue(customersObj instanceof List) ); List<Customer> customers = (List<Customer>) customersObj; assertEquals(5, customers.size()); }