### Question:
TemplatingConfigurationImpl implements TemplatingConfiguration { public Configuration getFreemarkerConfiguration(final boolean localizedLookupEnabled) { final freemarker.template.Configuration cfg = new freemarker.template.Configuration(freemarker.template.Configuration.VERSION_2_3_28); cfg.setTemplateLoader(new URLTemplateLoader() { @Override protected URL getURL(final String resourceName) { try { final Resource resource = getResource(resourceName); return resource.exists() ? resource.getURL() : null; } catch (final IOException ex) { throw new TemplateLookupFailedException(resourceName, templatesPath, ex); } } }); cfg.setLocalizedLookup(localizedLookupEnabled); cfg.setDefaultEncoding("UTF-8"); cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER); cfg.setLogTemplateExceptions(false); cfg.setWrapUncheckedExceptions(true); return cfg; } TemplatingConfigurationImpl(
            @Value("${notifier.templates.path}") final String templatesPath,
            @Value("${notifier.templates.extension:.ftl}") final String templateExtension); Configuration getFreemarkerConfiguration(final boolean localizedLookupEnabled);  }### Answer:
@Test public void testGetFreemarkerConfiguration() throws IOException { File tempFile = null; File localizedTempFile = null; try { final Locale locale = new Locale(uuid(), uuid()); final String prefix = "dummy"; final String extension = ".ftl"; tempFile = File.createTempFile(prefix, extension); localizedTempFile = new File(tempFile.getAbsolutePath().replace(extension, "_" + locale.toString() + extension)); localizedTempFile.createNewFile(); final TemplatingConfiguration configuration = new TemplatingConfigurationImpl( "file: extension ); assertThat(configuration.getFreemarkerConfiguration(true).getTemplate( tempFile.getName(), locale, null, StandardCharsets.UTF_8.name(), true, true ).getSourceName() ) .isEqualTo(localizedTempFile.getName()); assertThat(configuration.getFreemarkerConfiguration(false).getTemplate( tempFile.getName(), locale, null, StandardCharsets.UTF_8.name(), true, true ).getSourceName() ) .isEqualTo(tempFile.getName()); delete(localizedTempFile); assertThat(configuration.getFreemarkerConfiguration(true).getTemplate( tempFile.getName(), locale, null, StandardCharsets.UTF_8.name(), true, true ).getSourceName() ) .isEqualTo(tempFile.getName()); } finally { delete(tempFile); delete(localizedTempFile); } }