From 95f1f81010b3bf036652c76594beb6897f1c51e6 Mon Sep 17 00:00:00 2001 From: Josh Cummings Date: Thu, 25 Jun 2020 14:21:02 -0600 Subject: [PATCH] Set Integration Test LDAP Port to Zero Closes gh-8762 --- .../security/ldap/ApacheDsContainerConfig.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ldap/src/integration-test/java/org/springframework/security/ldap/ApacheDsContainerConfig.java b/ldap/src/integration-test/java/org/springframework/security/ldap/ApacheDsContainerConfig.java index 29e68a4835..ec6cd0fc7a 100644 --- a/ldap/src/integration-test/java/org/springframework/security/ldap/ApacheDsContainerConfig.java +++ b/ldap/src/integration-test/java/org/springframework/security/ldap/ApacheDsContainerConfig.java @@ -34,13 +34,14 @@ public class ApacheDsContainerConfig { ApacheDSContainer ldapContainer() throws Exception { this.container = new ApacheDSContainer("dc=springframework,dc=org", "classpath:test-server.ldif"); + this.container.setPort(0); return this.container; } @Bean - ContextSource contextSource() throws Exception { + ContextSource contextSource(ApacheDSContainer ldapContainer) throws Exception { return new DefaultSpringSecurityContextSource("ldap://127.0.0.1:" - + ldapContainer().getPort() + "/dc=springframework,dc=org"); + + ldapContainer.getLocalPort() + "/dc=springframework,dc=org"); } @PreDestroy