Commit Graph

30356 Commits

Author SHA1 Message Date
Juergen Hoeller 457bf9416c Configure individual timeouts for specific shutdown phases
Closes gh-32985
2024-06-10 11:00:47 +02:00
Stéphane Nicoll b7e4fa06c3 Merge branch '6.1.x' 2024-06-10 10:02:41 +02:00
Stéphane Nicoll a0eebca0cf Merge pull request #32993 from hlmg
* pr/32993:
  Fix typo

Closes gh-32993
2024-06-10 10:02:36 +02:00
hlmg c6c64e6fe7 Fix typo
See gh-32993
2024-06-10 10:00:37 +02:00
Stéphane Nicoll 536de9ac80 Allow MockitoBean to create a mock for a bean that does not exist
This commit aligns the by-type lookup for bean overrides with what was
done when a bean name is present. It now correctly generate a bean
name rather than failing because no bean of that type exists.

Closes gh-32990
2024-06-10 09:57:27 +02:00
Brian Clozel bc98410acf Merge branch '6.1.x' 2024-06-10 09:47:57 +02:00
Brian Clozel 0ca393c0dc Restrict memory allocation in ContentCachingRequestWrapper
Prior to this commit, the `ContentCachingRequestWrapper` could allocate
a `FastByteArrayOutputStream` block that was larger than the content
cache limit given as a consturctor argument. This was due to an
optimization applied in gh-31834 for allocating the right content cache
size when the request size is known.

Fixes gh-32987
2024-06-10 09:46:01 +02:00
Carlos Corbacho e95e4423bb Do not swallow exceptions on failing to release a savepoint
By swallowing the exception on failing to release a savepoint, we are hiding
client code from database errors that they may need to be aware of or handle.

e.g. if the connection is now dead when trying to release the savepoint, by
swallowing the exception here, client code has no way of knowing this now until
the next operation on the database, which will yield a confusing message about
the problem and obscures where the failure occurred as it will be in a different
part of their code that throws any exception.

Swallowing the exception here is also inconsistent with all the other database
calls in the Transaction Object, where we always raise an exception up and let
client code decide how to handle the error.
2024-06-09 13:08:57 +02:00
Brian Clozel 24997b3356 Merge branch '6.1.x' 2024-06-07 19:02:53 +02:00
Brian Clozel 6681394886 Stop observations for async requests in Servlet filter
Prior to this commit, the `ServerHttpObservationFilter` would support
async dispatches and would do the following:

1. start the observation
2. call the filter chain
3. if async has started, do nothing
4. if not in async mode, stop the observation

This behavior would effectively rely on Async implementations to
complete and dispatch the request back to the container for an async
dispatch. This is what Spring web frameworks do and guarantee.

Some implementations complete the async request but do not dispatch
back; as a result, observations could leak as they are never stopped.

This commit changes the support of async requests. The filter now
opts-out of async dispatches - the filter will not be called for those
anymore. Instead, if the application started async mode during the
initial container dispatch, the filter will register an AsyncListener to
be notified of the outcome of the async handling.

Fixes gh-32730
2024-06-07 19:01:57 +02:00
Sébastien Deleuze c39ce10619 Merge branch '6.1.x' 2024-06-07 18:42:10 +02:00
Sébastien Deleuze 172987c874 Ignore checkpointOnRefresh after restore
Closes gh-32978
2024-06-07 18:41:37 +02:00
Stéphane Nicoll 373cf30b75 Polish 2024-06-07 17:11:38 +02:00
Stéphane Nicoll 55a7a49863 Merge pull request #32941 from m4tt30c91
* pr/32941:
  Polish contribution
  Add support for specifying a read timeout for the reactive jdk client

