use of org.springframework.web.testfixture.servlet.MockHttpServletMapping in project spring-framework by spring-projects.
the class ServletRequestPathUtilsTests method testParseAndCache.
private void testParseAndCache(String requestUri, String contextPath, String servletPath, String pathWithinApplication) {
MockHttpServletRequest request = new MockHttpServletRequest("GET", requestUri);
request.setContextPath(contextPath);
request.setServletPath(servletPath);
request.setHttpServletMapping(new MockHttpServletMapping(pathWithinApplication, contextPath, "myServlet", MappingMatch.PATH));
RequestPath requestPath = ServletRequestPathUtils.parseAndCache(request);
assertThat(requestPath.contextPath().value()).isEqualTo(contextPath);
assertThat(requestPath.pathWithinApplication().value()).isEqualTo(pathWithinApplication);
}
Aggregations