@@ -57,6 +57,14 @@ public class RequestResponseTests {
|
||||
this.mvc.stop();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void validateFreemarker() throws Exception {
|
||||
HttpServletRequest request = new ServerlessHttpServletRequest(null, "GET", "/index");
|
||||
ServerlessHttpServletResponse response = new ServerlessHttpServletResponse();
|
||||
mvc.service(request, response);
|
||||
assertThat(response.getContentAsString()).contains("<h1> hello from freemarker </h1>");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void validateAccessDeniedWithCustomHandler() throws Exception {
|
||||
HttpServletRequest request = new ServerlessHttpServletRequest(null, "GET", "/foo/deny");
|
||||
|
||||
@@ -53,7 +53,7 @@ import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandl
|
||||
|
||||
|
||||
@Configuration
|
||||
@Import({ PetsController.class })
|
||||
@Import({ PetsController.class, FreemarkerController.class })
|
||||
@EnableWebSecurity
|
||||
@EnableAutoConfiguration
|
||||
public class PetStoreSpringAppConfig {
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<h1> hello from freemarker </h1>
|
||||
|
||||
<#list 1..10 as x>
|
||||
${x}
|
||||
</#list>
|
||||
Reference in New Issue
Block a user