Commit Graph

31788 Commits

Author SHA1 Message Date
Stéphane Nicoll
d26ee8f852 Merge pull request #34031 from ngocnhan-tran1996
* pr/34031:
  Fix link to MockMvcBuilders in reference documentation

Closes gh-34031
2024-12-06 09:44:01 +01:00
Tran Ngoc Nhan
47c66f4352 Fix link to MockMvcBuilders in reference documentation
See gh-34031
2024-12-06 09:43:41 +01:00
Juergen Hoeller
b5dd0a60f8 Restore lenient match against unresolvable wildcard
Closes gh-33982
2024-12-05 17:41:49 +01:00
Stéphane Nicoll
e618f922c2 Resolve nested placeholders with a fallback having one
This commit fixes a regression in PlaceHolderParser where it would no
longer resolve nested placeholders for a case where the fallback has a
placeholder itself.

This is due to the Part implementations and how they are structure, and
this commit makes sure that nested resolution happens consistently.

Closes gh-34020
2024-12-05 16:59:30 +01:00
Stéphane Nicoll
81a9f3d50b Restore public type for generated instance supplier of CGLIB proxy
This commit restores the signature of instance suppliers that are
exposing a CGLIB proxy. While calling the CGLIB proxy itself, and
making it available in BeanInstanceSupplier, is needed internally, such
type should not be exposed as it is an internal concern.

This was breaking InstanceSupplier.andThen as it expects the public
type of the bean to be exposed, not it's eventual CGLIB subclass.

Closes gh-33998
2024-12-05 15:48:49 +01:00
Sébastien Deleuze
c807fa597f Remove unnecessary HandshakeHandlerRuntimeHints
Those hints are not needed anymore as of Spring Framework 6.1.

Closes gh-34032
2024-12-05 15:44:09 +01:00
Juergen Hoeller
576f109987 Use JDK proxy for introduction interface without target
Closes gh-33985
2024-12-04 21:03:09 +01:00
Juergen Hoeller
384dc2a9b8 Consistently use singleton lock for FactoryBean processing
Closes gh-33972
2024-12-04 21:02:30 +01:00
Juergen Hoeller
edf7f3cd43 Polishing 2024-12-04 16:41:07 +01:00
Juergen Hoeller
58c64cba2c Consistent fallback to NoUpgradeStrategyWebSocketService
Closes gh-33970
2024-12-04 16:39:41 +01:00
Juergen Hoeller
307411631d Ignore SQLFeatureNotSupportedException on releaseSavepoint
Closes gh-33987
2024-12-04 16:38:57 +01:00
Sam Brannen
8d69370b95 Consider logical equality in AdvisedSupport.MethodCacheKey#equals
Prior to this commit, the equals() implementation in AdvisedSupport's
MethodCacheKey only considered methods to be equal based on an identity
comparison (`==`), which led to duplicate entries in the method cache
for the same logical method.

This is caused by the fact that AdvisedSupport's
getInterceptorsAndDynamicInterceptionAdvice() method is invoked at
various stages with different Method instances for the same method:

1) when creating the proxy
2) when invoking the method via the proxy

The reason the Method instances are different is due to the following.

- Methods such as Class#getDeclaredMethods() and
  Class#getDeclaredMethod() always returns "child copies" of the
  underlying Method instances -- which means that `equals()` should be
  used instead of (or in addition to) `==` whenever the compared Method
  instances can come from different sources.

With this commit, the equals() implementation in MethodCacheKey now
considers methods equal based on identity or logical equality, giving
preference to the quicker identity check.

See gh-32586
Closes gh-33915
2024-12-04 12:04:02 +01:00
Brian Clozel
d990449b0d Improve toString for reactive ScheduledTask
Prior to this commit, the reactive Scheduled tasks would be wrapped as a
`SubscribingRunnable` which does not implement a custom `toString`. This
would result in task metadata using the default Java `toString`
representation for those.

This commit ensures that the bean class name and method name are used
for this `toString`.

Closes gh-34010
2024-12-03 15:06:27 +01:00
rstoyanchev
15dcc449a2 Refine Reactor Netty handling of request without body
Closes gh-34003
2024-12-02 17:52:39 +00:00
Sam Brannen
320831b18a Test status quo for StaticMethodMatcherPointcut#matches invocations
This commit introduces a test which verifies how many times the
matches() method of a StaticMethodMatcherPointcut is invoked during
ApplicationContext startup as well as during actual method invocations
via the advice chain, which also indirectly tests the behavior of the
equals() implementation in AdvisedSupport.MethodCacheKey.

In addition, this commit revises BeanFactoryTransactionTests to assert
that a transaction is started for the setAge() method.

