mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-27 12:39:03 +00:00
Move RestTestClientBuilderCustomizer to spring-boot-test
Relocate `RestTestClientBuilderCustomizer` to `spring-boot-test` and break the direct link to web-server by making use of `spring.factories` and the new `BaseUrlProviders` class. See gh-46356
This commit is contained in:
+1
-1
@@ -189,7 +189,7 @@ include-code::MyRandomPortWebTestClientTests[]
|
||||
|
||||
TIP: javadoc:org.springframework.test.web.reactive.server.WebTestClient[] can also used with a xref:testing/spring-boot-applications.adoc#testing.spring-boot-applications.with-mock-environment[mock environment], removing the need for a running server, by annotating your test class with javadoc:org.springframework.boot.webflux.test.autoconfigure.AutoConfigureWebTestClient[format=annotation] from `spring-boot-webflux-test`.
|
||||
|
||||
The `spring-boot-web-server-test` modules also provides a javadoc:org.springframework.boot.web.server.test.client.TestRestTemplate[] facility:
|
||||
The `spring-boot-retclient-test` modules also provides a javadoc:org.springframework.boot.restclient.test.TestRestTemplate[] facility:
|
||||
|
||||
include-code::MyRandomPortTestRestTemplateTests[]
|
||||
|
||||
|
||||
+2
@@ -43,6 +43,8 @@ include-code::MyOutputCaptureTests[]
|
||||
== TestRestTemplate
|
||||
|
||||
javadoc:org.springframework.boot.test.web.client.TestRestTemplate[] is a convenience alternative to Spring's javadoc:org.springframework.web.client.RestTemplate[] that is useful in integration tests.
|
||||
It's provided by the `spring-boot-restclient-test` module.
|
||||
|
||||
You can get a vanilla template or one that sends Basic HTTP authentication (with a username and password).
|
||||
In either case, the template is fault tolerant.
|
||||
This means that it behaves in a test-friendly way by not throwing exceptions on 4xx and 5xx errors.
|
||||
|
||||
Reference in New Issue
Block a user