List of usage examples for org.springframework.mock.web MockServletContext setServletContextName
public void setServletContextName(String servletContextName)
From source file:org.parancoe.web.test.BaseTest.java
@Override protected ConfigurableApplicationContext createApplicationContext(String[] locations) { FileSystemResourceLoader rl = new FileSystemResourceLoader(); MockServletContext servletContext = new MockServletContext(rl); servletContext.setMinorVersion(4);//from ww w . ja v a2 s. com servletContext.registerContext("/test", servletContext); servletContext.setServletContextName("/test"); servletContext.addInitParameter(ContextLoader.CONFIG_LOCATION_PARAM, arrayToString(locations)); ContextLoader loader = new ContextLoader(); WebApplicationContext context = loader.initWebApplicationContext(servletContext); return (ConfigurableApplicationContext) context; }