mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Consistently declare Servlet mock classes with Servlet 6.1 baseline
Closes gh-35671
This commit is contained in:
@@ -31,7 +31,7 @@ import org.springframework.util.StringUtils;
|
||||
* Extension of {@code Cookie} with extra attributes, as defined in
|
||||
* <a href="https://tools.ietf.org/html/rfc6265">RFC 6265</a>.
|
||||
*
|
||||
* <p>As of Spring 6.0, this set of mocks is designed on a Servlet 6.0 baseline.
|
||||
* <p>As of Spring 7.0, this set of mocks is designed on a Servlet 6.1 baseline.
|
||||
*
|
||||
* @author Vedran Pavic
|
||||
* @author Juergen Hoeller
|
||||
|
||||
@@ -81,7 +81,7 @@ import org.springframework.web.util.UrlPathHelper;
|
||||
* is {@link Locale#ENGLISH}. This value can be changed via {@link #addPreferredLocale}
|
||||
* or {@link #setPreferredLocales}.
|
||||
*
|
||||
* <p>As of Spring 6.0, this set of mocks is designed on a Servlet 6.0 baseline.
|
||||
* <p>As of Spring 7.0, this set of mocks is designed on a Servlet 6.1 baseline.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @author Rod Johnson
|
||||
|
||||
@@ -36,7 +36,7 @@ import org.springframework.util.Assert;
|
||||
/**
|
||||
* Mock implementation of the {@link jakarta.servlet.http.HttpSession} interface.
|
||||
*
|
||||
* <p>As of Spring 6.0, this set of mocks is designed on a Servlet 6.0 baseline.
|
||||
* <p>As of Spring 7.0, this set of mocks is designed on a Servlet 6.1 baseline.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @author Rod Johnson
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
* Mock implementation of the
|
||||
* {@link org.springframework.web.multipart.MultipartHttpServletRequest} interface.
|
||||
*
|
||||
* <p>As of Spring 6.0, this set of mocks is designed on a Servlet 6.0 baseline.
|
||||
* <p>As of Spring 7.0, this set of mocks is designed on a Servlet 6.1 baseline.
|
||||
*
|
||||
* <p>Useful for testing application controllers that access multipart uploads.
|
||||
* {@link MockMultipartFile} can be used to populate these mock requests with files.
|
||||
|
||||
@@ -61,11 +61,11 @@ import org.springframework.web.util.WebUtils;
|
||||
/**
|
||||
* Mock implementation of the {@link jakarta.servlet.ServletContext} interface.
|
||||
*
|
||||
* <p>As of Spring 6.0, this set of mocks is designed on a Servlet 6.0 baseline.
|
||||
* <p>As of Spring 7.0, this set of mocks is designed on a Servlet 6.1 baseline.
|
||||
*
|
||||
* <p>Compatible with Servlet 3.1 but can be configured to expose a specific version
|
||||
* through {@link #setMajorVersion}/{@link #setMinorVersion}; default is 3.1.
|
||||
* Note that Servlet 3.1 support is limited: servlet, filter and listener
|
||||
* <p>Compatible with Servlet 6.1 but can be configured to expose a specific version
|
||||
* through {@link #setMajorVersion}/{@link #setMinorVersion}; default is 6.1.
|
||||
* Note that some Servlet SPI support is limited: servlet, filter and listener
|
||||
* registration methods are not supported; neither is JSP configuration.
|
||||
* We generally do not recommend to unit test your ServletContainerInitializers and
|
||||
* WebApplicationInitializers which is where those registration methods would be used.
|
||||
@@ -114,11 +114,11 @@ public class MockServletContext implements ServletContext {
|
||||
|
||||
private int majorVersion = 6;
|
||||
|
||||
private int minorVersion = 0;
|
||||
private int minorVersion = 1;
|
||||
|
||||
private int effectiveMajorVersion = 6;
|
||||
|
||||
private int effectiveMinorVersion = 0;
|
||||
private int effectiveMinorVersion = 1;
|
||||
|
||||
private final Map<String, RequestDispatcher> namedRequestDispatchers = new HashMap<>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user