From 30a6b50e82d73b6191cf979980c3dc6951d2d592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Wed, 29 Oct 2025 16:45:16 +0100 Subject: [PATCH] Align naming change for Jackson components This commit polishes the renaming of JsonComponent to JacksonComponent and the use of JacksonModule instead of Module in Jackson 2. This also adds integration tests that use a JacksonComponent with WebMvcTest and WebFluxTest. Closes gh-47864 --- .../test/autoconfigure/json/JsonTest.java | 8 +-- .../test/autoconfigure/GraphQlTest.java | 4 +- .../JacksonAutoConfigurationTests.java | 2 +- .../jsontest/app/ExampleCustomObject.java | 2 +- ...nent.java => ExampleJacksonComponent.java} | 6 +-- .../test/autoconfigure/RestClientTest.java | 8 +-- .../test/autoconfigure/WebClientTest.java | 6 +-- .../test/autoconfigure/WebFluxTest.java | 4 +- .../WebFluxTypeExcludeFilter.java | 2 +- .../autoconfigure/ExampleController2.java | 8 +++ .../test/autoconfigure/ExampleResult.java | 28 +++++++++++ .../ExampleResultSerializer.java | 38 ++++++++++++++ ...xTestJacksonComponentIntegrationTests.java | 50 +++++++++++++++++++ .../WebFluxTypeExcludeFilterTests.java | 11 ++++ .../webmvc/test/autoconfigure/WebMvcTest.java | 4 +- .../WebMvcTypeExcludeFilter.java | 6 +-- .../WebMvcTypeExcludeFilterTests.java | 11 ++++ .../mockmvc/ExampleController2.java | 7 +++ .../autoconfigure/mockmvc/ExampleResult.java | 28 +++++++++++ .../mockmvc/ExampleResultSerializer.java | 38 ++++++++++++++ ...cTestJacksonComponentIntegrationTests.java | 47 +++++++++++++++++ .../client/WebServiceClientTest.java | 4 +- 22 files changed, 294 insertions(+), 28 deletions(-) rename module/spring-boot-jackson/src/test/java/org/springframework/boot/jackson/autoconfigure/jsontest/app/{ExampleJsonComponent.java => ExampleJacksonComponent.java} (93%) create mode 100644 module/spring-boot-webflux-test/src/test/java/org/springframework/boot/webflux/test/autoconfigure/ExampleResult.java create mode 100644 module/spring-boot-webflux-test/src/test/java/org/springframework/boot/webflux/test/autoconfigure/ExampleResultSerializer.java create mode 100644 module/spring-boot-webflux-test/src/test/java/org/springframework/boot/webflux/test/autoconfigure/WebFluxTestJacksonComponentIntegrationTests.java create mode 100644 module/spring-boot-webmvc-test/src/test/java/org/springframework/boot/webmvc/test/autoconfigure/mockmvc/ExampleResult.java create mode 100644 module/spring-boot-webmvc-test/src/test/java/org/springframework/boot/webmvc/test/autoconfigure/mockmvc/ExampleResultSerializer.java create mode 100644 module/spring-boot-webmvc-test/src/test/java/org/springframework/boot/webmvc/test/autoconfigure/mockmvc/WebMvcTestJacksonComponentIntegrationTests.java diff --git a/core/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTest.java b/core/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTest.java index 4780ad88f40..5e67cb71f61 100644 --- a/core/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTest.java +++ b/core/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTest.java @@ -44,12 +44,12 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; * Using this annotation only enables auto-configuration that is relevant to JSON tests. * Similarly, component scanning is limited to beans annotated with: * *

* as well as beans that implement: *

*

* By default, tests annotated with {@code JsonTest} will also initialize @@ -88,8 +88,8 @@ public @interface JsonTest { /** * Determines if default filtering should be used with - * {@link SpringBootApplication @SpringBootApplication}. By default only - * {@code @JsonComponent} and {@code Module} beans are included. + * {@link SpringBootApplication @SpringBootApplication}. By default, only + * {@code @JacksonComponent} and {@code JacksonModule} beans are included. * @see #includeFilters() * @see #excludeFilters() * @return if default filters should be used diff --git a/module/spring-boot-graphql-test/src/main/java/org/springframework/boot/graphql/test/autoconfigure/GraphQlTest.java b/module/spring-boot-graphql-test/src/main/java/org/springframework/boot/graphql/test/autoconfigure/GraphQlTest.java index 75058bd32bc..504ed99e868 100644 --- a/module/spring-boot-graphql-test/src/main/java/org/springframework/boot/graphql/test/autoconfigure/GraphQlTest.java +++ b/module/spring-boot-graphql-test/src/main/java/org/springframework/boot/graphql/test/autoconfigure/GraphQlTest.java @@ -47,7 +47,7 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; *