Commit Graph
303 Commits
Author SHA1 Message Date
Stéphane Nicoll 4fc987180d Polish "Add support for creating a container from a TestImage value"
See gh-51082
2026-09-08 18:30:35 +02:00
Stéphane Nicoll b1e91c942e Add support for creating a container from a TestImage value
This commit improves TestImage so that an explicit image can trigger
the creation of the container, with optional additional setup. This
removes the need of creating additional container types for images that
have multiple flavors, and to please the static method that can only
create a container based on a single match.

Closes gh-51082
2026-09-08 16:46:48 +02:00
Manu Sridharan 25a3f8feb9 Remove unnecessary NullAway suppressions
Signed-off-by: Manu Sridharan <msridhar@gmail.com>

See gh-51591
2026-09-07 08:18:11 +01:00
Phillip Webb a1cc95e8a6 Polish gradle dependency declarations
Remove 'path:' prefix when possible.
2026-08-26 10:39:28 -07:00
Phillip Webb 5a21e0d698 Upgrade to spring-javaformat 0.0.48
Closes gh-51452
2026-08-25 13:58:58 -07:00
Stéphane Nicoll 2abe872e37 Fix hostname verification failure in Elasticsearc smoke test
Regenerate the self-signed test certificate with CN=localhost as the
JDK enforces RFC 6125 wildcard rules and no longer accepts a bare "*" as
a match-any-host pattern. Thus far it worked because HttpClient5 did
not delegate hostname verification to the JDK in some cases.

Closes gh-51345
2026-08-11 08:05:47 +02:00
Stéphane Nicoll b9ebff0084 Use RestClient in tests and infrastructure code
Closes gh-51120
2026-07-24 15:10:43 +02:00
Yanming Zhou dff33aec55 Remove unnecessary @Nullables from local variable declarations
See gh-50866

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2026-06-28 10:39:07 +01: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 5257df1bb1 Take async cache writes into consideration
Since Spring Data Redis 4.0 and when using Lettuce, entries may be
written to the cache asynchronously. This means that they may not
be immediately visible to a subsequent read. This commit adapts the
test to use Awaitility to wait for the expected entry to become
visible in the cache.

Closes gh-50356
2026-05-07 15:42:50 +01:00
Andy Wilkinson ee6f1e6256 Merge branch '3.5.x' into 4.0.x
See gh-50278
2026-05-02 07:11:37 +01:00
Moritz Halbritter d437c11761 Merge branch '3.5.x' into 4.0.x
Closes gh-49869
2026-04-02 11:12:20 +02:00
Moritz Halbritter 4f47202910 Merge branch '3.5.x' into 4.0.x
Closes gh-49866
2026-04-02 10:46:26 +02:00
Andy Wilkinson 797253a447 Merge branch '3.5.x' into 4.0.x
Closes gh-49617
2026-03-16 18:00:39 +00:00
Phillip Webb 280af06373 Polish 2026-02-18 15:10:07 -08:00
Stéphane Nicoll f4156197b5 Fix checks 2026-02-18 08:17:51 +01:00
Phillip Webb 1d054e8a12 Ensure HttpMessageConverters are configured before RestClients
Update `RestClientAutoConfiguration` to ensure that it applies after
`HttpMessageConvertersAutoConfiguration`.

Prior to this commit, the `HttpMessageConvertersRestClientCustomizer`
bean might not get created due to the `@ConditionalOnBean` guard not
finding any `ClientHttpMessageConvertersCustomizer` beans.

Since the issue is surprising hard to replicate in a unit test, a new
smoke test has been added to ensure the problem doesn't return.

Fixes gh-49223
2026-02-17 22:26:02 -08:00
Andy Wilkinson 3100599005 Upgrade to Hibernate 7.2.1.Final
Closes gh-48857
2026-01-15 15:36:17 +00:00
Andy Wilkinson 0ffffee4bf Upgrade to Nullability Plugin 0.0.9
Closes gh-48638
2026-01-08 11:59:51 +00:00
Stéphane Nicoll 1f4a8dff98 Restore RANDOM_PORT handing in tests with a separate management port
This commit fixes a regression where RANDOM_PORT was no longer honored
if a defined management port is set. Due to the modularization efforts,
the code has moved from an EnvironmentPostProcessor to an
ApplicationListener. Unfortunately, the listener is registered too
late to handle the event it is listening to. While the event type could
have been changed, the listener was added on the ApplicationContext
which are not honored before the ApplicationContext is in a state to be
used.

The contract of ContextCustomizerFactory is already giving us everything
we need. While the environment is post-processed later than we would
like, it is still post-processed before the refresh state so that the
additional property is honored.

