Skip to content

Commit 4a1a98c

Browse files
Wzy19930507mhalbritter
authored andcommitted
Apply @AutoConfigureJson to test slices
See gh-39253
1 parent ba265e5 commit 4a1a98c

7 files changed

+6
-11
lines changed

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/AutoConfigureJsonTesters.java

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
@Retention(RetentionPolicy.RUNTIME)
4242
@Documented
4343
@Inherited
44+
@AutoConfigureJson
4445
@ImportAutoConfiguration
4546
@PropertyMapping("spring.test.jsontesters")
4647
public @interface AutoConfigureJsonTesters {

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTest.java

-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
@OverrideAutoConfiguration(enabled = false)
7171
@TypeExcludeFilters(JsonTypeExcludeFilter.class)
7272
@AutoConfigureCache
73-
@AutoConfigureJson
7473
@AutoConfigureJsonTesters
7574
@ImportAutoConfiguration
7675
public @interface JsonTest {

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/client/AutoConfigureWebClient.java

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.lang.annotation.Target;
2525

2626
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
27+
import org.springframework.boot.test.autoconfigure.json.AutoConfigureJson;
2728
import org.springframework.boot.test.autoconfigure.properties.PropertyMapping;
2829
import org.springframework.boot.web.client.RestTemplateBuilder;
2930
import org.springframework.web.client.RestTemplate;
@@ -40,6 +41,7 @@
4041
@Retention(RetentionPolicy.RUNTIME)
4142
@Documented
4243
@Inherited
44+
@AutoConfigureJson
4345
@ImportAutoConfiguration
4446
@PropertyMapping("spring.test.webclient")
4547
public @interface AutoConfigureWebClient {

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/AutoConfigureWebMvc.java

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.lang.annotation.Target;
2525

2626
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
27+
import org.springframework.boot.test.autoconfigure.json.AutoConfigureJson;
2728

2829
/**
2930
* {@link ImportAutoConfiguration Auto-configuration imports} for typical Spring MVC
@@ -39,6 +40,7 @@
3940
@Retention(RetentionPolicy.RUNTIME)
4041
@Documented
4142
@Inherited
43+
@AutoConfigureJson
4244
@ImportAutoConfiguration
4345
public @interface AutoConfigureWebMvc {
4446

Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
# AutoConfigureJsonTesters auto-configuration imports
2-
org.springframework.boot.test.autoconfigure.json.JsonTestersAutoConfiguration
3-
org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration
4-
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
5-
org.springframework.boot.autoconfigure.jsonb.JsonbAutoConfiguration
2+
org.springframework.boot.test.autoconfigure.json.JsonTestersAutoConfiguration
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
# AutoConfigureWebClient auto-configuration imports
22
org.springframework.boot.test.autoconfigure.web.client.WebClientRestTemplateAutoConfiguration
3-
org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration
43
org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration
54
org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration
6-
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
7-
org.springframework.boot.autoconfigure.jsonb.JsonbAutoConfiguration
85
org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration
96
org.springframework.boot.autoconfigure.web.client.RestClientAutoConfiguration
107
org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAutoConfiguration

spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureWebMvc.imports

-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@ org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration
33
org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration
44
org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration
55
org.springframework.boot.autoconfigure.groovy.template.GroovyTemplateAutoConfiguration
6-
org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration
76
org.springframework.boot.autoconfigure.hateoas.HypermediaAutoConfiguration
87
org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration
9-
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
10-
org.springframework.boot.autoconfigure.jsonb.JsonbAutoConfiguration
118
org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration
129
org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration
1310
org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration

0 commit comments

Comments
 (0)