Code example for ServletWebRequest

0
 
 
	@Before 
	public void setup() { 
		this.servletRequest = new MockHttpServletRequest(); 
		this.webRequest = new ServletWebRequest(this.servletRequest); 
 
		this.factoryBean = new ContentNegotiationManagerFactoryBean(); 
		this.factoryBean.setServletContext(this.servletRequest.getServletContext()); 
	} 
 
 
	@Test 
	public void defaultSettings() throws Exception { 
		this.factoryBean.afterPropertiesSet(); 
		ContentNegotiationManager manager = this.factoryBean.getObject(); 
 
		this.servletRequest.setRequestURI("/flower.gif"); 
 
		assertEquals("Should be able to resolve file extensions by default",