use of org.springframework.web.servlet.view.groovy.GroovyMarkupViewResolver in project spring-framework by spring-projects.
the class ViewResolverRegistryTests method groovyMarkupDefaultValues.
@Test
public void groovyMarkupDefaultValues() {
this.registry.groovy();
GroovyMarkupViewResolver resolver = checkAndGetResolver(GroovyMarkupViewResolver.class);
checkPropertyValues(resolver, "prefix", "", "suffix", ".tpl");
}
use of org.springframework.web.servlet.view.groovy.GroovyMarkupViewResolver in project spring-framework by spring-projects.
the class ViewResolverRegistryTests method groovyMarkup.
@Test
public void groovyMarkup() {
this.registry.groovy().prefix("/").suffix(".groovy").cache(true);
GroovyMarkupViewResolver resolver = checkAndGetResolver(GroovyMarkupViewResolver.class);
checkPropertyValues(resolver, "prefix", "/", "suffix", ".groovy", "cacheLimit", 1024);
}
use of org.springframework.web.servlet.view.groovy.GroovyMarkupViewResolver in project spring-boot by spring-projects.
the class GroovyTemplateAutoConfigurationTests method render.
private MockHttpServletResponse render(String viewName, Locale locale) throws Exception {
LocaleContextHolder.setLocale(locale);
GroovyMarkupViewResolver resolver = this.context.getBean(GroovyMarkupViewResolver.class);
View view = resolver.resolveViewName(viewName, locale);
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