use of org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver in project spring-framework by spring-projects.
the class ViewResolverRegistryTests method freeMarkerDefaultValues.
@Test
public void freeMarkerDefaultValues() {
this.registry.freeMarker();
FreeMarkerViewResolver resolver = checkAndGetResolver(FreeMarkerViewResolver.class);
checkPropertyValues(resolver, "prefix", "", "suffix", ".ftl");
}
use of org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver in project spring-framework by spring-projects.
the class ViewResolverRegistryTests method freeMarker.
@Test
public void freeMarker() {
this.registry.freeMarker().prefix("/").suffix(".fmt").cache(false);
FreeMarkerViewResolver resolver = checkAndGetResolver(FreeMarkerViewResolver.class);
checkPropertyValues(resolver, "prefix", "/", "suffix", ".fmt", "cacheLimit", 0);
}
use of org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver in project spring-boot by spring-projects.
the class FreeMarkerAutoConfigurationTests method render.
private MockHttpServletResponse render(String viewName) throws Exception {
FreeMarkerViewResolver resolver = this.context.getBean(FreeMarkerViewResolver.class);
View view = resolver.resolveViewName(viewName, Locale.UK);
assertThat(view).isNotNull();
HttpServletRequest request = new MockHttpServletRequest();
request.setAttribute(RequestContext.WEB_APPLICATION_CONTEXT_ATTRIBUTE, this.context);
MockHttpServletResponse response = new MockHttpServletResponse();
view.render(null, request, response);
return response;
}
Aggregations