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("templateEngineのBeanが定義されている")
      public void templateEngineTest() {
          Method templateEngineMethod = assertDoesNotThrow(() -> MvcConfig.class.getMethod("templateEngine", SpringResourceTemplateResolver.class));
          Bean bean = templateEngineMethod.getAnnotation(Bean.class);
          assertNotNull(bean);
  
          SpringResourceTemplateResolver templateResolver = mvcConfig.templateResolver();
          SpringTemplateEngine templateEngine = mvcConfig.templateEngine(templateResolver);
          Set<ITemplateResolver> templateResolvers = templateEngine.getTemplateResolvers();
          String[] actualDialects = templateEngine.getDialects()
                  .stream()
                  .map(dialect -> dialect.getClass().getSimpleName())
                  .sorted()
                  .toArray(String[]::new);
          assertAll("templateEngine not configured correctly",
                  () -> assertTrue(templateResolvers.contains(templateResolver)),
                  () -> assertTrue(templateEngine.getEnableSpringELCompiler()),
                  () -> assertArrayEquals(
                          new String[]{"Java8TimeDialect", "SpringSecurityDialect", "SpringStandardDialect"},
                          actualDialects)
          );
      }
test_case.class_method_signature: MvcConfigTest.templateEngineTest()
test_case.full_signature: @Test @DisplayName("templateEngineのBeanが定義されている") public void templateEngineTest()
test_case.identifier: templateEngineTest
test_case.invocations: assertDoesNotThrow getMethod getAnnotation assertNotNull templateResolver templateEngine getTemplateResolvers toArray sorted map stream getDialects getSimpleName getClass assertAll assertTrue contains assertTrue getEnableSpringELCompiler assertArrayEquals
test_case.modifiers: @Test @DisplayName("templateEngineのBeanが定義されている") public
test_case.parameters: ()
test_case.return: void
test_case.signature: void templateEngineTest()
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 SpringTemplateEngine templateEngine(SpringResourceTemplateResolver templateResolver) {
          SpringTemplateEngine templateEngine = new SpringTemplateEngine();
          templateEngine.setTemplateResolver(templateResolver);
          templateEngine.setEnableSpringELCompiler(true);
          // ThymeleafでDate and Time APIを利用するDialectを追加
          templateEngine.addDialect(new Java8TimeDialect());
          // ThymeleafでSpring Securityを利用するDialectを追加
          templateEngine.addDialect(new SpringSecurityDialect());
          return templateEngine;
      }
focal_method.class_method_signature: MvcConfig.templateEngine(SpringResourceTemplateResolver templateResolver)
focal_method.full_signature: @Bean public SpringTemplateEngine templateEngine(SpringResourceTemplateResolver templateResolver)
focal_method.identifier: templateEngine
focal_method.invocations: setTemplateResolver setEnableSpringELCompiler addDialect addDialect
focal_method.modifiers: @Bean public
focal_method.parameters: (SpringResourceTemplateResolver templateResolver)
focal_method.return: SpringTemplateEngine
focal_method.signature: SpringTemplateEngine templateEngine(SpringResourceTemplateResolver templateResolver)