Skip to content

Commit aa625f0

Browse files
committed
Consistently declare Servlet mock classes with Servlet 6.1 baseline
Closes gh-35671
1 parent 7ca2a5d commit aa625f0

11 files changed

Lines changed: 22 additions & 22 deletions

File tree

framework-docs/modules/ROOT/pages/testing/unit.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ mock objects that are useful for testing web contexts, controllers, and filters.
4646
mock objects are targeted at usage with Spring's Web MVC framework and are generally more
4747
convenient to use than dynamic mock objects (such as https://easymock.org/[EasyMock]).
4848

49-
TIP: Since Spring Framework 6.0, the mock objects in `org.springframework.mock.web` are
50-
based on the Servlet 6.0 API.
49+
TIP: Since Spring Framework 7.0, the mock objects in `org.springframework.mock.web` are
50+
based on the Servlet 6.1 API.
5151

5252
MockMvc builds on the mock Servlet API objects to provide an integration testing
5353
framework for Spring MVC. See xref:testing/mockmvc.adoc[MockMvc].

spring-test/src/main/java/org/springframework/mock/web/MockCookie.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* Extension of {@code Cookie} with extra attributes, as defined in
3232
* <a href="https://tools.ietf.org/html/rfc6265">RFC 6265</a>.
3333
*
34-
* <p>As of Spring 6.0, this set of mocks is designed on a Servlet 6.0 baseline.
34+
* <p>As of Spring 7.0, this set of mocks is designed on a Servlet 6.1 baseline.
3535
*
3636
* @author Vedran Pavic
3737
* @author Juergen Hoeller

spring-test/src/main/java/org/springframework/mock/web/MockHttpServletRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
* is {@link Locale#ENGLISH}. This value can be changed via {@link #addPreferredLocale}
8282
* or {@link #setPreferredLocales}.
8383
*
84-
* <p>As of Spring 6.0, this set of mocks is designed on a Servlet 6.0 baseline.
84+
* <p>As of Spring 7.0, this set of mocks is designed on a Servlet 6.1 baseline.
8585
*
8686
* @author Juergen Hoeller
8787
* @author Rod Johnson

spring-test/src/main/java/org/springframework/mock/web/MockHttpSession.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
/**
3737
* Mock implementation of the {@link jakarta.servlet.http.HttpSession} interface.
3838
*
39-
* <p>As of Spring 6.0, this set of mocks is designed on a Servlet 6.0 baseline.
39+
* <p>As of Spring 7.0, this set of mocks is designed on a Servlet 6.1 baseline.
4040
*
4141
* @author Juergen Hoeller
4242
* @author Rod Johnson

spring-test/src/main/java/org/springframework/mock/web/MockMultipartHttpServletRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
* Mock implementation of the
4444
* {@link org.springframework.web.multipart.MultipartHttpServletRequest} interface.
4545
*
46-
* <p>As of Spring 6.0, this set of mocks is designed on a Servlet 6.0 baseline.
46+
* <p>As of Spring 7.0, this set of mocks is designed on a Servlet 6.1 baseline.
4747
*
4848
* <p>Useful for testing application controllers that access multipart uploads.
4949
* {@link MockMultipartFile} can be used to populate these mock requests with files.

spring-test/src/main/java/org/springframework/mock/web/MockServletContext.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@
6161
/**
6262
* Mock implementation of the {@link jakarta.servlet.ServletContext} interface.
6363
*
64-
* <p>As of Spring 6.0, this set of mocks is designed on a Servlet 6.0 baseline.
64+
* <p>As of Spring 7.0, this set of mocks is designed on a Servlet 6.1 baseline.
6565
*
66-
* <p>Compatible with Servlet 3.1 but can be configured to expose a specific version
67-
* through {@link #setMajorVersion}/{@link #setMinorVersion}; default is 3.1.
68-
* Note that Servlet 3.1 support is limited: servlet, filter and listener
66+
* <p>Compatible with Servlet 6.1 but can be configured to expose a specific version
67+
* through {@link #setMajorVersion}/{@link #setMinorVersion}; default is 6.1.
68+
* Note that some Servlet SPI support is limited: servlet, filter and listener
6969
* registration methods are not supported; neither is JSP configuration.
7070
* We generally do not recommend to unit test your ServletContainerInitializers and
7171
* WebApplicationInitializers which is where those registration methods would be used.
@@ -114,11 +114,11 @@ public class MockServletContext implements ServletContext {
114114

115115
private int majorVersion = 6;
116116

117-
private int minorVersion = 0;
117+
private int minorVersion = 1;
118118

119119
private int effectiveMajorVersion = 6;
120120

121-
private int effectiveMinorVersion = 0;
121+
private int effectiveMinorVersion = 1;
122122

123123
private final Map<String, RequestDispatcher> namedRequestDispatchers = new HashMap<>();
124124

spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockCookie.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* Extension of {@code Cookie} with extra attributes, as defined in
3232
* <a href="https://tools.ietf.org/html/rfc6265">RFC 6265</a>.
3333
*
34-
* <p>As of Spring 6.0, this set of mocks is designed on a Servlet 6.0 baseline.
34+
* <p>As of Spring 7.0, this set of mocks is designed on a Servlet 6.1 baseline.
3535
*
3636
* @author Vedran Pavic
3737
* @author Juergen Hoeller

spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockHttpServletRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
* is {@link Locale#ENGLISH}. This value can be changed via {@link #addPreferredLocale}
8282
* or {@link #setPreferredLocales}.
8383
*
84-
* <p>As of Spring 6.0, this set of mocks is designed on a Servlet 6.0 baseline.
84+
* <p>As of Spring 7.0, this set of mocks is designed on a Servlet 6.1 baseline.
8585
*
8686
* @author Juergen Hoeller
8787
* @author Rod Johnson

spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockHttpSession.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
/**
3737
* Mock implementation of the {@link jakarta.servlet.http.HttpSession} interface.
3838
*
39-
* <p>As of Spring 6.0, this set of mocks is designed on a Servlet 6.0 baseline.
39+
* <p>As of Spring 7.0, this set of mocks is designed on a Servlet 6.1 baseline.
4040
*
4141
* @author Juergen Hoeller
4242
* @author Rod Johnson

spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockMultipartHttpServletRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
* Mock implementation of the
4444
* {@link org.springframework.web.multipart.MultipartHttpServletRequest} interface.
4545
*
46-
* <p>As of Spring 6.0, this set of mocks is designed on a Servlet 6.0 baseline.
46+
* <p>As of Spring 7.0, this set of mocks is designed on a Servlet 6.1 baseline.
4747
*
4848
* <p>Useful for testing application controllers that access multipart uploads.
4949
* {@link MockMultipartFile} can be used to populate these mock requests with files.

0 commit comments

Comments
 (0)