From fcbed8ffd98791a03258eb4feb75021d16dc63ae Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Fri, 6 Jan 2017 11:52:12 +0100 Subject: [PATCH 1/2] Upgrade to Spring Data Ingalls RC1 See gh-6785 --- spring-boot-dependencies/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-dependencies/pom.xml b/spring-boot-dependencies/pom.xml index 73b463b3f9..a658a55fae 100644 --- a/spring-boot-dependencies/pom.xml +++ b/spring-boot-dependencies/pom.xml @@ -155,7 +155,7 @@ 1.7.0.RC1 1.2.3.RELEASE 3.0.7.RELEASE - Ingalls-BUILD-SNAPSHOT + Ingalls-RC1 0.23.0.RELEASE 4.3.6.RELEASE 1.2.1.RELEASE From 4523927e28f4c32ac66adb7dc28701481da6371e Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Fri, 6 Jan 2017 12:44:32 +0100 Subject: [PATCH 2/2] Polish --- .../boot/autoconfigure/ldap/LdapProperties.java | 3 +-- .../META-INF/additional-spring-configuration-metadata.json | 6 ++++++ .../data/ldap/LdapDataAutoConfigurationTests.java | 4 +++- .../autoconfigure/ldap/LdapAutoConfigurationTests.java | 7 +------ .../src/main/asciidoc/appendix-application-properties.adoc | 3 +++ 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/LdapProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/LdapProperties.java index 35c8ad8b9f..f3ec7f5941 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/LdapProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/LdapProperties.java @@ -21,12 +21,11 @@ import java.util.Map; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.core.env.Environment; -import org.springframework.ldap.core.LdapTemplate; import org.springframework.util.Assert; import org.springframework.util.ObjectUtils; /** - * Configuration properties to configure {@link LdapTemplate}. + * Configuration properties for LDAP. * * @author EddĂș MelĂ©ndez * @since 1.5.0 diff --git a/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json index da5955848e..3c7335f02c 100644 --- a/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -78,6 +78,12 @@ "description": "Enable JPA repositories.", "defaultValue": true }, + { + "name": "spring.data.ldap.repositories.enabled", + "type": "java.lang.Boolean", + "description": "Enable LDAP repositories.", + "defaultValue": true + }, { "name": "spring.data.mongodb.repositories.enabled", "type": "java.lang.Boolean", diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/ldap/LdapDataAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/ldap/LdapDataAutoConfigurationTests.java index 1301db97c9..7f92ededb2 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/ldap/LdapDataAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/ldap/LdapDataAutoConfigurationTests.java @@ -38,7 +38,9 @@ public class LdapDataAutoConfigurationTests { @After public void close() { - this.context.close(); + if (this.context != null) { + this.context.close(); + } } @Test diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfigurationTests.java index 102e205a6b..8381792c74 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfigurationTests.java @@ -17,7 +17,6 @@ package org.springframework.boot.autoconfigure.ldap; import org.junit.After; -import org.junit.Before; import org.junit.Test; import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration; @@ -37,11 +36,6 @@ public class LdapAutoConfigurationTests { private AnnotationConfigApplicationContext context; - @Before - public void setup() { - this.context = new AnnotationConfigApplicationContext(); - } - @After public void close() { if (this.context != null) { @@ -87,6 +81,7 @@ public class LdapAutoConfigurationTests { } private void load(String... properties) { + this.context = new AnnotationConfigApplicationContext(); EnvironmentTestUtils.addEnvironment(this.context, properties); this.context.register(LdapAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class); 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 0bf46b335b..38c4a77945 100644 --- a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -576,6 +576,9 @@ content into your application; rather pick only the properties that you need. spring.data.elasticsearch.properties.*= # Additional properties used to configure the client. spring.data.elasticsearch.repositories.enabled=true # Enable Elasticsearch repositories. + # DATA LDAP + spring.data.ldap.repositories.enabled=true # Enable LDAP repositories. + # MONGODB ({sc-spring-boot-autoconfigure}/mongo/MongoProperties.{sc-ext}[MongoProperties]) spring.data.mongodb.authentication-database= # Authentication database name. spring.data.mongodb.database=test # Database name.