Skip to content

Commit 4f875ad

Browse files
committed
Rely on configuration properties annotation processor
This commit switches from manual metadata to using the configuration properties annotation processor like other modules do. This reduces the amount of manual metadata, document missing properties and prevent inconsistencies going forward. Closes gh-46584
1 parent 1e52d54 commit 4f875ad

File tree

4 files changed

+26
-44
lines changed

4 files changed

+26
-44
lines changed

spring-boot-project/spring-boot-test-autoconfigure/build.gradle

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
plugins {
1818
id "java-library"
19+
id "org.springframework.boot.configuration-properties"
1920
id "org.springframework.boot.deployed"
2021
id "org.springframework.boot.docker-test"
2122
id "org.springframework.boot.optional-dependencies"
@@ -146,16 +147,6 @@ dependencies {
146147
testImplementation("org.thymeleaf:thymeleaf")
147148
}
148149

149-
configurations {
150-
configurationPropertiesMetadata
151-
}
152-
153-
artifacts {
154-
configurationPropertiesMetadata new File(sourceSets.main.output.resourcesDir, "META-INF/spring-configuration-metadata.json"), { artifact ->
155-
artifact.builtBy sourceSets.main.processResourcesTaskName
156-
}
157-
}
158-
159150
test {
160151
include "**/*Tests.class"
161152
}

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,19 @@ public class SpringBootMockMvcBuilderCustomizer implements MockMvcBuilderCustomi
5959

6060
private final WebApplicationContext context;
6161

62+
/**
63+
* Whether to add servlet filters.
64+
*/
6265
private boolean addFilters = true;
6366

67+
/**
68+
* MVC Print option.
69+
*/
6470
private MockMvcPrint print = MockMvcPrint.DEFAULT;
6571

72+
/**
73+
* Whether to only print failed exchanges.
74+
*/
6675
private boolean printOnlyOnFailure = true;
6776

6877
/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"properties": [
3+
{
4+
"name": "spring.test.database.replace",
5+
"type": "org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase$Replace",
6+
"description": "Type of existing DataSource to replace.",
7+
"defaultValue": "any"
8+
},
9+
{
10+
"name": "spring.test.observability.auto-configure",
11+
"type": "java.lang.Boolean",
12+
"description": "Whether observability should be auto-configured in tests.",
13+
"defaultValue": false
14+
}
15+
]
16+
}

spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring-configuration-metadata.json

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)