Commit Graph

56 Commits

Author SHA1 Message Date
Andy Wilkinson 3d6671d47a Merge branch '4.0.x'
Closes gh-48701
2026-01-08 12:14:50 +00:00
Andy Wilkinson 0ffffee4bf Upgrade to Nullability Plugin 0.0.9
Closes gh-48638
2026-01-08 11:59:51 +00:00
Phillip Webb dad1ca5e95 Merge branch '4.0.x' 2026-01-06 12:54:30 -08:00
Phillip Webb a4f35688aa Merge branch '3.5.x' into 4.0.x 2026-01-06 12:54:11 -08:00
Stéphane Nicoll 82cb083869 Merge branch '4.0.x'
Closes gh-48683
2026-01-06 12:36:06 +01:00
Stéphane Nicoll 2e2981bfe4 Merge branch '3.5.x' into 4.0.x
Closes gh-48682
2026-01-06 12:35:34 +01:00
Stéphane Nicoll 5399793faf Reinstate Spock support
Closes gh-48513
2025-12-19 15:31:59 +01:00
Stefano Cordio b2b0fed285 Decorate all Assert implementations with @CheckReturnValue
See gh-46766

Signed-off-by: Stefano Cordio <stefano.cordio@gmail.com>
2025-12-19 10:39:37 +01:00
Stéphane Nicoll d489aa685c Polish "Update AOT tests to fail if deprecated code is not suppressed"
Include use of API that has been marked for removal.

See gh-48566
2025-12-17 15:41:26 +01:00
Stéphane Nicoll 8e895b3bc0 Update AOT tests to fail if deprecated code is not suppressed
Closes gh-48566
2025-12-17 15:30:44 +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 8eb90644a6 Merge branch '3.5.x'
Closes gh-48306
2025-11-26 16:02:42 +01:00
Stéphane Nicoll f7f11a4f25 Merge branch '3.5.x'
Closes gh-48275
2025-11-24 16:47:49 +01:00
Stéphane Nicoll d1e5fe3248 Merge branch '3.5.x'
Closes gh-48106
2025-11-13 10:31:25 +01:00
Phillip Webb 739cb529fb Merge branch '3.5.x'
Closes gh-47749
2025-10-21 11:30:56 -07: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
Yanming Zhou 609b0b444e Use JsonMapper instead of ObjectMapper where feasible
See gh-47503

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2025-10-20 13:16:52 +02:00
Phillip Webb 77f207a079 Simplify BaseUrl code and cache resolved URLs
See gh-47680
2025-10-17 19:28:18 -07:00
Phillip Webb 50a73b8dfe Add Jackson2Tester support
See gh-47688
2025-10-17 13:17:22 -07:00
Stéphane Nicoll 46a3c95a5c Apply BaseUrl consistently
This commit updates BaseUrlBuilderFactory to reuse features of the
Spring Framework to handle the base URL rather than duplicating it.

As a result, BaseUrl no longer resolves anything but rather provide
a standard component that is able to resolve the URI if needed.

Closes gh-47674
2025-10-17 16:35:06 +02:00
Stéphane Nicoll 998a2fa7b4 Fix configuration of HttpGraphQlTester with a running server
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
2025-10-17 16:35:06 +02:00
Andy Wilkinson b88551a198 Remove Spock integration until it supports Groovy 5
Closes gh-47650
2025-10-16 15:27:35 +01:00
Yanming Zhou aa09c8583d Fix wrong variable name
See gh-47478

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2025-10-10 17:37:16 +02:00
Andy Wilkinson 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
Andy Wilkinson 16d8878cd8 Support embedded web environment with @AutoConfigureWebTestClient
Simplify `WebTestClient` testing support by removing the direct
context customizer in favor of using `@AutoConfigureWebTestClient`.

See gh-46356
2025-10-09 22:11:44 -07:00
Stéphane Nicoll 533544d8fc Polish 2025-10-07 10:39:54 +02:00
Moritz Halbritter 4c8cabcb3a Upgrade to JUnit Jupiter 6.0.0
Closes gh-47383
2025-10-02 14:20:04 +02:00
Moritz Halbritter ea05f6df15 Add nullability annotations to tests in core/spring-boot-test
See gh-47263
2025-10-02 12:12:44 +02:00
Phillip Webb 2a521ce4e9 Remove spring-boot-web-server-test module
Remove the `spring-boot-web-server-test` module, adding
`SpringBootTestRandomPortContextCustomizerFactory` to
`spring-boot-web-server` as a replacement for
`SpringBootTestRandomPortApplicationListener`.

See gh-46356
See gh-47322
2025-10-01 21:54:54 -07:00
Phillip Webb 97c89b480f Move @LocalServerPort and @LocalManagementServerPort
Move `@LocalServerPort` and `@LocalManagementServerPort` back to
`spring-boot-test`. The should help reduce upgrade pain since these
annotations are fairly commonly used. It also removes the need for
depending on `spring-boot-webserver-test`.