This commit also adds an integration test to cover this scenario.

Closes gh-48653
2025-12-31 17:10:39 +01:00
Phillip Webb da516741b2 Consider modules when deducing WebApplicationType
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
2025-12-15 20:30:16 -08:00
Stéphane Nicoll 61e427c101 Merge branch '3.5.x'
Closes gh-48516
2025-12-12 16:24:45 +01:00
Stéphane Nicoll b05b01b0a7 Polish 2025-12-08 15:17:54 +01:00
Stéphane Nicoll a98b36efbb Start building against Spring Framework 7.0.2 snapshots
See gh-48439
2025-12-08 14:54:53 +01:00
Tran Ngoc Nhan 58d42475f3 Fix Javadoc reference for SampleJackson2OnlyApplication
See gh-48396

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-12-05 10:13:04 -08:00
Andy Wilkinson cf1ecca81c Add missing spring-boot-restclient for Docker-based test
See gh-48253
2025-11-25 15:30:48 +00: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 3becdc7d47 Move server.error properties to spring.web.error
Closes gh-48201
2025-11-20 11:55:23 +00:00
Andy Wilkinson 81ec7aeb70 Fix clashing bean name with JsonTest and Jacksons 2 and 3
Fixes gh-48198
2025-11-20 09:14:46 +00:00
Phillip Webb 2685f4bf29 Change tomcat and jetty runtime modules to starters
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
2025-11-19 21:59:03 -08:00
Moritz Halbritter 4af532b8ee Add starters for Micrometer Metrics
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
2025-11-18 09:28:53 +01:00
Phillip Webb 2e54aa6760 Merge branch '3.5.x'
Closes gh-48160
2025-11-17 21:00:09 -08:00
Andy Wilkinson bb0437c0e1 Correct names of isolated Json/ObjectMapper properties
Closes gh-48116
2025-11-13 12:00:19 +00:00
Phillip WebbandAndy Wilkinson 619454548b Restore support for Jersey
Restore support for Jersey now that it supports JAX-RS 4.

Closes gh-47967

Co-authored-by: Andy Wilkinson <andy.wilkinson@broadcom.com>
2025-11-05 10:51:08 -08:00
Moritz Halbritter e9172d9f51 Split spring-boot-micrometer-tracing into Brave and OpenTelemetry specific module
Closes gh-47953
2025-11-05 12:14:13 +01:00
Stéphane Nicoll 724f706f34 Move auto-configuration for WebTestClient in autoconfigure
Closes gh-47892
2025-10-31 12:05:25 +01:00
Moritz Halbritter e071006f8e Remove spring-boot-micrometer-tracing from Actuator starter
Closes gh-47785
2025-10-29 15:31:14 +01:00
Stéphane Nicoll f3958ae9e7 Add Spring Kafka test utilities to Kafka test starter
Closes gh-47793
2025-10-29 08:28:58 +01:00
Stéphane Nicoll 20fdeae1a9 Add WebTestClient infrastructure to GraphQL test starter
Closes gh-47849
2025-10-28 15:07:34 +01:00
Stéphane Nicoll cd1424d04b Simplify dependencies arrangement in smoke tests
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
2025-10-28 11:16:23 +01:00
Andy Wilkinson 198cba7177 Fix spring-boot-jackson2's test auto-configuration
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
2025-10-27 10:04:25 +00:00
Andy Wilkinson f72da4c77a Fix Actuator with Jackson 2 but no spring-web
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
2025-10-24 14:39:47 +01:00
Andy Wilkinson 4e94f26935 Support JMX endpoints when only Jackson 2 is present
Closes gh-47688
2025-10-22 14:40:59 +01:00
Andy Wilkinson 635e766aaf Make it easier to create executable and deployable war
Closes gh-46944
2025-10-22 10:13:46 +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
Stéphane Nicoll 9c969f91be Polish "Remove Spring Pulsar Reactive support"
See gh-47707
2025-10-20 18:15:34 +02:00
onobc 4aaa1dfb5f Remove Spring Pulsar Reactive support
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>
2025-10-20 18:15:34 +02:00
Stéphane Nicoll fad9a6e23e Merge branch '3.5.x' 2025-10-20 13:56:38 +02:00
Stéphane Nicoll 90804c8c2b Adapt @AutoConfigureHttpGraphQlTester to new testing infrastructure
This commit adapts @AutoConfigureHttpGraphQlTester to rely on the
auto-configured WebTestClient and stop triggering the configuration
of MockMvc.

Closes gh-47660
2025-10-19 17:46:11 +02:00