### Question:
CustomerController { @GetMapping("/insertMain") public String insertMain(Model model) { model.addAttribute(CustomerForm.createEmptyForm()); return "insertMain"; } 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("insertMain画面に遷移する") public void insertMainTest() { Method indexMethod = assertDoesNotThrow(() -> CustomerController.class.getMethod("insertMain", Model.class)); GetMapping getMapping = indexMethod.getAnnotation(GetMapping.class); ExtendedModelMap model = new ExtendedModelMap(); String logicalViewName = customerController.insertMain(model); Object customerFormObj = model.get("customerForm"); assertAll( () -> assertNotNull(getMapping), () -> assertEquals("/insertMain", getMapping.value()[0]), () -> assertEquals("insertMain", logicalViewName), () -> assertNotNull(customerFormObj), () -> assertTrue(customerFormObj instanceof CustomerForm) ); CustomerForm customerForm = (CustomerForm) customerFormObj; assertAll( () -> assertNull(customerForm.getFirstName()), () -> assertNull(customerForm.getLastName()), () -> assertNull(customerForm.getEmail()), () -> assertNull(customerForm.getBirthday()) ); }