Commit Graph

31897 Commits

Author SHA1 Message Date
rstoyanchev
b9efa91ecc Polishing in client tests 2025-01-08 13:46:15 +00:00
rstoyanchev
3f7d3cbbd3 Add chaining methods to ClientHttpRequestInterceptor
See gh-34169
2025-01-08 13:46:15 +00:00
Brian Clozel
c970a6052a Merge branch '6.2.x' 2025-01-08 14:40:41 +01:00
Brian Clozel
9173e13f74 Document that http.client.requests measure the entire HTTP exchange
Closes gh-34201
2025-01-08 14:39:50 +01:00
Brian Clozel
396f04a3b9 Remove outdated TODO task 2025-01-08 13:49:16 +01:00
Brian Clozel
7a71d7c3a8 Merge branch '6.2.x' 2025-01-08 11:19:49 +01:00
Brian Clozel
84be0d85b4 Refine location checks for PathResource
This commit ensures that checks for PathResource locations are skipped
because this resource implementation will always resolve under the
current location.

Closes gh-34167
2025-01-08 10:55:22 +01:00
Brian Clozel
774231db1e Merge branch '6.2.x' 2025-01-07 22:15:16 +01:00
Brian Clozel
c971276f34 Refine default filtered headers for web data binding
Prior to this commit, HTTP request data binding had been improved to
filter out by default the "Priority" header in #34039.

This commit extends the set of filtered header names with:
"Accept", "Authorization", "Connection", "Cookie", "From", "Host",
"Origin", "Priority", "Range", "Referer", "Upgrade".

If an application wishes to let those header be bound, it will need to
configure the binder and replace the default header predicate by calling
`setHeaderPredicate`.

Closes gh-34182
2025-01-07 22:11:41 +01:00
Sam Brannen
e8788c7e3e Merge branch '6.2.x' 2025-01-07 17:32:42 +02:00
Sam Brannen
cd2fbb1ec5 Properly resolve @⁠TestBean factory method within class hierarchy
Prior to this commit, the search algorithm used to locate a @⁠TestBean
factory method within a test class hierarchy incorrectly found factory
methods declared in subclasses or nested test classes "below" the class
in which the @⁠TestBean field was declared. This resulted in "duplicate
bean override" failures for @⁠TestBean overrides which are clearly not
duplicates but rather "overrides of an override".

This commit ensures that @⁠TestBean factory method resolution is
consistent in type hierarchies as well as in enclosing class
hierarchies (for @⁠Nested test classes) by beginning the search for a
factory method in the class which declares the @⁠TestBean field.

Closes gh-34204
2025-01-07 17:20:52 +02:00
Brian Clozel
1b7ccbce2a Deprecate PathResource variant
This commit deprecates the `PathResource` implementation variant in
favor of `FileSystemResource`. This was already pointing to
`FileSystemResource` as of Spring Framework 5.1 and we now consider this
variant as deprecated.

Closes gh-34206
2025-01-07 16:09:37 +01:00
Sébastien Deleuze
e184860ca4 Use "nullness" instead of "nullability"
This commit updates the null-safety documentation to use "nullness"
instead of "nullability" in order to be consistent with the JSpecify
documentation.

See gh-28797
2025-01-07 15:03:05 +01:00
Sam Brannen
a3594e7207 Merge branch '6.2.x' 2025-01-07 11:53:04 +02:00
Sam Brannen
e8745522fc Polishing 2025-01-07 11:52:33 +02:00
Sébastien Deleuze
96f7d50abf Remove unneeded NullAway warning suppressions
This commit removes warning suppressions related to uber/NullAway#1113
which is now fixed.

See gh-28797
2025-01-07 09:57:56 +01:00
Sébastien Deleuze
2697aea15f Upgrade NullAway to 0.12.3
This commit also leverages the new OnlyNullMarked flag.

See gh-28797
2025-01-07 09:57:56 +01:00
Brian Clozel
284f6057cc Merge branch '6.2.x' 2025-01-07 09:56:26 +01:00
Brian Clozel
2bfb283c91 Update CONTRIBUTING guidelines for DCO
The CLA process has been replaced with a DCO, this commit updates the
CONTRIBUTING guidelines accordingly.
See https://spring.io/blog/2025/01/06/hello-dco-goodbye-cla-simplifying-contributions-to-spring
2025-01-07 09:55:36 +01:00
Brian Clozel
68833e43aa Skip DCO sign-off for organization members
See https://github.com/dcoapp/app
2025-01-07 09:22:08 +01:00
Brian Clozel
2cdc406e71 Merge branch '6.2.x' 2025-01-07 09:04:05 +01:00
Mattias-Sehlstedt
50b1fb0b15 Change the description for the uri client request observation
This commit describes what parts that are removed from the URI template
keyvalue.

Closes: gh-34116
Signed-off-by: Mattias-Sehlstedt <60173714+Mattias-Sehlstedt@users.noreply.github.com>
2025-01-07 09:02:25 +01:00
Brian Clozel
e8e722fb59 Allow multiple executions of ClientHttpRequestInterceptors
Prior to this commit, an `ClientHttpRequestInterceptor` implementation
could delegate HTTP calls to the next `ClientHttpRequestExecution` only
once. Calling the execution would advance to the next interceptor in the
chain in a mutable fashion for the entire lifetime of the current
exchange.

