Undo HttpServletMapping support in MockHttpServletRequest

Closes gh-26555
This commit is contained in:
Rossen Stoyanchev
2021-02-19 12:07:05 +00:00
parent 1dd7d53de0
commit 274db2f7a9
2 changed files with 4 additions and 12 deletions

View File

@@ -24,6 +24,10 @@ import org.springframework.lang.Nullable;
/**
* Mock implementation of {@link HttpServletMapping}.
*
* <p>Currently not exposed in {@link MockHttpServletMapping} as a setter to
* avoid issues for Maven builds in applications with a Servlet 3.1 runtime
* requirement.
*
* @author Rossen Stoyanchev
* @since 5.3.4
*/

View File

@@ -52,7 +52,6 @@ import javax.servlet.ServletInputStream;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletMapping;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
@@ -275,8 +274,6 @@ public class MockHttpServletRequest implements HttpServletRequest {
private final MultiValueMap<String, Part> parts = new LinkedMultiValueMap<>();
private HttpServletMapping httpServletMapping = new MockHttpServletMapping("", "", "", null);
// ---------------------------------------------------------------------
// Constructors
@@ -1393,15 +1390,6 @@ public class MockHttpServletRequest implements HttpServletRequest {
return result;
}
public void setHttpServletMapping(HttpServletMapping httpServletMapping) {
this.httpServletMapping = httpServletMapping;
}
@Override
public HttpServletMapping getHttpServletMapping() {
return this.httpServletMapping;
}
@Override
public <T extends HttpUpgradeHandler> T upgrade(Class<T> handlerClass) throws IOException, ServletException {
throw new UnsupportedOperationException();