Introduce a strategy to `WebApplicationType` to allow modules to
implement deduction logic.
Prior to this commit, modules played no part in deducing the
`WebApplicationType`. This meant that a user with `spring-webflux`
for client purposes would deduce `REACTIVE` despite no
`spring-boot-webflux` module being present.
The following deduction logic order is now implemented:
1) If the `spring-boot-webmvc` module is being used and Spring MVC
classes are found then `SERVLET` is used.
2) If the `spring-boot-webflux` module is being used and Spring WebFlux
classes are found then `REACTIVE` is used.
3) If `spring-web` is found and servlet classes are available then
`SERVLET` is used.
4) If none of the above are satisfied, `NONE` is used.
This commit also updates `SpringBootTestContextBootstrapper` to use
the same deduction logic.
Fixes gh-48517
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
Change `spring-boot-tomcat-runtime` and `spring-boot-jetty-runtime`
into starter POMs and reduce the number of dependencies needed for
`spring-boot-tomcat` and `spring-boot-jetty`.
The runtime starters provide only the jars required to run the
embedded server along with the module jar itself (excluding transitive
dependencies) and `spring-boot-webserver` (excluding transitive
dependencies).
The build setup required for an executable jar is slightly different
between Maven and Gradle. For Maven, the regular module is put in the
`provided` scope. For Gradle, the regular module remains in main
configuration and the runtime jar is put in the `providedRuntime`
configuration. The reference documentation has been updated to
show how to configure things if starters are being used.
Manual testing has been performed to ensure that wars build with Maven
and Gradle work with both Tomcat and Jetty in both deployed and
`java -jar` modes.
Closes gh-48175
This commit adds spring-boot-starter-micrometer-metrics and
spring-boot-starter-micrometer-metrics-test.
It also uses the new starters in smoke tests and in other starters,
which depended on spring-boot-micrometer-metrics.
Closes gh-48161
This commit harmonizes dependencies used in smoke tests, in particular
by using the starters consistently. This serves not only as a validation
but also a showcase of how to use them.
Closes gh-47836
This commit is a follow-on from 14c5ac0. It fixes a similar problem
with @AutoConfigureJsonTesters that is also apparent when using
@JsonTest.
Fixes gh-47811
The org.springframework.boot.test-auto-configuration plugin has been
added so that test auto-configuration imports files are checked at
build time, hopefully catching this sort of problem earlier in the
future.
Closes gh-47812
Previously, if Actuator was being used in a non-web app such that
spring-web was not on the classpath, the app would fail to start
if Jackson 2 was present. This occured as the auto-configuration
for the EndpointJackson2ObjectMapper tried to use spring-web's
Jackson2ObjectMapperBuilder that was not present.
This commit updates the auto-configuration to back off when
Jackson2ObjectMapperBuilder is absent, aligning it with the
behavior of JacksonEndpointAutoConfiguration in 3.5.
Fixes gh-47788
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
This removes the auto-configuration for Spring Pulsar Reactive.
Consolidates the PulsarConfiguration into the PulsarAutoConfiguration because
there is no longer a need to factor out the common components between Spring
Pulsar and Spring Pulsar Reactive.
See gh-47707
Signed-off-by: onobc <chris.bono@gmail.com>
This commit adapts @AutoConfigureHttpGraphQlTester to rely on the
auto-configured WebTestClient and stop triggering the configuration
of MockMvc.
Closes gh-47660
* Update dependencies name
Modules are prefixed with `testcontainers-`
* Update container classes
Container classes are under `org.testcontainers.<module-name>` package
See gh-47664
Signed-off-by: Eddú Meléndez <eddu.melendez@gmail.com>
This commit restores the user of HttpGraphQlTester when it is configured
against a running server. The logic that appends the graphQl path to
the HTTP url was lost while refactoring the HTTP clients infrastructure.
To work against the new API, BaseUrl has been updated to provide the
ability to append a path to its URL
Closes gh-47659