This commit changes the implementation of `InterceptingClientHttpRequest`
so that a `ClientHttpRequestInterceptor` implementation can call
`ClientHttpRequestExecution#execute` multiple times.

This is especially useful for interceptors in case they want to issue
other HTTP requests without needing another `RestTemplate` or
`RestClient` instance provided out of band.

Closes gh-34169
2025-01-06 19:29:09 +01:00
Sébastien Deleuze
292a3a4895 Refine spring-aop arguments nullness
See gh-28797
2025-01-06 16:52:34 +01:00
Sébastien Deleuze
5e9b07b56d Use JSpecify annotations in org.aopalliance.*
See gh-28797
2025-01-06 16:52:34 +01:00
rstoyanchev
e2ea87fe4f Merge branch '6.2.x' 2025-01-06 12:13:56 +00:00
rstoyanchev
a985b73939 Improve logging in ReactiveTypeHandler
See gh-34188
2025-01-06 12:13:29 +00:00
rstoyanchev
6ec7dcf2c1 Synchronize in WebAsyncManager onError/onTimeout
On connection loss, in a race between application thread and onError
callback trying to set the DeferredResult and dispatch, the onError
callback must not exit until dispatch completes. Currently, it may do
so because the DeferredResult has checks to bypasses locking or even
trying to dispatch if result is already set.

Closes gh-34192
2025-01-06 12:06:43 +00:00
rstoyanchev
d94e04d97a Minor refactoring in WebAsyncManager
There is no need to set the DeferredResult from WebAsyncManager in an
onError notification because it is already done from the Lifecycle
interceptor in DeferredResult.

See gh-34192
2025-01-06 12:06:43 +00:00
rstoyanchev
5a44897c55 Polishing in WebAsyncManager
See gh-34192
2025-01-06 12:06:43 +00:00
Sam Brannen
8bba4f641f Update copyright headers to 2025 2025-01-05 17:02:14 +02:00
Sam Brannen
bc499df6ce Merge branch '6.2.x' 2025-01-05 17:01:12 +02:00
Sam Brannen
181db1db75 Update copyright headers to 2025 2025-01-05 17:00:47 +02:00
Sam Brannen
2eede7ad1c Update Eclipse code template to use "@⁠since 7.0" 2025-01-05 16:57:02 +02:00
Sam Brannen
4345acd7b9 Merge branch '6.2.x' 2025-01-05 12:29:50 +02:00
Sam Brannen
138bdc597d Upgrade to AssertJ 3.27.2 2025-01-05 12:28:23 +02:00
Sam Brannen
7b1cdb5efb Merge branch '6.2.x' 2025-01-05 12:18:52 +02:00
Sam Brannen
ef4f1f0a71 Ensure @⁠BeanOverride in subclass takes precedence over superclass
Prior to this commit, a @⁠BeanOverride (such as @⁠TestBean) for a
specific target bean which was declared in a superclass always took
precedence over a bean override for the same target bean in a subclass,
thereby rendering the bean override configuration in the subclass
useless. In other words, there was no way for a test class to override
a bean override declared in a superclass.

To address that, this commit switches from direct use of
ReflectionUtils.doWithFields() to a custom search algorithm that
traverses the class hierarchy using tail recursion for processing
@⁠BeanOverride fields (delegating now to
ReflectionUtils.doWithLocalFields() in order to continue to benefit
from the caching of declared fields in ReflectionUtils).

Closes gh-34194
2025-01-04 18:27:05 +02:00
Sam Brannen
51b89743e1 Polishing 2025-01-04 18:12:13 +02:00
Sam Brannen
69ef885b68 Merge branch '6.2.x' 2025-01-04 15:59:47 +02:00
Sam Brannen
019f76468b Revise TestBeanForInheritanceIntegrationTests
Amongst other refinements, this commit ensures that the "anotherBean"
use case is actually tested.
2025-01-04 14:16:59 +02:00
Sébastien Deleuze
57c0d95007 Fix detection of JSpecify annotations on parameters
See gh-28797
2025-01-03 17:29:49 +01:00
Stéphane Nicoll
f136e27ccf Merge branch '6.2.x' 2025-01-03 16:54:32 +01:00
Stéphane Nicoll
f802c0cf24 Restore use of MethodSource 2025-01-03 16:53:54 +01:00
Sam Brannen
99bcd3a845 Remove unused code 2025-01-03 17:43:17 +02:00
Sam Brannen
e26c161ae9 Clean up warnings 2025-01-03 17:42:57 +02:00
Sam Brannen
087641c508 Merge branch '6.2.x' 2025-01-03 17:29:14 +02:00
Sam Brannen
0da4ae96b4 Rename internal MockitoBeans class to MockBeans
This is a prerequisite for gh-33925 which will introduce a public
@MockitoBeans container annotation in the same package.
2025-01-03 17:26:45 +02:00
Sam Brannen
2ba0022704 Polishing 2025-01-03 17:26:45 +02:00
Stéphane Nicoll
c59ca087b4 Backport tests for exact match resolution
See gh-34124

(cherry picked from commit 898d3ec86a)
2025-01-03 17:10:17 +02:00