@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()); }
public String index(Model model) { return null; }
CustomerController { public String index(Model model) { return null; } }
CustomerController { public String index(Model model) { return null; }  }
CustomerController { public String index(Model model) { return null; }  String index(Model model); @GetMapping("/insertMain") String insertMain(Model model); String insertComplete(
            // Bean Validationを実行するアノテーションを付加する
               CustomerForm customerForm,
            BindingResult bindingResult); }
CustomerController { public String index(Model model) { return null; }  String index(Model model); @GetMapping("/insertMain") String insertMain(Model model); String insertComplete(
            // Bean Validationを実行するアノテーションを付加する
               CustomerForm customerForm,
            BindingResult bindingResult);  }