Code example for ServletWebRequest

0
 
 
	@Before 
	public void setup() { 
		this.servletRequest = new MockHttpServletRequest(); 
		this.webRequest = new ServletWebRequest(servletRequest); 
	} 
 
 
	@Test 
	public void resolveMediaTypesFromMapping() throws Exception { 
 
		this.servletRequest.setRequestURI("test.html"); 
 
		PathExtensionContentNegotiationStrategy strategy = new PathExtensionContentNegotiationStrategy(); 
		List<MediaType> mediaTypes = strategy.resolveMediaTypes(this.webRequest); 
 
		assertEquals(Arrays.asList(new MediaType("text", "html")), mediaTypes); 
 
		Map<String, MediaType> mapping = Collections.singletonMap("HTML", MediaType.APPLICATION_XHTML_XML); 
Connect your IDE to all the code out there  Get Codota for Java