Commit Graph

31590 Commits

Author SHA1 Message Date
Brian Clozel
5e08a88219 Upgrade Servlet mock classes to Servlet 6.1
This commit upgrades our Mock Servlet classes for Servlet 6.1 support:

* the read/write `ByteBuffer` variants for `ServletInputStream` and
  `ServletOutputStream` were not added as the default implementation
  matches well the testing use case.
* Implement the session accessor with a simple lambda. Our mocks do not
  simulate the scheduling of request/response processing on different
  threads.
* Ensure that the response content length can only be written before the
  response is committed. Calling those methods after commit is a no-op,
  per specification.

Closes gh-33749
2024-11-22 17:07:44 +01:00
Brian Clozel
3b65506c13 Use ByteBuffer support in ServletHttpHandlerAdapter
As of Servlet 6.1, the `ServletInputStream` and `ServletOutputStream`
offer read and write variants based on `ByteBuffer` instead of byte
arrays. This can improve performance and avoid memory copy for I/O
calls.

This was already partially supported for some servers like Tomcat
through specific adapters. This commit moves this support to the
standard `ServletHttpHandlerAdapter` and makes it available for all
Servlet 6.1+ containers.

Closes gh-33748
2024-11-22 15:08:02 +01:00
Brian Clozel
f5ff84ab7b Merge branch '6.2.x' 2024-11-21 14:35:52 +01:00
Johnny Lim
1910d32405 Replace TestObservationRegistryAssert.assertThat() with Assertions.assertThat()
See https://github.com/micrometer-metrics/micrometer/pull/5551

Closes gh-33929
2024-11-21 14:35:32 +01:00
Brian Clozel
50061dae35 Merge branch '6.2.x' 2024-11-21 14:25:41 +01:00
sonallux
986ffc2072 Use full URI for URI template keyvalue with RestClient
Prior to this commit, `RestClient` would not use the full URI created by
the uri handler as a template request attribute.
This means that HTTP client observations would not contain the base URI
in recorded observations as the uri template keyvalue.

Closes gh-33928
2024-11-21 14:23:01 +01:00
Sam Brannen
74c48d8132 Merge branch '6.2.x' 2024-11-21 11:34:55 +01:00
Sam Brannen
b9cf03f8f0 Construct consistent error messages in BeanOverrideBeanFactoryPostProcessor 2024-11-21 11:28:31 +01:00
Sam Brannen
ff5529bbae Merge branch '6.2.x' 2024-11-21 09:53:46 +01:00
Sam Brannen
08a789cee9 Honor @⁠Fallback semantics for Test Bean Overrides
Closes gh-33924
2024-11-21 09:50:17 +01:00
Sam Brannen
082a8cfae3 Merge branch '6.2.x' 2024-11-20 16:51:30 +01:00
Sam Brannen
7a6e401d17 Document visibility requirements for Bean Overrides
This commit makes it clear that there are no visibility requirements
for @⁠TestBean fields or factory methods as well as @⁠MockitoBean or
@⁠MockitoSpyBean fields.

Closes gh-33923
2024-11-20 16:49:52 +01:00
Sam Brannen
ba4105d4f0 Merge branch '6.2.x' 2024-11-20 11:30:48 +01:00
Sam Brannen
3569cfe990 Reject static Bean Override fields for @⁠MockitoBean, @⁠TestBean, etc.
Closes gh-33922
2024-11-20 11:29:01 +01:00
Brian Clozel
f548da8a8d Temporarily ignore webflux tomcat integration tests
After our Tomcat 11 upgrade, several WebFlux integration tests with
Tomcat started failing because Tomcat considers some chunked client
requests as invalid.

While we're investigating this, this commit temporarily disables the
relevant tests.

See gh-33917
2024-11-19 18:11:24 +01:00
Brian Clozel
4b3e192ca1 Upgrade to Tomcat 11.0
This commit upgrades the baseline to Tomcat 11.0 and adapts to the
following behavior changes in Tomcat:

* the MimeHeaders#clear method has been removed
* expired cookies do not set "Max-Age=0" anymore
* responses to HEAD requests do not write the "Content-Length" header
  anymore.

Closes gh-33916
2024-11-19 18:11:24 +01:00
Brian Clozel
c28cbfd582 Upgrade Servlet, JSP and WebSocket API versions
This commit updates the Spring Framework baseline for the Servlet, JSP
and WebSocket APIs.
This also removes the previously deprecated APIs in JSP `PageContext`
and guards against the deprecation of the `PushBuilder` API.