This is slight compromise with the module structure, since the
web-server module usually contributes the properties referenced
by the annotations.

See gh-46356
See gh-47322
2025-10-01 21:53:58 -07:00
Phillip Webb 82795f9966 Move DisableReactorResourceFactory... to spring-boot-test
Move `DisableReactorResourceFactoryGlobalResources...` support from
`spring-boot-web-server-test` back to `spring-boot-test` since it's
useful if Reactor Netty is being used directly and removes the need
for the `spring-boot-web-server-test` dependency.

See gh-46356
See gh-47322
2025-10-01 21:53:35 -07:00
Phillip Webb ef37765625 Add BaseUrl backed HTTP Unit support classes
Add new HTML Unit support classes that use `BaseUrlProviders`
to find the `BaseUrl`.

See gh-46356
2025-10-01 21:51:58 -07:00
Phillip Webb bba56ffc8b 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
2025-10-01 21:51:20 -07:00
Phillip Webb 6f909114e7 Move WebTestClientBuilderCustomizer to spring-boot-test
Relocate `WebTestClientBuilderCustomizer` to `spring-boot-test`
and break the direct link to web-server and http-codec by making
use of `spring.factories` and the new `BaseUrlProviders` class.

A new `spring-boot-test-integration-test` module has also been
added to ensure hold the previous tests.

See gh-46356
2025-10-01 21:50:13 -07:00
Phillip Webb 79091f926d Introduce BaseUrl and BaseUrlProvider
Add the concept of a `BaseUrl` to the core `spring-boot-test`
module for use when making test HTTP calls. The web server module
provides `BaseUrlProvider` implementations that provide the actual
base URL (usually `https://localhost:<local-server-port>`).

Test utilities will be able to use `BaseUrlProviders` to find the
`BaseUrl`.

See gh-46356
2025-10-01 21:46:28 -07:00
Phillip Webb 8008076e04 Remove spring-boot-json-test module
Remove spring-boot-json-test module and spread code between
`spring-boot-test`, `spring-boot-test-autoconfigure` and JSON
technology modules.

See gh-46356
See gh-47322
2025-10-01 21:42:18 -07:00
Phillip Webb 17e655b7e5 Relocate @PropertyMapping to spring-boot-test
Move `@PropertyMapping` and supporting code from the
`spring-boot-test-autoconfigure` module to `spring-boot-test`
since it's generally applicable.

See gh-46356
See gh-47322
2025-10-01 21:41:03 -07:00
Phillip Webb 2b3a8ff647 Relocate @TypeExcludeFilters to spring-boot-test
Move `@TypeExcludeFilters` and supporting code from the
`spring-boot-test-autoconfigure` module to `spring-boot-test`
since it's generally applicable.

See gh-46356
See gh-47322
2025-10-01 21:39:34 -07:00
Andy Wilkinson 0b601118bd Modularize spring-boot-test
Closes gh-46356
2025-09-25 17:24:12 +01:00
Stéphane Nicoll 14703cbafd Revert "Remove mentions of JUnit 4"
This reverts commit 3b98af30f5.

See gh-47228
2025-09-19 17:05:00 +02:00
Stéphane Nicoll 3b98af30f5 Remove mentions of JUnit 4
This commit removes all mentions of JUnit 4 from the Javadoc and
reference documentation. It also harmonizes to simply refers to JUnit.

Closes gh-47228
2025-09-19 15:29:11 +02:00
Phillip Webb 2cf854c5b6 Polish 2025-09-18 13:29:47 -07:00
Stéphane Nicoll d9fce46848 Fix checkstyle 2025-09-18 03:43:59 +02:00
Phillip Webb 6642bf7beb Deprecate JUnit 4 OutputCaptureRule
Closes gh-47256
2025-09-17 16:40:32 -07:00
Phillip Webb c53ea0a08c Relocate DefaultPropertiesPropertySource to env
Move `DefaultPropertiesPropertySource` from
`org.springframework.boot` to `org.springframework.boot.env` since
it's not directly tied to `SpringApplication`.

See gh-47232
2025-09-17 14:57:32 -07:00
Phillip Webb 4ebf09ad12 Restructure bootstrap classes to a foundational layer
Move bootstrap code from `org.springframework.boot` to
`org.springframework.boot.bootstrap` and make them a foundational
layer.

This move helps reduce `org.springframework.boot.context.config`
dependencies to `org.springframework.boot`.

See gh-47232
2025-09-17 14:57:10 -07:00
Moritz Halbritter 8c0018d739 Further improve null-safety of JsonContentAssert
See gh-46926
2025-09-16 13:42:24 +02:00
Moritz Halbritter 3bfcfaa795 Improve null-safety of JsonContentAssert
See gh-46926
2025-09-16 11:55:16 +02:00
Moritz Halbritter 0fc1a40f3b Polish nullability annotations
See gh-46926
2025-09-09 15:08:44 +02:00