When MockServerRestTemplateCustomizer and MockServerRestClientCustomizer
are used directly instead of via auto-configuration, it is necessary to
manually reset the MockRestServiceServer expectations between tests.
Closes gh-41848
Adds the following new properties:
- spring.application.pid
- spring.application.version
Refactors the ResourceBanner and the structured logging support to use
the new properties.
Closes gh-41604
- Deprecate Deprecate @MockBean and @SpyBean in favor of Spring
Framework 6.2's @MockitoBean and @MockitoSpy
- Migrate usages of @MockBean and @SpyBean to @MockitoBean and
@MockitoSpy
Signed-off-by: Jakob Wanger <jakobwanger@gmail.com>
See gh-39864
This commit updates MockitoTestExecutionListener to not handle mocks
as this is already done in the listener provided by the core framework,
and registration can only happen once.
Integration tests have been left as-is to validate that the presence
of both listeners doesn't have an unwanted side effect.
See gh-41177
Previously, we only looked at the OBJECT_TYPE_ATTRIBUTE on the
factory bean's definition. This did not work for situations
where the information's provided by the definition's target type
rather than the attribute.
Rather than manually considering the target type in addition to
the existing consideration of the attribute, we now ask the bean
factory for the type that will be produced by the factory bean
instead. This should insulate us from any changes and
enhancements in Framework in the future.
Fixes gh-40234
When Spring Framework builds a `RestClient` from a `RestTemplate`, it
will use any `UriTemplateHandler` that has been set on the
`RestTemplate` if the provided `UriTemplateHandler` is also a
`UriBuilderFactory`. Prior to this commit, Spring Boot's
`RestTemplateBuilder#rootUri` set a `UriTemplateHandler` on the created
`RestTemplate`, but it was not a `UriBuilderFactory` so `RestClient`
would not consider it.
With this commit, `RestTemplateBuilder#rootUri` sets a
`UriTemplateHandler` that is also a `UriBuilderFactory` so that any
root URI that is set on the `RestTemplateBuilder` will be applied to a
`RestClient` also.
Fixes gh-39317