See gh-33918
2024-11-19 18:11:18 +01:00
Simon Baslé
1fb1801285 Merge branch '6.2.x' 2024-11-19 16:59:42 +01:00
Simon Baslé
8b66d3c79a Upgrade Undertow-servlet/websockets to 2.3.18.Final
Follow up to 35b452b4 which only upgraded undertow-core.
2024-11-19 16:59:04 +01:00
Sam Brannen
a7547cd311 Merge branch '6.2.x' 2024-11-19 13:33:53 +01:00
Sam Brannen
a3c132c442 Polish XmlExpectationsHelper[Tests] 2024-11-19 13:33:20 +01:00
boiarshinov
91791c1756 Fail with full description for XML diff in XmlExpectationsHelper
Closes gh-33827
2024-11-19 13:23:58 +01:00
Sam Brannen
e69ae513b9 Merge branch '6.2.x' 2024-11-19 13:22:08 +01:00
Sam Brannen
dd92eac3ad Refer to message "receipt" instead of "reception" 2024-11-19 13:18:12 +01:00
Sam Brannen
874f056984 Polishing 2024-11-19 13:18:12 +01:00
Tran Ngoc Nhan
b77db64459 Fix typos and link in Observability documentation
Closes gh-33910
2024-11-19 12:12:01 +01:00
Simon Baslé
8d3d0e7ae5 Merge branch '6.2.x' 2024-11-18 16:37:21 +01:00
Simon Baslé
d597d2e159 Fix WebClientIntegrationTest#applyAttributesToNativeRequest flaky test
For Reactor Netty and Reactor Netty 2 (with Netty 5), the attributes are
stored as an `Attribute` on the netty channel. Reactor Netty replaces
the channel with a static placeholder one once the request has been
processed and as such, capturing the native request in the test will
lead to asserting an attribute-less channel.

This change switches to capturing the `Attribute` itself, which is a
value-holder that can be asserted later on.

Closes gh-33909
2024-11-18 16:30:16 +01:00
Sam Brannen
8d4a8cbbe5 Merge branch '6.2.x' 2024-11-18 14:16:20 +01:00
Sam Brannen
f5c3f3522e Simplify @⁠EnumSource usage 2024-11-18 14:12:13 +01:00
Sam Brannen
d421f61a4a Polish @⁠DurationFormat Javadoc and tests 2024-11-18 14:12:13 +01:00
Tran Ngoc Nhan
883254e1d0 Polish
- Update copyright header.
- Consistent use of "SIMPLE" link text for Style#SIMPLE in javadoc.

Closes gh-33883
2024-11-18 13:40:23 +01:00
Brian Clozel
409bf5f889 Merge branch '6.2.x' 2024-11-18 11:57:43 +01:00
Brian Clozel
e919d0adcc Reflect well-known MediaTypes intent in Javadoc
Closes gh-33754
2024-11-18 11:57:22 +01:00
Brian Clozel
4aafae1c33 Reflect well-known HttpHeaders intent in Javadoc
Closes gh-33886
2024-11-18 11:57:15 +01:00
Brian Clozel
afef439c1f Temporarily disable flaky integration test
See gh-33909
2024-11-18 11:57:09 +01:00
Sam Brannen
00831a06ea Merge branch '6.2.x' 2024-11-18 11:55:12 +01:00
Sam Brannen
807e1e6126 Document support for varargs invocations in SpEL
Closes gh-33332
2024-11-18 11:54:22 +01:00
Stéphane Nicoll
e81fe79e2b Merge branch '6.2.x' 2024-11-18 11:52:42 +01:00
Stéphane Nicoll
5ac56bda87 Remove unnecessary workflow in maintenance branch 2024-11-18 11:52:08 +01:00
Sam Brannen
e34189a793 Merge branch '6.2.x' 2024-11-18 11:41:07 +01:00
Sam Brannen
7196f3f554 Polish SpEL documentation 2024-11-18 11:38:20 +01:00
Sam Brannen
a12d40e10b Fix SpEL examples in reference guide
Closes gh-33907
2024-11-18 11:37:30 +01:00
Sam Brannen
cea5d9e3d1 Merge branch '6.2.x' 2024-11-17 15:16:16 +01:00
Sam Brannen
7f7819329c Update copyright headers
See gh-33903
2024-11-17 15:14:16 +01:00
KNU-K
2494ecb47b Simplify utility implementations in spring-core
Closes gh-33903
2024-11-17 15:08:30 +01:00
Sam Brannen
def2d033a2 Merge branch '6.2.x' 2024-11-17 12:24:26 +01:00
Sam Brannen
241b8b48f2 Clarify requirements for AOP around advice regarding MethodInterceptor
Closes gh-33901
2024-11-17 12:23:01 +01:00
Sam Brannen
173084f81a Polish Spring AOP documentation 2024-11-17 12:21:16 +01:00
Sam Brannen
7f8102a4cd Merge branch '6.2.x' 2024-11-17 11:46:50 +01:00