mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-26 08:59:09 +00:00
SPR-7081 - Add ignoreJafMediaTypes to ContentNegotiatingViewResolver
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3239 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
+13
-3
@@ -49,14 +49,24 @@ public class ContentNegotiatingViewResolverTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getMediaTypeFromFilename() {
|
||||
assertEquals("Invalid content type", new MediaType("text", "html"),
|
||||
viewResolver.getMediaTypeFromFilename("test.html"));
|
||||
public void getMediaTypeFromFilenameMediaTypes() {
|
||||
viewResolver.setMediaTypes(Collections.singletonMap("HTML", "application/xhtml+xml"));
|
||||
assertEquals("Invalid content type", new MediaType("application", "xhtml+xml"),
|
||||
viewResolver.getMediaTypeFromFilename("test.html"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getMediaTypeFromFilenameJaf() {
|
||||
assertEquals("Invalid content type", new MediaType("text", "html"),
|
||||
viewResolver.getMediaTypeFromFilename("test.html"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getMediaTypeFromFilenameNoJaf() {
|
||||
viewResolver.setUseJaf(false);
|
||||
assertNull("Invalid content type", viewResolver.getMediaTypeFromFilename("test.html"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getMediaTypeFilename() {
|
||||
MockHttpServletRequest request = new MockHttpServletRequest("GET", "/test.html?foo=bar");
|
||||
|
||||
Reference in New Issue
Block a user