test_class.declarator: customerController
test_class.modifier: @Autowired
test_class.original_string: @Autowired
      CustomerController customerController;
test_class.type: CustomerController
test_class.var_name: customerController
test_class.declarator: jdbcTemplate
test_class.original_string: JdbcTemplate jdbcTemplate;
test_class.type: JdbcTemplate
test_class.var_name: jdbcTemplate
test_class.file: 02-spring5-answer/src/test/java/com/example/web/controller/CustomerControllerTest.java
test_class.identifier: CustomerControllerTest
test_case.body: @Test
      @DisplayName("検証エラー時にinsertMain画面に戻る")
      public void insertCompleteTest1() {
          Method indexMethod = assertDoesNotThrow(() -> CustomerController.class.getMethod("insertComplete", CustomerForm.class, BindingResult.class));
          PostMapping postMapping = indexMethod.getAnnotation(PostMapping.class);
          BeanPropertyBindingResult bindingResult =
                  new BeanPropertyBindingResult(CustomerForm.createEmptyForm(), "customerForm") {
                      @Override
                      public boolean hasErrors() {
                          return true;
                      }
                  };
          String logicalViewName = customerController.insertComplete(CustomerForm.createEmptyForm(), bindingResult);
          assertAll(
                  () -> assertNotNull(postMapping),
                  () -> assertEquals("/insertComplete", postMapping.value()[0]),
                  () -> assertEquals("insertMain", logicalViewName)
          );
      }
test_case.class_method_signature: CustomerControllerTest.insertCompleteTest1()
test_case.full_signature: @Test @DisplayName("検証エラー時にinsertMain画面に戻る") public void insertCompleteTest1()
test_case.identifier: insertCompleteTest1
test_case.invocations: assertDoesNotThrow getMethod getAnnotation createEmptyForm insertComplete createEmptyForm assertAll assertNotNull assertEquals value assertEquals
test_case.modifiers: @Test @DisplayName("検証エラー時にinsertMain画面に戻る") public
test_case.parameters: ()
test_case.return: void
test_case.signature: void insertCompleteTest1()
focal_class.declarator: logger = LoggerFactory.getLogger(CustomerController.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(CustomerController.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: customerService
focal_class.modifier: private final
focal_class.original_string: private final CustomerService customerService;
focal_class.type: CustomerService
focal_class.var_name: customerService
focal_class.file: 02-spring5-answer/src/main/java/com/example/web/controller/CustomerController.java
focal_class.identifier: CustomerController
focal_class.class_method_signature: CustomerController.CustomerController(CustomerService customerService)
focal_class.full_signature: public  CustomerController(CustomerService customerService)
focal_class.identifier: CustomerController
focal_class.modifiers: public
focal_class.parameters: (CustomerService customerService)
focal_class.signature:  CustomerController(CustomerService customerService)
focal_class.class_method_signature: CustomerController.index(Model model)
focal_class.full_signature: @GetMapping("/") public String index(Model model)
focal_class.identifier: index
focal_class.modifiers: @GetMapping("/") public
focal_class.parameters: (Model model)
focal_class.return: String
focal_class.signature: String index(Model model)
focal_class.class_method_signature: CustomerController.insertMain(Model model)
focal_class.full_signature: @GetMapping("/insertMain") public String insertMain(Model model)
focal_class.identifier: insertMain
focal_class.modifiers: @GetMapping("/insertMain") public
focal_class.parameters: (Model model)
focal_class.return: String
focal_class.signature: String insertMain(Model model)
focal_class.class_method_signature: CustomerController.insertComplete(
              @Validated CustomerForm customerForm,
              BindingResult bindingResult)
focal_class.full_signature: @PostMapping("/insertComplete") public String insertComplete(
              @Validated CustomerForm customerForm,
              BindingResult bindingResult)
focal_class.identifier: insertComplete
focal_class.modifiers: @PostMapping("/insertComplete") public
focal_class.parameters: (
              @Validated CustomerForm customerForm,
              BindingResult bindingResult)
focal_class.return: String
focal_class.signature: String insertComplete(
              @Validated CustomerForm customerForm,
              BindingResult bindingResult)
focal_method.body: @PostMapping("/insertComplete")
      public String insertComplete(
              @Validated CustomerForm customerForm,
              BindingResult bindingResult) {
          if (bindingResult.hasErrors()) {
              return "insertMain";
          }
          // フォームをエンティティに変換
          Customer customer = customerForm.convertToEntity();
          customerService.save(customer);
          return "redirect:/";
      }
focal_method.class_method_signature: CustomerController.insertComplete(
              @Validated CustomerForm customerForm,
              BindingResult bindingResult)
focal_method.full_signature: @PostMapping("/insertComplete") public String insertComplete(
              @Validated CustomerForm customerForm,
              BindingResult bindingResult)
focal_method.identifier: insertComplete
focal_method.invocations: hasErrors convertToEntity save
focal_method.modifiers: @PostMapping("/insertComplete") public
focal_method.parameters: (
              @Validated CustomerForm customerForm,
              BindingResult bindingResult)
focal_method.return: String
focal_method.signature: String insertComplete(
              @Validated CustomerForm customerForm,
              BindingResult bindingResult)