Closes gh-32941
2024-06-07 17:08:49 +02:00
Stéphane Nicoll 329b53309a Polish contribution
See gh-32941
2024-06-07 17:06:28 +02:00
Matteo Cristoforo 916ed5c0a9 Add support for specifying a read timeout for the reactive jdk client
See gh-32941
2024-06-07 17:01:23 +02:00
Stéphane Nicoll 7916f74942 Review TCF cache support for bean override
This commit reviews how bean override support can influence the key of
an application context cached by the TCF. OverrideMetadata and its
subclasses now implement a proper equals/hashCode pair that is tested
in various scenarios.

Due to how the TCF operates, OverrideMetadata has to be computed in
two locations:

1. In a ContextCustomizerFactory, using the metadata in the enclosing
class if any. This determines whether a customizer is needed in the
first place. The computed set of unique metadata identifies the
customizer and participates in the application context cache's key.
2. In the TestExecutionListener so that it knows the override points
it has to process.

Parsing of the metadata based on a test class has been greatly
simplified and moved to OverrideMetadata proper as we don't need several
flavors. 1 and 2 are using the same algorithm with the former wrapping
that in a Set to compute a proper key.

BeanOverrideContextCustomizerEqualityTests provides a framework for
testing edge cases as we only care about whether the created
ContextCustomizer behaves correctly against the identity of another.

Closes gh-32884
2024-06-07 16:44:57 +02:00
Stéphane Nicoll 02517e5011 Polish
This commit reviews the structure of several classes to comply with
our guidelines. Also, rather than exposing a static method to configure
the context in a test, we call the high-level API directly.
2024-06-07 16:44:57 +02:00
Stéphane Nicoll 0165529d97 Align OverrideMetadata arguments and harmonize bean name
Rather than having to override the getBeanName method when there is one,
this commit moves it as a @Nullable argument. This makes sure that
equals and hashCode consistently use the bean name. getBeanName cannot
be final just yet as the test infrastructure overrides it.

Also, arguments are now ordered consistently, which improves code
readability and type signature.
2024-06-07 16:44:57 +02:00
Stéphane Nicoll 8b66eca932 Harmonize OverrideMetadata implementations
This commit makes sure that each OverrideMetadata implementation is
a top level class with a consistent name.
2024-06-07 16:44:57 +02:00
Brian Clozel e8c122c00a Fix MockCookie Partitioned support
See gh-31454
2024-06-07 14:49:15 +02:00
Sam Brannen 9cfd455dde Merge branch '6.1.x' 2024-06-07 14:19:38 +02:00
Thomas Deblock 47a5ebfde6 Support canEncode() for JAXBElement in Jaxb2XmlEncoder
Commit d7970e4ab8 introduced support for JAXBElement in
Jaxb2XmlEncoder's encodeValue() method; however, canEncode() still
returned false for a JAXBElement element type.

This commit revises canEncode() so that it returns true for an element
type that is assignable from JAXBElement.

See gh-30552
See gh-32972
Closes gh-32977
2024-06-07 14:13:59 +02:00
Sébastien Deleuze 20d23584f6 Merge branch '6.1.x' 2024-06-07 13:45:19 +02:00
Sébastien Deleuze 43a113f067 Polishing
See gh-32983
2024-06-07 13:45:09 +02:00
Sébastien Deleuze 8073f32ca6 Merge branch '6.1.x' 2024-06-07 13:36:39 +02:00
Sébastien Deleuze dc250e1cc1 Remove outdated copyright from index.adoc
Closes gh-32983
2024-06-07 13:35:21 +02:00
Sébastien Deleuze b442e0d3d5 Merge branch '6.1.x' 2024-06-07 11:44:36 +02:00
Sébastien Deleuze fe74fcfded Exclude node_modules from NoHttp checks
Closes gh-32980
2024-06-07 11:43:45 +02:00
Arjen Poutsma 35e8f1c423 Support queries in opaque URLs
Closes gh-32920
2024-06-07 11:11:43 +02:00
Brian Clozel 7fc4937199 Add Partitioned cookie attribute support for servers
This commit adds support for the "Partitioned" cookie attribute in
WebFlux servers and the related testing infrastructure.
Note, Undertow does not support this feature at the moment.

