소스 검색

Set Integration Test LDAP Port to Zero

Closes gh-8762
Josh Cummings 5 년 전
부모
커밋
95f1f81010
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      ldap/src/integration-test/java/org/springframework/security/ldap/ApacheDsContainerConfig.java

+ 3 - 2
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