From 0b601118bdc3c35d161c9ae58e25d9b104609a65 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 25 Sep 2025 16:11:07 +0100 Subject: [PATCH] Modularize spring-boot-test Closes gh-46356 --- core/spring-boot-test/build.gradle | 15 +-------- .../main/resources/META-INF/spring.factories | 3 +- .../testing/spring-boot-applications.adoc | 2 +- .../jsontests/MyJsonAssertJTests.java | 2 +- .../jsontests/MyJsonTests.java | 2 +- .../jsontests/MyJsonAssertJTests.kt | 2 +- .../jsontests/MyJsonTests.kt | 2 +- module/spring-boot-actuator/build.gradle | 1 + ...acksonJmxOperationResponseMapperTests.java | 2 +- module/spring-boot-json-test/build.gradle | 3 ++ .../json/test}/AbstractJsonMarshalTester.java | 2 +- .../boot/json/test}/BasicJsonTester.java | 2 +- ...ateJsonObjectContextCustomizerFactory.java | 2 +- .../boot/json/test}/GsonTester.java | 2 +- .../boot/json/test}/JacksonTester.java | 2 +- .../boot/json/test}/JsonContent.java | 2 +- .../boot/json/test}/JsonContentAssert.java | 2 +- .../boot/json/test}/JsonLoader.java | 2 +- .../boot/json/test}/JsonbTester.java | 2 +- .../boot/json/test}/ObjectContent.java | 2 +- .../boot/json/test}/ObjectContentAssert.java | 2 +- .../AutoConfigureJsonTesters.java | 8 ++--- .../json/test/autoconfigure/JsonTest.java | 6 ++-- .../JsonTestersAutoConfiguration.java | 10 +++--- .../boot/json/test}/package-info.java | 2 +- .../main/resources/META-INF/spring.factories | 3 ++ .../test}/AbstractJsonMarshalTesterTests.java | 2 +- .../boot/json/test}/BasicJsonTesterTests.java | 2 +- ...onObjectContextCustomizerFactoryTests.java | 2 +- .../boot/json/test}/ExampleObject.java | 2 +- .../json/test}/ExampleObjectWithView.java | 2 +- .../test}/GsonTesterIntegrationTests.java | 2 +- .../boot/json/test}/GsonTesterTests.java | 2 +- .../test}/JacksonTesterIntegrationTests.java | 2 +- .../boot/json/test}/JacksonTesterTests.java | 2 +- .../json/test}/JsonContentAssertTests.java | 2 +- .../boot/json/test}/JsonContentTests.java | 2 +- .../boot/json/test}/JsonbTesterTests.java | 2 +- .../json/test}/ObjectContentAssertTests.java | 2 +- .../boot/json/test}/ObjectContentTests.java | 2 +- .../JsonTestIntegrationTests.java | 10 +++--- ...TestWithAutoConfigureJsonTestersTests.java | 8 ++--- .../JsonTestersAutoConfigurationTests.java | 8 ++--- ...TestWithAutoConfigureJsonTestersTests.java | 8 ++--- .../boot/json/test}/different.json | 0 .../boot/json/test}/example.json | 0 .../boot/json/test}/lenient-same.json | 0 .../boot/json/test}/nulls.json | 0 .../boot/json/test}/simpsons.json | 0 .../boot/json/test}/source.json | 0 .../boot/json/test}/types.json | 0 module/spring-boot-rsocket-test/build.gradle | 32 +++++++++++++++++++ .../server/LocalRSocketServerPort.java | 0 .../test/rsocket/server/package-info.java | 0 .../server/LocalRSocketServerPortTests.java | 0 .../build.gradle | 27 ++-------------- settings.gradle | 1 + .../build.gradle | 1 + .../test/service/VehicleDetailsJsonTests.java | 2 +- .../build.gradle | 3 +- .../assertions/ContainerConfigAssert.java | 2 +- .../boot/image/assertions/ImageAssert.java | 2 +- 62 files changed, 112 insertions(+), 105 deletions(-) rename {core/spring-boot-test/src/main/java/org/springframework/boot/test/json => module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test}/AbstractJsonMarshalTester.java (99%) rename {core/spring-boot-test/src/main/java/org/springframework/boot/test/json => module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test}/BasicJsonTester.java (99%) rename {core/spring-boot-test/src/main/java/org/springframework/boot/test/json => module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test}/DuplicateJsonObjectContextCustomizerFactory.java (98%) rename {core/spring-boot-test/src/main/java/org/springframework/boot/test/json => module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test}/GsonTester.java (98%) rename {core/spring-boot-test/src/main/java/org/springframework/boot/test/json => module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test}/JacksonTester.java (99%) rename {core/spring-boot-test/src/main/java/org/springframework/boot/test/json => module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test}/JsonContent.java (98%) rename {core/spring-boot-test/src/main/java/org/springframework/boot/test/json => module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test}/JsonContentAssert.java (99%) rename {core/spring-boot-test/src/main/java/org/springframework/boot/test/json => module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test}/JsonLoader.java (98%) rename {core/spring-boot-test/src/main/java/org/springframework/boot/test/json => module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test}/JsonbTester.java (98%) rename {core/spring-boot-test/src/main/java/org/springframework/boot/test/json => module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test}/ObjectContent.java (97%) rename {core/spring-boot-test/src/main/java/org/springframework/boot/test/json => module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test}/ObjectContentAssert.java (97%) rename {core/spring-boot-test/src/main/java/org/springframework/boot/test/json => module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test}/package-info.java (94%) create mode 100644 module/spring-boot-json-test/src/main/resources/META-INF/spring.factories rename {core/spring-boot-test/src/test/java/org/springframework/boot/test/json => module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test}/AbstractJsonMarshalTesterTests.java (99%) rename {core/spring-boot-test/src/test/java/org/springframework/boot/test/json => module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test}/BasicJsonTesterTests.java (98%) rename {core/spring-boot-test/src/test/java/org/springframework/boot/test/json => module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test}/DuplicateJsonObjectContextCustomizerFactoryTests.java (97%) rename {core/spring-boot-test/src/test/java/org/springframework/boot/test/json => module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test}/ExampleObject.java (96%) rename {core/spring-boot-test/src/test/java/org/springframework/boot/test/json => module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test}/ExampleObjectWithView.java (97%) rename {core/spring-boot-test/src/test/java/org/springframework/boot/test/json => module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test}/GsonTesterIntegrationTests.java (98%) rename {core/spring-boot-test/src/test/java/org/springframework/boot/test/json => module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test}/GsonTesterTests.java (98%) rename {core/spring-boot-test/src/test/java/org/springframework/boot/test/json => module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test}/JacksonTesterIntegrationTests.java (99%) rename {core/spring-boot-test/src/test/java/org/springframework/boot/test/json => module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test}/JacksonTesterTests.java (98%) rename {core/spring-boot-test/src/test/java/org/springframework/boot/test/json => module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test}/JsonContentAssertTests.java (99%) rename {core/spring-boot-test/src/test/java/org/springframework/boot/test/json => module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test}/JsonContentTests.java (98%) rename {core/spring-boot-test/src/test/java/org/springframework/boot/test/json => module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test}/JsonbTesterTests.java (98%) rename {core/spring-boot-test/src/test/java/org/springframework/boot/test/json => module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test}/ObjectContentAssertTests.java (98%) rename {core/spring-boot-test/src/test/java/org/springframework/boot/test/json => module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test}/ObjectContentTests.java (98%) rename {core/spring-boot-test/src/test/resources/org/springframework/boot/test/json => module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test}/different.json (100%) rename {core/spring-boot-test/src/test/resources/org/springframework/boot/test/json => module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test}/example.json (100%) rename {core/spring-boot-test/src/test/resources/org/springframework/boot/test/json => module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test}/lenient-same.json (100%) rename {core/spring-boot-test/src/test/resources/org/springframework/boot/test/json => module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test}/nulls.json (100%) rename {core/spring-boot-test/src/test/resources/org/springframework/boot/test/json => module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test}/simpsons.json (100%) rename {core/spring-boot-test/src/test/resources/org/springframework/boot/test/json => module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test}/source.json (100%) rename {core/spring-boot-test/src/test/resources/org/springframework/boot/test/json => module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test}/types.json (100%) create mode 100644 module/spring-boot-rsocket-test/build.gradle rename {core/spring-boot-test => module/spring-boot-rsocket-test}/src/main/java/org/springframework/boot/test/rsocket/server/LocalRSocketServerPort.java (100%) rename {core/spring-boot-test => module/spring-boot-rsocket-test}/src/main/java/org/springframework/boot/test/rsocket/server/package-info.java (100%) rename {core/spring-boot-test => module/spring-boot-rsocket-test}/src/test/java/org/springframework/boot/test/rsocket/server/LocalRSocketServerPortTests.java (100%) diff --git a/core/spring-boot-test/build.gradle b/core/spring-boot-test/build.gradle index 9bd3a3d4f17..bcf95660fbf 100644 --- a/core/spring-boot-test/build.gradle +++ b/core/spring-boot-test/build.gradle @@ -27,31 +27,18 @@ dependencies { api(project(":core:spring-boot")) api("org.springframework:spring-test") - optional("com.google.code.gson:gson") - optional("com.jayway.jsonpath:json-path") - optional("io.projectreactor.netty:reactor-netty-http") - optional("jakarta.json.bind:jakarta.json.bind-api") optional("jakarta.servlet:jakarta.servlet-api") optional("junit:junit") - optional("org.apache.httpcomponents.client5:httpclient5") optional("org.assertj:assertj-core") optional("org.hamcrest:hamcrest-core") optional("org.hamcrest:hamcrest-library") optional("org.junit.jupiter:junit-jupiter-api") optional("org.mockito:mockito-core") - optional("org.skyscreamer:jsonassert") optional("org.springframework:spring-web") - optional("org.springframework:spring-webflux") - optional("org.springframework.graphql:spring-graphql-test") - optional("tools.jackson.core:jackson-databind") testImplementation(project(":test-support:spring-boot-test-support")) testImplementation("ch.qos.logback:logback-classic") - testImplementation("io.mockk:mockk") - testImplementation("jakarta.json:jakarta.json-api") - testImplementation("org.apache.groovy:groovy") - testImplementation("org.apache.groovy:groovy-xml") - testImplementation("org.eclipse:yasson") + testImplementation("com.google.code.gson:gson") testImplementation("org.jetbrains.kotlin:kotlin-reflect") testImplementation("org.jetbrains.kotlin:kotlin-stdlib") testImplementation("org.slf4j:slf4j-api") diff --git a/core/spring-boot-test/src/main/resources/META-INF/spring.factories b/core/spring-boot-test/src/main/resources/META-INF/spring.factories index 80760225f6f..81a8a894621 100644 --- a/core/spring-boot-test/src/main/resources/META-INF/spring.factories +++ b/core/spring-boot-test/src/main/resources/META-INF/spring.factories @@ -1,8 +1,7 @@ # Spring Test Context Customizer Factories org.springframework.test.context.ContextCustomizerFactory=\ org.springframework.boot.test.context.ImportsContextCustomizerFactory,\ -org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizerFactory,\ -org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory +org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizerFactory # Application Context Initializers org.springframework.context.ApplicationContextInitializer=\ diff --git a/documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/testing/spring-boot-applications.adoc b/documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/testing/spring-boot-applications.adoc index b3ea0bbcbc6..cc2eb0f4a99 100644 --- a/documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/testing/spring-boot-applications.adoc +++ b/documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/testing/spring-boot-applications.adoc @@ -290,7 +290,7 @@ TIP: A list of the auto-configurations that are enabled by javadoc:org.springfra If you need to configure elements of the auto-configuration, you can use the javadoc:org.springframework.boot.json.test.autoconfigure.AutoConfigureJsonTesters[format=annotation] annotation. Spring Boot includes AssertJ-based helpers that work with the JSONAssert and JsonPath libraries to check that JSON appears as expected. -The javadoc:org.springframework.boot.test.json.JacksonTester[], javadoc:org.springframework.boot.test.json.GsonTester[], javadoc:org.springframework.boot.test.json.JsonbTester[], and javadoc:org.springframework.boot.test.json.BasicJsonTester[] classes can be used for Jackson, Gson, Jsonb, and Strings respectively. +The javadoc:org.springframework.boot.json.test.JacksonTester[], javadoc:org.springframework.boot.json.test.GsonTester[], javadoc:org.springframework.boot.json.test.JsonbTester[], and javadoc:org.springframework.boot.json.test.BasicJsonTester[] classes can be used for Jackson, Gson, Jsonb, and Strings respectively. Any helper fields on the test class can be javadoc:org.springframework.beans.factory.annotation.Autowired[format=annotation] when using javadoc:org.springframework.boot.json.test.autoconfigure.JsonTest[format=annotation]. The following example shows a test class for Jackson: diff --git a/documentation/spring-boot-docs/src/main/java/org/springframework/boot/docs/testing/springbootapplications/jsontests/MyJsonAssertJTests.java b/documentation/spring-boot-docs/src/main/java/org/springframework/boot/docs/testing/springbootapplications/jsontests/MyJsonAssertJTests.java index 5f32c9d3ff0..58aa78e1fce 100644 --- a/documentation/spring-boot-docs/src/main/java/org/springframework/boot/docs/testing/springbootapplications/jsontests/MyJsonAssertJTests.java +++ b/documentation/spring-boot-docs/src/main/java/org/springframework/boot/docs/testing/springbootapplications/jsontests/MyJsonAssertJTests.java @@ -19,8 +19,8 @@ package org.springframework.boot.docs.testing.springbootapplications.jsontests; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.json.test.JacksonTester; import org.springframework.boot.json.test.autoconfigure.JsonTest; -import org.springframework.boot.test.json.JacksonTester; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.within; diff --git a/documentation/spring-boot-docs/src/main/java/org/springframework/boot/docs/testing/springbootapplications/jsontests/MyJsonTests.java b/documentation/spring-boot-docs/src/main/java/org/springframework/boot/docs/testing/springbootapplications/jsontests/MyJsonTests.java index 1b829e123cd..49200f7335d 100644 --- a/documentation/spring-boot-docs/src/main/java/org/springframework/boot/docs/testing/springbootapplications/jsontests/MyJsonTests.java +++ b/documentation/spring-boot-docs/src/main/java/org/springframework/boot/docs/testing/springbootapplications/jsontests/MyJsonTests.java @@ -19,8 +19,8 @@ package org.springframework.boot.docs.testing.springbootapplications.jsontests; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.json.test.JacksonTester; import org.springframework.boot.json.test.autoconfigure.JsonTest; -import org.springframework.boot.test.json.JacksonTester; import static org.assertj.core.api.Assertions.assertThat; diff --git a/documentation/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/testing/springbootapplications/jsontests/MyJsonAssertJTests.kt b/documentation/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/testing/springbootapplications/jsontests/MyJsonAssertJTests.kt index e65d85716ca..c1a2bcd8f83 100644 --- a/documentation/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/testing/springbootapplications/jsontests/MyJsonAssertJTests.kt +++ b/documentation/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/testing/springbootapplications/jsontests/MyJsonAssertJTests.kt @@ -22,7 +22,7 @@ import org.assertj.core.api.ThrowingConsumer import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.json.test.autoconfigure.JsonTest -import org.springframework.boot.test.json.JacksonTester +import org.springframework.boot.json.test.JacksonTester @JsonTest class MyJsonAssertJTests(@Autowired val json: JacksonTester) { diff --git a/documentation/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/testing/springbootapplications/jsontests/MyJsonTests.kt b/documentation/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/testing/springbootapplications/jsontests/MyJsonTests.kt index 8977abc4d6a..cf82fea0884 100644 --- a/documentation/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/testing/springbootapplications/jsontests/MyJsonTests.kt +++ b/documentation/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/testing/springbootapplications/jsontests/MyJsonTests.kt @@ -20,7 +20,7 @@ import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.json.test.autoconfigure.JsonTest -import org.springframework.boot.test.json.JacksonTester +import org.springframework.boot.json.test.JacksonTester @JsonTest class MyJsonTests(@Autowired val json: JacksonTester) { diff --git a/module/spring-boot-actuator/build.gradle b/module/spring-boot-actuator/build.gradle index 5078fd94fcb..beae8bcea1e 100644 --- a/module/spring-boot-actuator/build.gradle +++ b/module/spring-boot-actuator/build.gradle @@ -65,6 +65,7 @@ dependencies { testImplementation(project(":core:spring-boot-test")) testImplementation(project(":module:spring-boot-jackson")) testImplementation(project(":module:spring-boot-jsonb")) + testImplementation(project(":module:spring-boot-json-test")) testImplementation(project(":test-support:spring-boot-test-support")) testImplementation("io.micrometer:micrometer-observation-test") testImplementation("io.projectreactor:reactor-test") diff --git a/module/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/JacksonJmxOperationResponseMapperTests.java b/module/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/JacksonJmxOperationResponseMapperTests.java index 4159aaa31ab..03509cf53ce 100644 --- a/module/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/JacksonJmxOperationResponseMapperTests.java +++ b/module/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/JacksonJmxOperationResponseMapperTests.java @@ -27,7 +27,7 @@ import org.junit.jupiter.api.Test; import tools.jackson.databind.JavaType; import tools.jackson.databind.ObjectMapper; -import org.springframework.boot.test.json.BasicJsonTester; +import org.springframework.boot.json.test.BasicJsonTester; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; diff --git a/module/spring-boot-json-test/build.gradle b/module/spring-boot-json-test/build.gradle index 1f2f61e457c..3428fd64307 100644 --- a/module/spring-boot-json-test/build.gradle +++ b/module/spring-boot-json-test/build.gradle @@ -32,7 +32,10 @@ dependencies { optional(project(":module:spring-boot-jsonb")) optional(project(":module:spring-boot-kotlin-serialization")) optional(project(":module:spring-boot-test-autoconfigure")) + optional("com.jayway.jsonpath:json-path") + optional("org.assertj:assertj-core") optional("org.junit.jupiter:junit-jupiter-api") + optional("org.skyscreamer:jsonassert") testImplementation(project(":test-support:spring-boot-test-support")) diff --git a/core/spring-boot-test/src/main/java/org/springframework/boot/test/json/AbstractJsonMarshalTester.java b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/AbstractJsonMarshalTester.java similarity index 99% rename from core/spring-boot-test/src/main/java/org/springframework/boot/test/json/AbstractJsonMarshalTester.java rename to module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/AbstractJsonMarshalTester.java index 73055475b9d..57ccf9da519 100644 --- a/core/spring-boot-test/src/main/java/org/springframework/boot/test/json/AbstractJsonMarshalTester.java +++ b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/AbstractJsonMarshalTester.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.test.json; +package org.springframework.boot.json.test; import java.io.BufferedReader; import java.io.Closeable; diff --git a/core/spring-boot-test/src/main/java/org/springframework/boot/test/json/BasicJsonTester.java b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/BasicJsonTester.java similarity index 99% rename from core/spring-boot-test/src/main/java/org/springframework/boot/test/json/BasicJsonTester.java rename to module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/BasicJsonTester.java index f23de0f8cfb..f5e7425eb8a 100644 --- a/core/spring-boot-test/src/main/java/org/springframework/boot/test/json/BasicJsonTester.java +++ b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/BasicJsonTester.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.test.json; +package org.springframework.boot.json.test; import java.io.File; import java.io.InputStream; diff --git a/core/spring-boot-test/src/main/java/org/springframework/boot/test/json/DuplicateJsonObjectContextCustomizerFactory.java b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/DuplicateJsonObjectContextCustomizerFactory.java similarity index 98% rename from core/spring-boot-test/src/main/java/org/springframework/boot/test/json/DuplicateJsonObjectContextCustomizerFactory.java rename to module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/DuplicateJsonObjectContextCustomizerFactory.java index 7486b55a769..30ebaf03a4d 100644 --- a/core/spring-boot-test/src/main/java/org/springframework/boot/test/json/DuplicateJsonObjectContextCustomizerFactory.java +++ b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/DuplicateJsonObjectContextCustomizerFactory.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.test.json; +package org.springframework.boot.json.test; import java.net.URL; import java.util.Collections; diff --git a/core/spring-boot-test/src/main/java/org/springframework/boot/test/json/GsonTester.java b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/GsonTester.java similarity index 98% rename from core/spring-boot-test/src/main/java/org/springframework/boot/test/json/GsonTester.java rename to module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/GsonTester.java index ae56423670b..1c0572c0f25 100644 --- a/core/spring-boot-test/src/main/java/org/springframework/boot/test/json/GsonTester.java +++ b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/GsonTester.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.test.json; +package org.springframework.boot.json.test; import java.io.IOException; import java.io.Reader; diff --git a/core/spring-boot-test/src/main/java/org/springframework/boot/test/json/JacksonTester.java b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/JacksonTester.java similarity index 99% rename from core/spring-boot-test/src/main/java/org/springframework/boot/test/json/JacksonTester.java rename to module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/JacksonTester.java index b2cfbc0e80e..a618f923003 100644 --- a/core/spring-boot-test/src/main/java/org/springframework/boot/test/json/JacksonTester.java +++ b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/JacksonTester.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.test.json; +package org.springframework.boot.json.test; import java.io.IOException; import java.io.InputStream; diff --git a/core/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonContent.java b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/JsonContent.java similarity index 98% rename from core/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonContent.java rename to module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/JsonContent.java index b963c4c894f..209042356b6 100644 --- a/core/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonContent.java +++ b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/JsonContent.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.test.json; +package org.springframework.boot.json.test; import com.jayway.jsonpath.Configuration; import org.assertj.core.api.AssertProvider; diff --git a/core/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonContentAssert.java b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/JsonContentAssert.java similarity index 99% rename from core/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonContentAssert.java rename to module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/JsonContentAssert.java index 93ce0da1ef1..54d04657ed1 100644 --- a/core/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonContentAssert.java +++ b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/JsonContentAssert.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.test.json; +package org.springframework.boot.json.test; import java.io.File; import java.io.InputStream; diff --git a/core/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonLoader.java b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/JsonLoader.java similarity index 98% rename from core/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonLoader.java rename to module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/JsonLoader.java index 6d9f9f99896..47b5d579a15 100644 --- a/core/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonLoader.java +++ b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/JsonLoader.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.test.json; +package org.springframework.boot.json.test; import java.io.ByteArrayInputStream; import java.io.File; diff --git a/core/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonbTester.java b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/JsonbTester.java similarity index 98% rename from core/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonbTester.java rename to module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/JsonbTester.java index b53bac5603f..59448c494a7 100644 --- a/core/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonbTester.java +++ b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/JsonbTester.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.test.json; +package org.springframework.boot.json.test; import java.io.IOException; import java.io.Reader; diff --git a/core/spring-boot-test/src/main/java/org/springframework/boot/test/json/ObjectContent.java b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/ObjectContent.java similarity index 97% rename from core/spring-boot-test/src/main/java/org/springframework/boot/test/json/ObjectContent.java rename to module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/ObjectContent.java index 61a1f2ab1eb..4b2ce8f7791 100644 --- a/core/spring-boot-test/src/main/java/org/springframework/boot/test/json/ObjectContent.java +++ b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/ObjectContent.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.test.json; +package org.springframework.boot.json.test; import org.assertj.core.api.AssertProvider; import org.jspecify.annotations.Nullable; diff --git a/core/spring-boot-test/src/main/java/org/springframework/boot/test/json/ObjectContentAssert.java b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/ObjectContentAssert.java similarity index 97% rename from core/spring-boot-test/src/main/java/org/springframework/boot/test/json/ObjectContentAssert.java rename to module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/ObjectContentAssert.java index d58612f8595..702279e1839 100644 --- a/core/spring-boot-test/src/main/java/org/springframework/boot/test/json/ObjectContentAssert.java +++ b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/ObjectContentAssert.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.test.json; +package org.springframework.boot.json.test; import org.assertj.core.api.AbstractMapAssert; import org.assertj.core.api.AbstractObjectArrayAssert; diff --git a/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/autoconfigure/AutoConfigureJsonTesters.java b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/autoconfigure/AutoConfigureJsonTesters.java index a386694eb47..e70ec8e658a 100644 --- a/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/autoconfigure/AutoConfigureJsonTesters.java +++ b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/autoconfigure/AutoConfigureJsonTesters.java @@ -24,11 +24,11 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; +import org.springframework.boot.json.test.BasicJsonTester; +import org.springframework.boot.json.test.GsonTester; +import org.springframework.boot.json.test.JacksonTester; +import org.springframework.boot.json.test.JsonbTester; import org.springframework.boot.test.autoconfigure.properties.PropertyMapping; -import org.springframework.boot.test.json.BasicJsonTester; -import org.springframework.boot.test.json.GsonTester; -import org.springframework.boot.test.json.JacksonTester; -import org.springframework.boot.test.json.JsonbTester; /** * Annotation that can be applied to a test class to enable and configure diff --git a/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/autoconfigure/JsonTest.java b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/autoconfigure/JsonTest.java index e71492cd06b..7ffaec42210 100644 --- a/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/autoconfigure/JsonTest.java +++ b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/autoconfigure/JsonTest.java @@ -27,11 +27,11 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.json.test.GsonTester; +import org.springframework.boot.json.test.JacksonTester; +import org.springframework.boot.json.test.JsonbTester; import org.springframework.boot.test.autoconfigure.OverrideAutoConfiguration; import org.springframework.boot.test.autoconfigure.filter.TypeExcludeFilters; -import org.springframework.boot.test.json.GsonTester; -import org.springframework.boot.test.json.JacksonTester; -import org.springframework.boot.test.json.JsonbTester; import org.springframework.context.annotation.ComponentScan.Filter; import org.springframework.core.annotation.AliasFor; import org.springframework.core.env.Environment; diff --git a/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/autoconfigure/JsonTestersAutoConfiguration.java b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/autoconfigure/JsonTestersAutoConfiguration.java index 8052dd979d0..ec93204f9b1 100644 --- a/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/autoconfigure/JsonTestersAutoConfiguration.java +++ b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/autoconfigure/JsonTestersAutoConfiguration.java @@ -40,11 +40,11 @@ import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.test.json.AbstractJsonMarshalTester; -import org.springframework.boot.test.json.BasicJsonTester; -import org.springframework.boot.test.json.GsonTester; -import org.springframework.boot.test.json.JacksonTester; -import org.springframework.boot.test.json.JsonbTester; +import org.springframework.boot.json.test.AbstractJsonMarshalTester; +import org.springframework.boot.json.test.BasicJsonTester; +import org.springframework.boot.json.test.GsonTester; +import org.springframework.boot.json.test.JacksonTester; +import org.springframework.boot.json.test.JsonbTester; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ImportRuntimeHints; diff --git a/core/spring-boot-test/src/main/java/org/springframework/boot/test/json/package-info.java b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/package-info.java similarity index 94% rename from core/spring-boot-test/src/main/java/org/springframework/boot/test/json/package-info.java rename to module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/package-info.java index f434c74e693..f07337965bf 100644 --- a/core/spring-boot-test/src/main/java/org/springframework/boot/test/json/package-info.java +++ b/module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/package-info.java @@ -18,6 +18,6 @@ * Support for testing JSON. */ @NullMarked -package org.springframework.boot.test.json; +package org.springframework.boot.json.test; import org.jspecify.annotations.NullMarked; diff --git a/module/spring-boot-json-test/src/main/resources/META-INF/spring.factories b/module/spring-boot-json-test/src/main/resources/META-INF/spring.factories new file mode 100644 index 00000000000..f84213ef22a --- /dev/null +++ b/module/spring-boot-json-test/src/main/resources/META-INF/spring.factories @@ -0,0 +1,3 @@ +# Spring Test Context Customizer Factories +org.springframework.test.context.ContextCustomizerFactory=\ +org.springframework.boot.json.test.DuplicateJsonObjectContextCustomizerFactory diff --git a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/AbstractJsonMarshalTesterTests.java b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/AbstractJsonMarshalTesterTests.java similarity index 99% rename from core/spring-boot-test/src/test/java/org/springframework/boot/test/json/AbstractJsonMarshalTesterTests.java rename to module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/AbstractJsonMarshalTesterTests.java index bc1d7b03570..4fceb0393a6 100644 --- a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/AbstractJsonMarshalTesterTests.java +++ b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/AbstractJsonMarshalTesterTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.test.json; +package org.springframework.boot.json.test; import java.io.ByteArrayInputStream; import java.io.File; diff --git a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/BasicJsonTesterTests.java b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/BasicJsonTesterTests.java similarity index 98% rename from core/spring-boot-test/src/test/java/org/springframework/boot/test/json/BasicJsonTesterTests.java rename to module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/BasicJsonTesterTests.java index aa9afc4f4a6..4ff6c6cf5ea 100644 --- a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/BasicJsonTesterTests.java +++ b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/BasicJsonTesterTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.test.json; +package org.springframework.boot.json.test; import java.io.ByteArrayInputStream; import java.io.File; diff --git a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/DuplicateJsonObjectContextCustomizerFactoryTests.java b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/DuplicateJsonObjectContextCustomizerFactoryTests.java similarity index 97% rename from core/spring-boot-test/src/test/java/org/springframework/boot/test/json/DuplicateJsonObjectContextCustomizerFactoryTests.java rename to module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/DuplicateJsonObjectContextCustomizerFactoryTests.java index 795f0122e0d..f3e10a50ec3 100644 --- a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/DuplicateJsonObjectContextCustomizerFactoryTests.java +++ b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/DuplicateJsonObjectContextCustomizerFactoryTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.test.json; +package org.springframework.boot.json.test; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/ExampleObject.java b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/ExampleObject.java similarity index 96% rename from core/spring-boot-test/src/test/java/org/springframework/boot/test/json/ExampleObject.java rename to module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/ExampleObject.java index 72d09adaec5..3f3fbf81e26 100644 --- a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/ExampleObject.java +++ b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/ExampleObject.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.test.json; +package org.springframework.boot.json.test; import org.springframework.util.ObjectUtils; diff --git a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/ExampleObjectWithView.java b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/ExampleObjectWithView.java similarity index 97% rename from core/spring-boot-test/src/test/java/org/springframework/boot/test/json/ExampleObjectWithView.java rename to module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/ExampleObjectWithView.java index 9482156faef..ce8e7a7f456 100644 --- a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/ExampleObjectWithView.java +++ b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/ExampleObjectWithView.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.test.json; +package org.springframework.boot.json.test; import com.fasterxml.jackson.annotation.JsonView; diff --git a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/GsonTesterIntegrationTests.java b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/GsonTesterIntegrationTests.java similarity index 98% rename from core/spring-boot-test/src/test/java/org/springframework/boot/test/json/GsonTesterIntegrationTests.java rename to module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/GsonTesterIntegrationTests.java index 1bf42e6a3d4..b84f77c1616 100644 --- a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/GsonTesterIntegrationTests.java +++ b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/GsonTesterIntegrationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.test.json; +package org.springframework.boot.json.test; import java.util.LinkedHashMap; import java.util.List; diff --git a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/GsonTesterTests.java b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/GsonTesterTests.java similarity index 98% rename from core/spring-boot-test/src/test/java/org/springframework/boot/test/json/GsonTesterTests.java rename to module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/GsonTesterTests.java index b82e837e4e9..ceddd3a00c1 100644 --- a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/GsonTesterTests.java +++ b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/GsonTesterTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.test.json; +package org.springframework.boot.json.test; import java.util.List; diff --git a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/JacksonTesterIntegrationTests.java b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/JacksonTesterIntegrationTests.java similarity index 99% rename from core/spring-boot-test/src/test/java/org/springframework/boot/test/json/JacksonTesterIntegrationTests.java rename to module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/JacksonTesterIntegrationTests.java index 13208b3965d..8a1f7811bb1 100644 --- a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/JacksonTesterIntegrationTests.java +++ b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/JacksonTesterIntegrationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.test.json; +package org.springframework.boot.json.test; import java.io.Reader; import java.io.StringReader; diff --git a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/JacksonTesterTests.java b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/JacksonTesterTests.java similarity index 98% rename from core/spring-boot-test/src/test/java/org/springframework/boot/test/json/JacksonTesterTests.java rename to module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/JacksonTesterTests.java index de1d17c7ca1..8b50dba46a6 100644 --- a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/JacksonTesterTests.java +++ b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/JacksonTesterTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.test.json; +package org.springframework.boot.json.test; import java.util.List; diff --git a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonContentAssertTests.java b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/JsonContentAssertTests.java similarity index 99% rename from core/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonContentAssertTests.java rename to module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/JsonContentAssertTests.java index 9a6a55181fa..bc65782e82c 100644 --- a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonContentAssertTests.java +++ b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/JsonContentAssertTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.test.json; +package org.springframework.boot.json.test; import java.io.ByteArrayInputStream; import java.io.File; diff --git a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonContentTests.java b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/JsonContentTests.java similarity index 98% rename from core/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonContentTests.java rename to module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/JsonContentTests.java index 4289923778c..250dd2dfa15 100644 --- a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonContentTests.java +++ b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/JsonContentTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.test.json; +package org.springframework.boot.json.test; import com.jayway.jsonpath.Configuration; import org.junit.jupiter.api.Test; diff --git a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonbTesterTests.java b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/JsonbTesterTests.java similarity index 98% rename from core/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonbTesterTests.java rename to module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/JsonbTesterTests.java index eb2a5b4644d..7526d45d9db 100644 --- a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonbTesterTests.java +++ b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/JsonbTesterTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.test.json; +package org.springframework.boot.json.test; import java.util.List; diff --git a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/ObjectContentAssertTests.java b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/ObjectContentAssertTests.java similarity index 98% rename from core/spring-boot-test/src/test/java/org/springframework/boot/test/json/ObjectContentAssertTests.java rename to module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/ObjectContentAssertTests.java index cd4577568e3..9775debe7aa 100644 --- a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/ObjectContentAssertTests.java +++ b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/ObjectContentAssertTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.test.json; +package org.springframework.boot.json.test; import java.util.Collections; import java.util.Map; diff --git a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/ObjectContentTests.java b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/ObjectContentTests.java similarity index 98% rename from core/spring-boot-test/src/test/java/org/springframework/boot/test/json/ObjectContentTests.java rename to module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/ObjectContentTests.java index 33b25e6e630..d2602e3135e 100644 --- a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/ObjectContentTests.java +++ b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/ObjectContentTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.test.json; +package org.springframework.boot.json.test; import org.junit.jupiter.api.Test; diff --git a/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/autoconfigure/JsonTestIntegrationTests.java b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/autoconfigure/JsonTestIntegrationTests.java index f1aded34da6..7c7cbf153ad 100644 --- a/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/autoconfigure/JsonTestIntegrationTests.java +++ b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/autoconfigure/JsonTestIntegrationTests.java @@ -22,15 +22,15 @@ import java.util.UUID; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.json.test.BasicJsonTester; +import org.springframework.boot.json.test.GsonTester; +import org.springframework.boot.json.test.JacksonTester; +import org.springframework.boot.json.test.JsonContent; +import org.springframework.boot.json.test.JsonbTester; import org.springframework.boot.json.test.autoconfigure.app.ExampleBasicObject; import org.springframework.boot.json.test.autoconfigure.app.ExampleCustomObject; import org.springframework.boot.json.test.autoconfigure.app.ExampleJsonApplication; import org.springframework.boot.json.test.autoconfigure.app.ExampleJsonObjectWithView; -import org.springframework.boot.test.json.BasicJsonTester; -import org.springframework.boot.test.json.GsonTester; -import org.springframework.boot.test.json.JacksonTester; -import org.springframework.boot.test.json.JsonContent; -import org.springframework.boot.test.json.JsonbTester; import org.springframework.test.context.ContextConfiguration; import static org.assertj.core.api.Assertions.assertThat; diff --git a/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/autoconfigure/JsonTestWithAutoConfigureJsonTestersTests.java b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/autoconfigure/JsonTestWithAutoConfigureJsonTestersTests.java index 40585c81cda..6b568f85460 100644 --- a/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/autoconfigure/JsonTestWithAutoConfigureJsonTestersTests.java +++ b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/autoconfigure/JsonTestWithAutoConfigureJsonTestersTests.java @@ -19,12 +19,12 @@ package org.springframework.boot.json.test.autoconfigure; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.json.test.BasicJsonTester; +import org.springframework.boot.json.test.GsonTester; +import org.springframework.boot.json.test.JacksonTester; +import org.springframework.boot.json.test.JsonbTester; import org.springframework.boot.json.test.autoconfigure.app.ExampleBasicObject; import org.springframework.boot.json.test.autoconfigure.app.ExampleJsonApplication; -import org.springframework.boot.test.json.BasicJsonTester; -import org.springframework.boot.test.json.GsonTester; -import org.springframework.boot.test.json.JacksonTester; -import org.springframework.boot.test.json.JsonbTester; import org.springframework.test.context.ContextConfiguration; import static org.assertj.core.api.Assertions.assertThat; diff --git a/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/autoconfigure/JsonTestersAutoConfigurationTests.java b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/autoconfigure/JsonTestersAutoConfigurationTests.java index eaf6c3ee12e..933e0a7574a 100644 --- a/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/autoconfigure/JsonTestersAutoConfigurationTests.java +++ b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/autoconfigure/JsonTestersAutoConfigurationTests.java @@ -26,11 +26,11 @@ import org.springframework.aot.hint.predicate.RuntimeHintsPredicates; import org.springframework.aot.test.generate.TestGenerationContext; import org.springframework.boot.gson.autoconfigure.GsonAutoConfiguration; import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration; +import org.springframework.boot.json.test.BasicJsonTester; +import org.springframework.boot.json.test.GsonTester; +import org.springframework.boot.json.test.JacksonTester; +import org.springframework.boot.json.test.JsonbTester; import org.springframework.boot.jsonb.autoconfigure.JsonbAutoConfiguration; -import org.springframework.boot.test.json.BasicJsonTester; -import org.springframework.boot.test.json.GsonTester; -import org.springframework.boot.test.json.JacksonTester; -import org.springframework.boot.test.json.JsonbTester; import org.springframework.boot.test.util.TestPropertyValues; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.aot.ApplicationContextAotGenerator; diff --git a/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/autoconfigure/SpringBootTestWithAutoConfigureJsonTestersTests.java b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/autoconfigure/SpringBootTestWithAutoConfigureJsonTestersTests.java index 157bfe6bc42..32d1820fe1e 100644 --- a/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/autoconfigure/SpringBootTestWithAutoConfigureJsonTestersTests.java +++ b/module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/autoconfigure/SpringBootTestWithAutoConfigureJsonTestersTests.java @@ -19,13 +19,13 @@ package org.springframework.boot.json.test.autoconfigure; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.json.test.BasicJsonTester; +import org.springframework.boot.json.test.GsonTester; +import org.springframework.boot.json.test.JacksonTester; +import org.springframework.boot.json.test.JsonbTester; import org.springframework.boot.json.test.autoconfigure.app.ExampleBasicObject; import org.springframework.boot.json.test.autoconfigure.app.ExampleJsonApplication; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.json.BasicJsonTester; -import org.springframework.boot.test.json.GsonTester; -import org.springframework.boot.test.json.JacksonTester; -import org.springframework.boot.test.json.JsonbTester; import org.springframework.test.context.ContextConfiguration; import static org.assertj.core.api.Assertions.assertThat; diff --git a/core/spring-boot-test/src/test/resources/org/springframework/boot/test/json/different.json b/module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/different.json similarity index 100% rename from core/spring-boot-test/src/test/resources/org/springframework/boot/test/json/different.json rename to module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/different.json diff --git a/core/spring-boot-test/src/test/resources/org/springframework/boot/test/json/example.json b/module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/example.json similarity index 100% rename from core/spring-boot-test/src/test/resources/org/springframework/boot/test/json/example.json rename to module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/example.json diff --git a/core/spring-boot-test/src/test/resources/org/springframework/boot/test/json/lenient-same.json b/module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/lenient-same.json similarity index 100% rename from core/spring-boot-test/src/test/resources/org/springframework/boot/test/json/lenient-same.json rename to module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/lenient-same.json diff --git a/core/spring-boot-test/src/test/resources/org/springframework/boot/test/json/nulls.json b/module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/nulls.json similarity index 100% rename from core/spring-boot-test/src/test/resources/org/springframework/boot/test/json/nulls.json rename to module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/nulls.json diff --git a/core/spring-boot-test/src/test/resources/org/springframework/boot/test/json/simpsons.json b/module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/simpsons.json similarity index 100% rename from core/spring-boot-test/src/test/resources/org/springframework/boot/test/json/simpsons.json rename to module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/simpsons.json diff --git a/core/spring-boot-test/src/test/resources/org/springframework/boot/test/json/source.json b/module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/source.json similarity index 100% rename from core/spring-boot-test/src/test/resources/org/springframework/boot/test/json/source.json rename to module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/source.json diff --git a/core/spring-boot-test/src/test/resources/org/springframework/boot/test/json/types.json b/module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/types.json similarity index 100% rename from core/spring-boot-test/src/test/resources/org/springframework/boot/test/json/types.json rename to module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/types.json diff --git a/module/spring-boot-rsocket-test/build.gradle b/module/spring-boot-rsocket-test/build.gradle new file mode 100644 index 00000000000..7356e0334b7 --- /dev/null +++ b/module/spring-boot-rsocket-test/build.gradle @@ -0,0 +1,32 @@ +/* + * Copyright 2012-present the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +plugins { + id "java-library" + id "org.springframework.boot.deployed" + id "org.springframework.boot.optional-dependencies" + id "org.springframework.boot.test-auto-configuration" +} + +description = "Spring Boot RSocket Test" + +dependencies { + api(project(":module:spring-boot-rsocket")) + + testImplementation(project(":test-support:spring-boot-test-support")) + + testRuntimeOnly("ch.qos.logback:logback-classic") +} diff --git a/core/spring-boot-test/src/main/java/org/springframework/boot/test/rsocket/server/LocalRSocketServerPort.java b/module/spring-boot-rsocket-test/src/main/java/org/springframework/boot/test/rsocket/server/LocalRSocketServerPort.java similarity index 100% rename from core/spring-boot-test/src/main/java/org/springframework/boot/test/rsocket/server/LocalRSocketServerPort.java rename to module/spring-boot-rsocket-test/src/main/java/org/springframework/boot/test/rsocket/server/LocalRSocketServerPort.java diff --git a/core/spring-boot-test/src/main/java/org/springframework/boot/test/rsocket/server/package-info.java b/module/spring-boot-rsocket-test/src/main/java/org/springframework/boot/test/rsocket/server/package-info.java similarity index 100% rename from core/spring-boot-test/src/main/java/org/springframework/boot/test/rsocket/server/package-info.java rename to module/spring-boot-rsocket-test/src/main/java/org/springframework/boot/test/rsocket/server/package-info.java diff --git a/core/spring-boot-test/src/test/java/org/springframework/boot/test/rsocket/server/LocalRSocketServerPortTests.java b/module/spring-boot-rsocket-test/src/test/java/org/springframework/boot/test/rsocket/server/LocalRSocketServerPortTests.java similarity index 100% rename from core/spring-boot-test/src/test/java/org/springframework/boot/test/rsocket/server/LocalRSocketServerPortTests.java rename to module/spring-boot-rsocket-test/src/test/java/org/springframework/boot/test/rsocket/server/LocalRSocketServerPortTests.java diff --git a/module/spring-boot-test-autoconfigure/build.gradle b/module/spring-boot-test-autoconfigure/build.gradle index a56217d0b67..903aaab5ae4 100644 --- a/module/spring-boot-test-autoconfigure/build.gradle +++ b/module/spring-boot-test-autoconfigure/build.gradle @@ -30,32 +30,11 @@ dependencies { compileOnly("org.mockito:mockito-core") optional("org.junit.jupiter:junit-jupiter-api") - - testImplementation(project(":core:spring-boot-testcontainers")) - testImplementation(project(":module:spring-boot-actuator")) - testImplementation(project(":module:spring-boot-actuator-autoconfigure")) + testImplementation(project(":test-support:spring-boot-test-support")) testImplementation("ch.qos.logback:logback-classic") - testImplementation("com.fasterxml.jackson.module:jackson-module-parameter-names") - testImplementation("io.lettuce:lettuce-core") - testImplementation("io.micrometer:micrometer-registry-prometheus") - testImplementation("io.projectreactor.netty:reactor-netty-http") - testImplementation("io.projectreactor:reactor-test") - testImplementation("jakarta.json:jakarta.json-api") - testImplementation("org.apache.commons:commons-pool2") - testImplementation("org.apache.tomcat.embed:tomcat-embed-el") - testImplementation("org.aspectj:aspectjrt") - testImplementation("org.aspectj:aspectjweaver") - testImplementation("org.eclipse:yasson") - testImplementation("org.hibernate.validator:hibernate-validator") - testImplementation("org.jooq:jooq") - testImplementation("org.junit.platform:junit-platform-engine") testImplementation("org.junit.platform:junit-platform-launcher") - testImplementation("org.springframework.hateoas:spring-hateoas") - testImplementation("org.springframework.plugin:spring-plugin-core") - testImplementation("org.springframework.security:spring-security-oauth2-client") - testImplementation("org.thymeleaf:thymeleaf") - testRuntimeOnly(project(":module:spring-boot-tomcat")) - testRuntimeOnly("org.flywaydb:flyway-database-hsqldb") + testRuntimeOnly("org.aspectj:aspectjrt") + testRuntimeOnly("org.aspectj:aspectjweaver") } diff --git a/settings.gradle b/settings.gradle index fee4ee2111e..e34f9c1805c 100644 --- a/settings.gradle +++ b/settings.gradle @@ -165,6 +165,7 @@ include "module:spring-boot-restclient" include "module:spring-boot-restclient-test" include "module:spring-boot-restdocs" include "module:spring-boot-rsocket" +include "module:spring-boot-rsocket-test" include "module:spring-boot-security" include "module:spring-boot-security-test" include "module:spring-boot-security-oauth2-authorization-server" diff --git a/smoke-test/spring-boot-smoke-test-rsocket/build.gradle b/smoke-test/spring-boot-smoke-test-rsocket/build.gradle index 9300a377377..24ea34f9e1c 100644 --- a/smoke-test/spring-boot-smoke-test-rsocket/build.gradle +++ b/smoke-test/spring-boot-smoke-test-rsocket/build.gradle @@ -25,6 +25,7 @@ dependencies { implementation(project(":starter:spring-boot-starter-security")) implementation("org.springframework.security:spring-security-rsocket") + testImplementation(project(":module:spring-boot-rsocket-test")) testImplementation(project(":starter:spring-boot-starter-test")) testImplementation("io.projectreactor:reactor-test") } diff --git a/smoke-test/spring-boot-smoke-test-test/src/test/java/smoketest/test/service/VehicleDetailsJsonTests.java b/smoke-test/spring-boot-smoke-test-test/src/test/java/smoketest/test/service/VehicleDetailsJsonTests.java index a166e48ad21..90d613c18e8 100644 --- a/smoke-test/spring-boot-smoke-test-test/src/test/java/smoketest/test/service/VehicleDetailsJsonTests.java +++ b/smoke-test/spring-boot-smoke-test-test/src/test/java/smoketest/test/service/VehicleDetailsJsonTests.java @@ -19,8 +19,8 @@ package smoketest.test.service; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.json.test.JacksonTester; import org.springframework.boot.json.test.autoconfigure.JsonTest; -import org.springframework.boot.test.json.JacksonTester; import static org.assertj.core.api.Assertions.assertThat; diff --git a/system-test/spring-boot-image-system-tests/build.gradle b/system-test/spring-boot-image-system-tests/build.gradle index 35eeb0f2148..1a20b8a9fd4 100644 --- a/system-test/spring-boot-image-system-tests/build.gradle +++ b/system-test/spring-boot-image-system-tests/build.gradle @@ -50,9 +50,10 @@ dependencies { exclude group: "org.hibernate.validator" } + systemTestImplementation(project(":buildpack:spring-boot-buildpack-platform")) + systemTestImplementation(project(":module:spring-boot-json-test")) systemTestImplementation(project(":starter:spring-boot-starter-test")) systemTestImplementation(project(":test-support:spring-boot-gradle-test-support")) - systemTestImplementation(project(":buildpack:spring-boot-buildpack-platform")) systemTestImplementation(gradleTestKit()) systemTestImplementation("org.assertj:assertj-core") systemTestImplementation("org.testcontainers:junit-jupiter") diff --git a/system-test/spring-boot-image-system-tests/src/systemTest/java/org/springframework/boot/image/assertions/ContainerConfigAssert.java b/system-test/spring-boot-image-system-tests/src/systemTest/java/org/springframework/boot/image/assertions/ContainerConfigAssert.java index dbf5dcea437..cf529c1e311 100644 --- a/system-test/spring-boot-image-system-tests/src/systemTest/java/org/springframework/boot/image/assertions/ContainerConfigAssert.java +++ b/system-test/spring-boot-image-system-tests/src/systemTest/java/org/springframework/boot/image/assertions/ContainerConfigAssert.java @@ -31,7 +31,7 @@ import org.assertj.core.api.AbstractObjectAssert; import org.assertj.core.api.ListAssert; import org.assertj.core.api.ObjectAssert; -import org.springframework.boot.test.json.JsonContentAssert; +import org.springframework.boot.json.test.JsonContentAssert; /** * AssertJ {@link org.assertj.core.api.Assert} for Docker image container configuration. diff --git a/system-test/spring-boot-image-system-tests/src/systemTest/java/org/springframework/boot/image/assertions/ImageAssert.java b/system-test/spring-boot-image-system-tests/src/systemTest/java/org/springframework/boot/image/assertions/ImageAssert.java index fbc242a647d..d185a76e6f8 100644 --- a/system-test/spring-boot-image-system-tests/src/systemTest/java/org/springframework/boot/image/assertions/ImageAssert.java +++ b/system-test/spring-boot-image-system-tests/src/systemTest/java/org/springframework/boot/image/assertions/ImageAssert.java @@ -33,7 +33,7 @@ import org.assertj.core.api.ListAssert; import org.springframework.boot.buildpack.platform.docker.DockerApi; import org.springframework.boot.buildpack.platform.docker.type.ImageReference; import org.springframework.boot.buildpack.platform.docker.type.Layer; -import org.springframework.boot.test.json.JsonContentAssert; +import org.springframework.boot.json.test.JsonContentAssert; import org.springframework.util.StreamUtils; /**