See gh-33915
2024-12-01 16:28:32 +01:00
Sam Brannen
172c8b2c35 Polish AOP tests 2024-12-01 15:32:03 +01:00
Sam Brannen
51956fad89 Test MockReset strategy for @⁠MockitoSpyBean
As a follow up to commit 0088b9c7f8, this commit introduces an
integration test which verifies that a spy created via @⁠MockitoSpyBean
using the MockReset.AFTER strategy is not reset between the refresh of
the ApplicationContext and the first use of the spy within a @⁠Test
method.

See gh-33941
See gh-33986
2024-11-29 11:27:02 +01:00
Sébastien Deleuze
ddec8d2653 Add missing @Contract annotation to ObjectUtils#isEmpty
Closes gh-33984
2024-11-28 15:17:02 +01:00
Sébastien Deleuze
1aede291bb Move Kotlin value class unboxing to InvocableHandlerMethod
Before this commit, in Spring Framework 6.2, Kotlin value class
unboxing was done at CoroutinesUtils level, which is a good fit
for InvocableHandlerMethod use case, but not for other ones like
AopUtils.

This commit moves such unboxing to InvocableHandlerMethod in
order to keep the HTTP response body support while fixing other
regressions.

Closes gh-33943
2024-11-27 16:39:26 +01:00
Sam Brannen
ea3bd7ae0c Polish BeanValidationBeanRegistrationAotProcessor[Tests]
The log message for a NoClassDefFoundError is now a DEBUG level message
handled like a TypeNotPresentException and similar to the following.

DEBUG: Skipping validation constraint hint inference for class
org.example.CustomConstraint due to a NoClassDefFoundError for
com.example.MissingType

See gh-33949
2024-11-27 12:53:51 +01:00
Stefano Cordio
9b0253e117 Skip runtime hint registration for constraint with missing dependencies
Prior to this commit, AOT processing for bean validation failed with a
NoClassDefFoundError for constraints with missing dependencies.

With this commit, the processing no longer fails, and a warning is
logged instead.

See gh-33940
Closes gh-33949

Co-authored-by: Sam Brannen <sam.brannen@broadcom.com>
2024-11-27 12:42:12 +01:00
Stéphane Nicoll
f3753e6d64 Merge pull request #33956 from CHOICORE
* pr/33956:
  Fix log level in PathMatchingResourcePatternResolver

Closes gh-33956
2024-11-26 20:04:25 +01:00
CHOICORE
41421d106b Fix log level in PathMatchingResourcePatternResolver
See gh-33956
2024-11-26 19:51:17 +01:00
Tran Ngoc Nhan
8c0ac8e062 Fix a typo in the filters documentation
Closes gh-33959
2024-11-26 16:09:45 +01:00
Sam Brannen
0088b9c7f8 Honor MockReset strategy for @⁠MockitoBean and @⁠MockitoSpyBean
Commit 6c2cba5d8a introduced a regression by inadvertently removing the
MockReset strategy comparison when resetting @⁠MockitoBean and
@⁠MockitoSpyBean mocks.

This commit reinstates the MockReset strategy check and introduces
tests for this feature.

Closes gh-33941
2024-11-26 11:54:46 +01:00
Sam Brannen
2b840ee7ef Upgrade to Gradle 8.11.1
Closes gh-33951
2024-11-24 14:27:39 +01:00
Sam Brannen
051f1dac24 Polish contribution
See gh-33950
2024-11-24 14:13:03 +01:00
Stefano Cordio
5e7b3a3bed Avoid infinite recursion in BeanValidationBeanRegistrationAotProcessor
Prior to this commit, AOT processing for bean validation failed with a
StackOverflowError for constraints with fields having recursive generic
types.

With this commit, the algorithm tracks visited classes and aborts
preemptively when a cycle is detected.

Closes gh-33950

Co-authored-by: Sam Brannen <sam.brannen@broadcom.com>
2024-11-24 14:09:48 +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
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
b9cf03f8f0 Construct consistent error messages in BeanOverrideBeanFactoryPostProcessor 2024-11-21 11:28:31 +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
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
3569cfe990 Reject static Bean Override fields for @⁠MockitoBean, @⁠TestBean, etc.
Closes gh-33922
2024-11-20 11:29:01 +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
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
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é
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
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
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
807e1e6126 Document support for varargs invocations in SpEL
Closes gh-33332
2024-11-18 11:54:22 +01:00
Stéphane Nicoll
5ac56bda87 Remove unnecessary workflow in maintenance branch 2024-11-18 11:52:08 +01:00
Sam Brannen
7196f3f554 Polish SpEL documentation 2024-11-18 11:38:20 +01:00