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
Previously, if multiple WebHandler beans were present, the auto-config
for WebTestClient fail to identify a suitable candidate as it expects
to only have such a bean.
This commit updates the logic to look for a well-known bean name that
WebFlux uses, and clarify the exception message to state that a bean
with a given name is expected to be found.
The exception message has been further refined to mention that, if
such a bean is not present, then a MockMVc-compatible ApplicationContext
should be available (i.e. WebApplicationContext).
Closes gh-47617
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>