Commit Graph
21 Commits
Author SHA1 Message Date
Yanming Zhou 7522f679fd Inject Customizers as ObjectProvider to keep consistency
See gh-50909

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2026-07-14 11:23:34 +02:00
Andy Wilkinson add52b6ccd Merge branch '3.5.x' into 4.0.x
Closes gh-50439
2026-05-14 15:02:24 +01:00
Andy Wilkinson e8cea82772 Don't require …TestAutoConfiguration classes in imports file
See gh-48822
2026-01-15 12:01:46 +00:00
Andy Wilkinson bd4c43bf53 Make s-b-restclient test autoconfigs package-private
Fixes gh-48820
2026-01-15 11:54:57 +00:00
Andy Wilkinson e51fb2f8f0 Merge branch '3.5.x' into 4.0.x
Closes gh-48822
Fixes gh-48819
2026-01-14 11:25:01 +00:00
Stéphane Nicoll e9db595c67 Restore TestRestTemplate#getRootUri
This commit adapts TestRestTemplate#getRootUri to the recently
introduced LocalTestWebServer. The behavior invokes the
UriTemplateHandler to provide the value. If the implementation expands
full URL, then it will provide the expected behavior. If not, it should
return the empty string as before.

Closes gh-48330
2025-11-28 14:44:50 +01:00
Andy Wilkinson 3e82ede609 Require spring-boot-restclient dependency to use TestRestTemplate
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
2025-11-25 14:38:33 +00:00
Andy Wilkinson 578b199b6d Merge branch '3.5.x'
Closes gh-47860
2025-10-29 10:25:10 +00:00
Andy Wilkinson bf8e0c45a8 Allow customizations of default customizers to be overridden
Previously, the default client and server HTTP message converter
customizers were ordered with lowest precedence. This made it
impossible to guarantee that another customizer would be able to go
after the default customizers, preventing their customizations from
being reliably overridden.

This commit updates the definitions of the default customizers to
order them at 0. This allows additional customizers to be ordered
either before or after them. Usage of the customizers is now always
ordered (previously Spring MVC's was not).

See gh-47798
2025-10-27 12:41:31 +00:00
Andy Wilkinson aa95282290 Polish @since tags
Closes gh-47779
2025-10-23 12:48:58 +01:00
Varun Patni f84b17c751 Migrate from Dokkatoo to Dokka
This commit migrates from Dokkatoo to Dokka for generation of Kotlin
API documentation.

See gh-47706

Signed-off-by: Varun Patni <varun.patni1@gmail.com>
2025-10-22 15:50:29 +01:00
Stéphane Nicoll aceaee89ee Polish "Replace BaseUrl with LocalTestWebServer"
See gh-47680
2025-10-21 11:08:48 +02:00
Phillip Webb 41a399c5ae Replace BaseUrl with LocalTestWebServer
Replace `BaseUrl` and `BaseUrlProvider` provider code with a more
targeted `LocalTestWebServer` class.

The `LocalTestWebServer` can be used to obtain the url of the locally
running server, or provide `UriBuilderFactory` or `UriBuilder`
instances base on it.

This commit also updates the MockMVC HTML Unit auto-configuration to
directly use `localhost` as the base URL.

Closes gh-47680
2025-10-20 17:44:51 -07:00
Phillip Webb 77f207a079 Simplify BaseUrl code and cache resolved URLs
See gh-47680
2025-10-17 19:28:18 -07:00
Moritz Halbritter 04aefab683 Add nullability annotations to tests in module/spring-boot-resttestclient
See gh-47263
2025-10-13 13:44:25 +02:00
Moritz Halbritter 56795f944a Improve null-safety of module/spring-boot-resttestclient
See gh-47263
2025-10-13 13:44:25 +02:00
Andy Wilkinson e6e0db04be Polish documentation following relocation of TestRestTemplate
See gh-46356
See gh-47322
2025-10-10 14:29:48 +01:00
Andy Wilkinson 5afbec7033 Correct package in spring-boot-resttestclient to match module name
See gh-46356
See gh-47322
2025-10-10 12:50:48 +01:00
Andy Wilkinson 630797fa9b Merge branch '3.5.x'
Closes gh-47475
2025-10-10 08:42:21 +01:00
Phillip Webb 02b2d03acf Rationalize HTTP client configuration properties
Simplify HTTP client configuration properties by sharing common
settings for both blocking and reactive clients.

The `ClientHttpRequestFactorySettings` and `ClientHttpConnectorSettings`
have been merged to a single `HttpClientSettings` class. Properties
to configure common settings are available under:

	`spring.http.clients`

Blocking and reactive settings have been moved to
`spring.http.clients.blocking` and `spring.http.clients.reactive`. With
currently only the factory/connector being configurable.

HTTP Service Client properties have also been rationalized under a
`spring.http.serviceclient.<group-name>`. Support for properties that
apply to all service clients and all Rest/Web Clients have been removed.

Support for `ApiVerionInserter` beans has also been removed in favor of
configuring the service group or builders directly.

Closes gh-47398
2025-10-09 22:18:53 -07:00
Andy WilkinsonandPhillip Webb 9eb05ebb10 Create spring-boot-resttestclient and spring-boot-webtestclient modules
Create `spring-boot-resttestclient` and `spring-boot-webtestclient`
modules to hold test client auto-configuration and `TestRestTemplate`
code.

Previous these classes were contained in `spring-boot-resetclient-test`
and `spring-boot-webclient-test` which was incorrect since the `-test`
modules should hold code need to test the given modules, not supporting
test classes.

See gh-46356

Co-authored-by: Phillip Webb <phil.webb@broadcom.com>
2025-10-09 22:12:39 -07:00