Skip to content

Commit 7a75fb0

Browse files
committed
Fix test-specific configuration metadata
Most of the config keys defined by the `spring-boot-test-autoconfigure` module can't be overridden because they are mapped with `@PropertyMapping` on an annotation. It is confusing that such keys are exposed in content assistance as using them will have no effect. This commit removes the annotation processor from the build so that the `@ConfigurationProperties` beans aren't processed anymore. Instead, manual metadata is written for the two only keys that are effectively used in regular configuration. As a result, the `additional-spring-configuration-metadata` file has been renamed to `spring-configuration-metadata` since nothing is processing it anymore. Closes spring-projectsgh-7887
1 parent 973a18d commit 7a75fb0

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,5 +1195,6 @@ content into your application; rather pick only the properties that you need.
11951195
# ----------------------------------------
11961196
11971197
spring.test.database.replace=any # Type of existing DataSource to replace.
1198+
spring.test.mockmvc.print=default # MVC Print option.
11981199
11991200
----

spring-boot-test-autoconfigure/pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,6 @@
121121
<artifactId>spring-security-test</artifactId>
122122
<optional>true</optional>
123123
</dependency>
124-
<!-- Annotation processing -->
125-
<dependency>
126-
<groupId>org.springframework.boot</groupId>
127-
<artifactId>spring-boot-configuration-processor</artifactId>
128-
<optional>true</optional>
129-
</dependency>
130124
<!-- Test -->
131125
<dependency>
132126
<groupId>org.springframework.boot</groupId>

spring-boot-test-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json renamed to spring-boot-test-autoconfigure/src/main/resources/META-INF/spring-configuration-metadata.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
"type": "org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase$Replace",
66
"description": "Type of existing DataSource to replace.",
77
"defaultValue": "any"
8+
},
9+
{
10+
"name": "spring.test.mockmvc.print",
11+
"type": "org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrint",
12+
"description": "MVC Print option.",
13+
"defaultValue": "default"
814
}
915
]
1016
}

0 commit comments

Comments
 (0)