Closes gh-31454
2024-06-07 10:03:52 +02:00
Juergen Hoeller 2aabe238c6 Merge branch '6.1.x'
# Conflicts:
#	spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java
2024-06-06 20:47:02 +02:00
Juergen Hoeller 2451bd62b0 Polishing 2024-06-06 20:43:31 +02:00
Juergen Hoeller 624d6dd167 Expose actual result value for @CacheEvict condition
Closes gh-32960
2024-06-06 20:43:04 +02:00
Juergen Hoeller 0ea96b4806 Skip ajc-compiled aspects for ajc-compiled target classes
Includes defensive ignoring of incompatible aspect types.

Closes gh-32970
2024-06-06 20:42:07 +02:00
Sébastien Deleuze 7b9cbd7876 Add support for Kotlin BeanPostProcessor beans
This commit adds support for Kotlin BeanPostProcessor beans which should
be defined in a companion object and annotated with `@JvmStatic`.

Closes gh-32946
2024-06-06 19:23:25 +02:00
Simon Baslé 0758ae5ead Polishing: remove unused import 2024-06-06 16:55:12 +02:00
Simon Baslé d38e4d869f Better support for FactoryBeans in BeanOverrideBeanFactoryPostProcessor
This commit makes sure to account for FactoryBean names when registering
a bean override. In the case of ReplaceDefinition mode, if there is a
factory bean name, it is used to check singleton status and as the name
in the registrar.

Closes gh-32971
2024-06-06 15:49:40 +02:00
Alexej Timonin 416eff1b04 Fix typo in WebTestClient expectedXml
Closes gh-32969
2024-06-06 14:24:40 +02:00
Brian Clozel 52af43d6d2 Handle ResponseStatusException thrown by MVC functional endpoints
Prior to this commit, exceptions thrown by MVC functional handlers would
not be considered by `ExceptionHandlerExceptionResolver`. This means
that common exceptions would not be handled consistently between
annotated and functional handlers. This is true, for example, for all
`ProblemDetails`-related exception handling.

While MVC functional and annotation models are separate concepts,
WebFlux has a different error handling model that processes all
exceptions in a central place.

This commit ensures that `ExceptionHandlerExceptionResolver` considers
exceptions thrown by handlers of type `HandlerFunction<?>` and processes
them accordingly.

Closes gh-32689
2024-06-06 14:21:17 +02:00
Arjen Poutsma 859b97ce05 Revert "Do not read Map in FormHttpMessageConverter"
This reverts commit 726ac9110c and
80faa94afc.

See gh-32826
2024-06-06 12:39:18 +02:00
Stéphane Nicoll c127421e38 Revert "Disable warnings for deprecated for removal in Eclipse"
We should not disable such warnings
2024-06-06 11:44:09 +02:00
Sébastien Deleuze d39fe9a444 Merge branch '6.1.x' 2024-06-06 10:06:24 +02:00
Sébastien Deleuze c28a0d5627 Add missing hints for Hibernate `@TenantId`
Closes gh-32967
2024-06-06 10:04:35 +02:00
Juergen Hoeller 09c1081645 Merge branch '6.1.x' 2024-06-06 08:55:16 +02:00
Juergen Hoeller 61d045ce52 Polishing 2024-06-06 08:54:37 +02:00
Juergen Hoeller c0bef2c693 Lazily start resources on demand (if necessary outside of lifecycle)
See gh-32945
2024-06-06 08:54:32 +02:00
Stéphane Nicoll 5706ee1762 Merge branch '6.1.x' 2024-06-06 08:08:47 +02:00
Stéphane Nicoll c3a0eaa95e Merge pull request #32966 from ypyf
* pr/32966:
  Use HttpStatusCode consistently in reference guide

Closes gh-32966
2024-06-06 08:08:45 +02:00
ypyf e12d1259d1 Use HttpStatusCode consistently in reference guide
See gh-32966
2024-06-06 08:06:33 +02:00