From 7a75fb0f385fac863abf5b58290bba440f908d08 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Fri, 6 Jan 2017 10:12:57 +0100 Subject: [PATCH] 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 gh-7887 --- .../src/main/asciidoc/appendix-application-properties.adoc | 1 + spring-boot-test-autoconfigure/pom.xml | 6 ------ ...ion-metadata.json => spring-configuration-metadata.json} | 6 ++++++ 3 files changed, 7 insertions(+), 6 deletions(-) rename spring-boot-test-autoconfigure/src/main/resources/META-INF/{additional-spring-configuration-metadata.json => spring-configuration-metadata.json} (55%) diff --git a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc index 82e83fdf38c..0bf46b335bf 100644 --- a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -1195,5 +1195,6 @@ content into your application; rather pick only the properties that you need. # ---------------------------------------- spring.test.database.replace=any # Type of existing DataSource to replace. + spring.test.mockmvc.print=default # MVC Print option. ---- diff --git a/spring-boot-test-autoconfigure/pom.xml b/spring-boot-test-autoconfigure/pom.xml index 2fd8ee33312..d894c5be02f 100644 --- a/spring-boot-test-autoconfigure/pom.xml +++ b/spring-boot-test-autoconfigure/pom.xml @@ -121,12 +121,6 @@ spring-security-test true - - - org.springframework.boot - spring-boot-configuration-processor - true - org.springframework.boot diff --git a/spring-boot-test-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring-configuration-metadata.json similarity index 55% rename from spring-boot-test-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json rename to spring-boot-test-autoconfigure/src/main/resources/META-INF/spring-configuration-metadata.json index 309ca1ae3ff..aae714fa7ad 100644 --- a/spring-boot-test-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring-configuration-metadata.json @@ -5,6 +5,12 @@ "type": "org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase$Replace", "description": "Type of existing DataSource to replace.", "defaultValue": "any" + }, + { + "name": "spring.test.mockmvc.print", + "type": "org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrint", + "description": "MVC Print option.", + "defaultValue": "default" } ] } \ No newline at end of file