test_class.declarator: mvcConfig = new MvcConfig()
test_class.original_string: MvcConfig mvcConfig = new MvcConfig();
test_class.type: MvcConfig
test_class.var_name: mvcConfig
test_class.file: 02-spring5-answer/src/test/java/com/example/web/config/MvcConfigTest.java
test_class.identifier: MvcConfigTest
test_case.body: @Test
      @DisplayName("messageSourceのBeanが定義されている")
      public void messageSourceTest() {
          Method messageSourceMethod = assertDoesNotThrow(() -> MvcConfig.class.getMethod("messageSource"));
          Bean bean = messageSourceMethod.getAnnotation(Bean.class);
          assertNotNull(bean);
  
          MessageSource messageSource = mvcConfig.messageSource();
          assertTrue(messageSource instanceof ResourceBundleMessageSource);
          ResourceBundleMessageSource resourceBundleMessageSource = (ResourceBundleMessageSource) messageSource;
          assertAll("messageSource not configured correctly",
                  () -> assertTrue(resourceBundleMessageSource.getBasenameSet().contains("messages")),
                  () -> {
                      Field defaultEncodingField = AbstractResourceBasedMessageSource.class.getDeclaredField("defaultEncoding");
                      defaultEncodingField.setAccessible(true);
                      assertEquals(StandardCharsets.UTF_8.name(),
                              defaultEncodingField.get(resourceBundleMessageSource));
                  }
          );
      }
test_case.class_method_signature: MvcConfigTest.messageSourceTest()
test_case.full_signature: @Test @DisplayName("messageSourceのBeanが定義されている") public void messageSourceTest()
test_case.identifier: messageSourceTest
test_case.invocations: assertDoesNotThrow getMethod getAnnotation assertNotNull messageSource assertTrue assertAll assertTrue contains getBasenameSet getDeclaredField setAccessible assertEquals name get
test_case.modifiers: @Test @DisplayName("messageSourceのBeanが定義されている") public
test_case.parameters: ()
test_case.return: void
test_case.signature: void messageSourceTest()
focal_class.file: 02-spring5-answer/src/main/java/com/example/web/config/MvcConfig.java
focal_class.identifier: MvcConfig
focal_class.interfaces: implements WebMvcConfigurer
focal_class.class_method_signature: MvcConfig.templateResolver()
focal_class.full_signature: @Bean public SpringResourceTemplateResolver templateResolver()
focal_class.identifier: templateResolver
focal_class.modifiers: @Bean public
focal_class.parameters: ()
focal_class.return: SpringResourceTemplateResolver
focal_class.signature: SpringResourceTemplateResolver templateResolver()
focal_class.class_method_signature: MvcConfig.templateEngine(SpringResourceTemplateResolver templateResolver)
focal_class.full_signature: @Bean public SpringTemplateEngine templateEngine(SpringResourceTemplateResolver templateResolver)
focal_class.identifier: templateEngine
focal_class.modifiers: @Bean public
focal_class.parameters: (SpringResourceTemplateResolver templateResolver)
focal_class.return: SpringTemplateEngine
focal_class.signature: SpringTemplateEngine templateEngine(SpringResourceTemplateResolver templateResolver)
focal_class.class_method_signature: MvcConfig.viewResolver(SpringTemplateEngine templateEngine)
focal_class.full_signature: @Bean public ThymeleafViewResolver viewResolver(SpringTemplateEngine templateEngine)
focal_class.identifier: viewResolver
focal_class.modifiers: @Bean public
focal_class.parameters: (SpringTemplateEngine templateEngine)
focal_class.return: ThymeleafViewResolver
focal_class.signature: ThymeleafViewResolver viewResolver(SpringTemplateEngine templateEngine)
focal_class.class_method_signature: MvcConfig.addResourceHandlers(ResourceHandlerRegistry registry)
focal_class.full_signature: @Override public void addResourceHandlers(ResourceHandlerRegistry registry)
focal_class.identifier: addResourceHandlers
focal_class.modifiers: @Override public
focal_class.parameters: (ResourceHandlerRegistry registry)
focal_class.return: void
focal_class.signature: void addResourceHandlers(ResourceHandlerRegistry registry)
focal_class.class_method_signature: MvcConfig.messageSource()
focal_class.full_signature: @Bean public MessageSource messageSource()
focal_class.identifier: messageSource
focal_class.modifiers: @Bean public
focal_class.parameters: ()
focal_class.return: MessageSource
focal_class.signature: MessageSource messageSource()
focal_method.body: @Bean
      public MessageSource messageSource() {
          ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
          messageSource.setBasename("messages");
          messageSource.setDefaultEncoding(StandardCharsets.UTF_8.name());
          return messageSource;
      }
focal_method.class_method_signature: MvcConfig.messageSource()
focal_method.full_signature: @Bean public MessageSource messageSource()
focal_method.identifier: messageSource
focal_method.invocations: setBasename setDefaultEncoding name
focal_method.modifiers: @Bean public
focal_method.parameters: ()
focal_method.return: MessageSource
focal_method.signature: MessageSource messageSource()