Replace explicit casts with pattern variables to improve readability and
remove redundancy.
See gh-48297
Signed-off-by: geopark021 <geobrown021@gmail.com>
Starting from Spring Boot 4, the RestTemplateBuilder and
RestTemplateCustomizer classes have been moved from the
org.springframework.boot.web.client package to the
org.springframework.boot.restclient package. This commit updates
the javadoc links in the reference documentation to match
Signed-off-by: Antoine Rey <antoine.rey@free.fr>
See gh-48295
Previously, spring-boot-restclient was a required dependency of
spring-boot-resttestclient. This had the unwanted side-effect of
increasing the risk of the test classpath enabling auto-configuration
for RestClient.Builder when it was main code that needed such a bean.
This could lead to integration tests passing but the application
itself failing to start when its run through its main method.
This commit makes spring-boot-restclient an optional dependency of
spring-boot-resttestclient. As a result, a dependency on
spring-boot-resttestclient is no longer sufficient to auto-configure
a RestClient.Builder bean, although it is still sufficient to
auto-configure a RestTestClient bean.
Those that wish to use TestRestTemplate rather than migrating to
RestTestClient will now have to add a dependency on
spring-boot-restclient. This makes it presence more obvious. It now
has to be declared directly rather than being somewhat hidden due to
being pulled in transitively. The hope is that this will reduce the
chances of the dependency being accidentially on the test classpath
when main code requires it to be on the runtime classpath.
Fixes gh-48253
This commit adapts SpringBootTest when it has to use a main method to
detect package private main method as well as main methods that do not
have any arguments.
Closes gh-48271
The ProblemDetailXmlMapperBuilderCustomizer applied the wrong
ProblemDetail mixin for the Jackson XmlMapper. Namely the
ProblemDetailJacksonMixin, which is intended for JSON.
Now the ProblemDetailJacksonXmlMixin is used instead.
The corresponding test also tested for the wrong XML output,
which has been adjusted.
Fixes gh-48222
Signed-off-by: Maurice Zeijen <mzeijen@bol.com>