Browse Source

Modularize spring-boot-test

Closes gh-46356
pull/47334/head
Andy Wilkinson 3 months ago
parent
commit
0b601118bd
  1. 15
      core/spring-boot-test/build.gradle
  2. 3
      core/spring-boot-test/src/main/resources/META-INF/spring.factories
  3. 2
      documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/testing/spring-boot-applications.adoc
  4. 2
      documentation/spring-boot-docs/src/main/java/org/springframework/boot/docs/testing/springbootapplications/jsontests/MyJsonAssertJTests.java
  5. 2
      documentation/spring-boot-docs/src/main/java/org/springframework/boot/docs/testing/springbootapplications/jsontests/MyJsonTests.java
  6. 2
      documentation/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/testing/springbootapplications/jsontests/MyJsonAssertJTests.kt
  7. 2
      documentation/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/testing/springbootapplications/jsontests/MyJsonTests.kt
  8. 1
      module/spring-boot-actuator/build.gradle
  9. 2
      module/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/JacksonJmxOperationResponseMapperTests.java
  10. 3
      module/spring-boot-json-test/build.gradle
  11. 2
      module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/AbstractJsonMarshalTester.java
  12. 2
      module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/BasicJsonTester.java
  13. 2
      module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/DuplicateJsonObjectContextCustomizerFactory.java
  14. 2
      module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/GsonTester.java
  15. 2
      module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/JacksonTester.java
  16. 2
      module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/JsonContent.java
  17. 2
      module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/JsonContentAssert.java
  18. 2
      module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/JsonLoader.java
  19. 2
      module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/JsonbTester.java
  20. 2
      module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/ObjectContent.java
  21. 2
      module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/ObjectContentAssert.java
  22. 8
      module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/autoconfigure/AutoConfigureJsonTesters.java
  23. 6
      module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/autoconfigure/JsonTest.java
  24. 10
      module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/autoconfigure/JsonTestersAutoConfiguration.java
  25. 2
      module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/package-info.java
  26. 3
      module/spring-boot-json-test/src/main/resources/META-INF/spring.factories
  27. 2
      module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/AbstractJsonMarshalTesterTests.java
  28. 2
      module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/BasicJsonTesterTests.java
  29. 2
      module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/DuplicateJsonObjectContextCustomizerFactoryTests.java
  30. 2
      module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/ExampleObject.java
  31. 2
      module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/ExampleObjectWithView.java
  32. 2
      module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/GsonTesterIntegrationTests.java
  33. 2
      module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/GsonTesterTests.java
  34. 2
      module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/JacksonTesterIntegrationTests.java
  35. 2
      module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/JacksonTesterTests.java
  36. 2
      module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/JsonContentAssertTests.java
  37. 2
      module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/JsonContentTests.java
  38. 2
      module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/JsonbTesterTests.java
  39. 2
      module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/ObjectContentAssertTests.java
  40. 2
      module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/ObjectContentTests.java
  41. 10
      module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/autoconfigure/JsonTestIntegrationTests.java
  42. 8
      module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/autoconfigure/JsonTestWithAutoConfigureJsonTestersTests.java
  43. 8
      module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/autoconfigure/JsonTestersAutoConfigurationTests.java
  44. 8
      module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/autoconfigure/SpringBootTestWithAutoConfigureJsonTestersTests.java
  45. 0
      module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/different.json
  46. 0
      module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/example.json
  47. 0
      module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/lenient-same.json
  48. 0
      module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/nulls.json
  49. 0
      module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/simpsons.json
  50. 0
      module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/source.json
  51. 0
      module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/types.json
  52. 32
      module/spring-boot-rsocket-test/build.gradle
  53. 0
      module/spring-boot-rsocket-test/src/main/java/org/springframework/boot/test/rsocket/server/LocalRSocketServerPort.java
  54. 0
      module/spring-boot-rsocket-test/src/main/java/org/springframework/boot/test/rsocket/server/package-info.java
  55. 0
      module/spring-boot-rsocket-test/src/test/java/org/springframework/boot/test/rsocket/server/LocalRSocketServerPortTests.java
  56. 27
      module/spring-boot-test-autoconfigure/build.gradle
  57. 1
      settings.gradle
  58. 1
      smoke-test/spring-boot-smoke-test-rsocket/build.gradle
  59. 2
      smoke-test/spring-boot-smoke-test-test/src/test/java/smoketest/test/service/VehicleDetailsJsonTests.java
  60. 3
      system-test/spring-boot-image-system-tests/build.gradle
  61. 2
      system-test/spring-boot-image-system-tests/src/systemTest/java/org/springframework/boot/image/assertions/ContainerConfigAssert.java
  62. 2
      system-test/spring-boot-image-system-tests/src/systemTest/java/org/springframework/boot/image/assertions/ImageAssert.java

15
core/spring-boot-test/build.gradle

@ -27,31 +27,18 @@ dependencies { @@ -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")

3
core/spring-boot-test/src/main/resources/META-INF/spring.factories

@ -1,8 +1,7 @@ @@ -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=\

2
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 @@ -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:

2
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; @@ -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;

2
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; @@ -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;

2
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 @@ -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<SomeObject>) {

2
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 @@ -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<VehicleDetails>) {

1
module/spring-boot-actuator/build.gradle

@ -65,6 +65,7 @@ dependencies { @@ -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")

2
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; @@ -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;

3
module/spring-boot-json-test/build.gradle

@ -32,7 +32,10 @@ dependencies { @@ -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"))

2
core/spring-boot-test/src/main/java/org/springframework/boot/test/json/AbstractJsonMarshalTester.java → module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/AbstractJsonMarshalTester.java

@ -14,7 +14,7 @@ @@ -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;

2
core/spring-boot-test/src/main/java/org/springframework/boot/test/json/BasicJsonTester.java → module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/BasicJsonTester.java

@ -14,7 +14,7 @@ @@ -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;

2
core/spring-boot-test/src/main/java/org/springframework/boot/test/json/DuplicateJsonObjectContextCustomizerFactory.java → module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/DuplicateJsonObjectContextCustomizerFactory.java

@ -14,7 +14,7 @@ @@ -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;

2
core/spring-boot-test/src/main/java/org/springframework/boot/test/json/GsonTester.java → module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/GsonTester.java

@ -14,7 +14,7 @@ @@ -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;

2
core/spring-boot-test/src/main/java/org/springframework/boot/test/json/JacksonTester.java → module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/JacksonTester.java

@ -14,7 +14,7 @@ @@ -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;

2
core/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonContent.java → module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/JsonContent.java

@ -14,7 +14,7 @@ @@ -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;

2
core/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonContentAssert.java → module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/JsonContentAssert.java

@ -14,7 +14,7 @@ @@ -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;

2
core/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonLoader.java → module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/JsonLoader.java

@ -14,7 +14,7 @@ @@ -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;

2
core/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonbTester.java → module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/JsonbTester.java

@ -14,7 +14,7 @@ @@ -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;

2
core/spring-boot-test/src/main/java/org/springframework/boot/test/json/ObjectContent.java → module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/ObjectContent.java

@ -14,7 +14,7 @@ @@ -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;

2
core/spring-boot-test/src/main/java/org/springframework/boot/test/json/ObjectContentAssert.java → module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/ObjectContentAssert.java

@ -14,7 +14,7 @@ @@ -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;

8
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; @@ -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

6
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; @@ -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;

10
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; @@ -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;

2
core/spring-boot-test/src/main/java/org/springframework/boot/test/json/package-info.java → module/spring-boot-json-test/src/main/java/org/springframework/boot/json/test/package-info.java

@ -18,6 +18,6 @@ @@ -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;

3
module/spring-boot-json-test/src/main/resources/META-INF/spring.factories

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
# Spring Test Context Customizer Factories
org.springframework.test.context.ContextCustomizerFactory=\
org.springframework.boot.json.test.DuplicateJsonObjectContextCustomizerFactory

2
core/spring-boot-test/src/test/java/org/springframework/boot/test/json/AbstractJsonMarshalTesterTests.java → module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/AbstractJsonMarshalTesterTests.java

@ -14,7 +14,7 @@ @@ -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;

2
core/spring-boot-test/src/test/java/org/springframework/boot/test/json/BasicJsonTesterTests.java → module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/BasicJsonTesterTests.java

@ -14,7 +14,7 @@ @@ -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;

2
core/spring-boot-test/src/test/java/org/springframework/boot/test/json/DuplicateJsonObjectContextCustomizerFactoryTests.java → module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/DuplicateJsonObjectContextCustomizerFactoryTests.java

@ -14,7 +14,7 @@ @@ -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;

2
core/spring-boot-test/src/test/java/org/springframework/boot/test/json/ExampleObject.java → module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/ExampleObject.java

@ -14,7 +14,7 @@ @@ -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;

2
core/spring-boot-test/src/test/java/org/springframework/boot/test/json/ExampleObjectWithView.java → module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/ExampleObjectWithView.java

@ -14,7 +14,7 @@ @@ -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;

2
core/spring-boot-test/src/test/java/org/springframework/boot/test/json/GsonTesterIntegrationTests.java → module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/GsonTesterIntegrationTests.java

@ -14,7 +14,7 @@ @@ -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;

2
core/spring-boot-test/src/test/java/org/springframework/boot/test/json/GsonTesterTests.java → module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/GsonTesterTests.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.test.json;
package org.springframework.boot.json.test;
import java.util.List;

2
core/spring-boot-test/src/test/java/org/springframework/boot/test/json/JacksonTesterIntegrationTests.java → module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/JacksonTesterIntegrationTests.java

@ -14,7 +14,7 @@ @@ -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;

2
core/spring-boot-test/src/test/java/org/springframework/boot/test/json/JacksonTesterTests.java → module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/JacksonTesterTests.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.test.json;
package org.springframework.boot.json.test;
import java.util.List;

2
core/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonContentAssertTests.java → module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/JsonContentAssertTests.java

@ -14,7 +14,7 @@ @@ -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;

2
core/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonContentTests.java → module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/JsonContentTests.java

@ -14,7 +14,7 @@ @@ -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;

2
core/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonbTesterTests.java → module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/JsonbTesterTests.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.test.json;
package org.springframework.boot.json.test;
import java.util.List;

2
core/spring-boot-test/src/test/java/org/springframework/boot/test/json/ObjectContentAssertTests.java → module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/ObjectContentAssertTests.java

@ -14,7 +14,7 @@ @@ -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;

2
core/spring-boot-test/src/test/java/org/springframework/boot/test/json/ObjectContentTests.java → module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/ObjectContentTests.java

@ -14,7 +14,7 @@ @@ -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;

10
module/spring-boot-json-test/src/test/java/org/springframework/boot/json/test/autoconfigure/JsonTestIntegrationTests.java

@ -22,15 +22,15 @@ import java.util.UUID; @@ -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;

8
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; @@ -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;

8
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; @@ -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;

8
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; @@ -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;

0
core/spring-boot-test/src/test/resources/org/springframework/boot/test/json/different.json → module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/different.json

0
core/spring-boot-test/src/test/resources/org/springframework/boot/test/json/example.json → module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/example.json

0
core/spring-boot-test/src/test/resources/org/springframework/boot/test/json/lenient-same.json → module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/lenient-same.json

0
core/spring-boot-test/src/test/resources/org/springframework/boot/test/json/nulls.json → module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/nulls.json

0
core/spring-boot-test/src/test/resources/org/springframework/boot/test/json/simpsons.json → module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/simpsons.json

0
core/spring-boot-test/src/test/resources/org/springframework/boot/test/json/source.json → module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/source.json

0
core/spring-boot-test/src/test/resources/org/springframework/boot/test/json/types.json → module/spring-boot-json-test/src/test/resources/org/springframework/boot/json/test/types.json

32
module/spring-boot-rsocket-test/build.gradle

@ -0,0 +1,32 @@ @@ -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")
}

0
core/spring-boot-test/src/main/java/org/springframework/boot/test/rsocket/server/LocalRSocketServerPort.java → module/spring-boot-rsocket-test/src/main/java/org/springframework/boot/test/rsocket/server/LocalRSocketServerPort.java

0
core/spring-boot-test/src/main/java/org/springframework/boot/test/rsocket/server/package-info.java → module/spring-boot-rsocket-test/src/main/java/org/springframework/boot/test/rsocket/server/package-info.java

0
core/spring-boot-test/src/test/java/org/springframework/boot/test/rsocket/server/LocalRSocketServerPortTests.java → module/spring-boot-rsocket-test/src/test/java/org/springframework/boot/test/rsocket/server/LocalRSocketServerPortTests.java

27
module/spring-boot-test-autoconfigure/build.gradle

@ -30,32 +30,11 @@ dependencies { @@ -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")
}

1
settings.gradle

@ -165,6 +165,7 @@ include "module:spring-boot-restclient" @@ -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"

1
smoke-test/spring-boot-smoke-test-rsocket/build.gradle

@ -25,6 +25,7 @@ dependencies { @@ -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")
}

2
smoke-test/spring-boot-smoke-test-test/src/test/java/smoketest/test/service/VehicleDetailsJsonTests.java

@ -19,8 +19,8 @@ package smoketest.test.service; @@ -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;

3
system-test/spring-boot-image-system-tests/build.gradle

@ -50,9 +50,10 @@ dependencies { @@ -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")

2
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; @@ -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.

2
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; @@ -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;
/**

Loading…
Cancel
Save