Skip to content

Commit 95f1f81

Browse files
committed
Set Integration Test LDAP Port to Zero
Closes gh-8762
1 parent feb49ea commit 95f1f81

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ldap/src/integration-test/java/org/springframework/security/ldap/ApacheDsContainerConfig.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,14 @@ public class ApacheDsContainerConfig {
3434
ApacheDSContainer ldapContainer() throws Exception {
3535
this.container = new ApacheDSContainer("dc=springframework,dc=org",
3636
"classpath:test-server.ldif");
37+
this.container.setPort(0);
3738
return this.container;
3839
}
3940

4041
@Bean
41-
ContextSource contextSource() throws Exception {
42+
ContextSource contextSource(ApacheDSContainer ldapContainer) throws Exception {
4243
return new DefaultSpringSecurityContextSource("ldap://127.0.0.1:"
43-
+ ldapContainer().getPort() + "/dc=springframework,dc=org");
44+
+ ldapContainer.getLocalPort() + "/dc=springframework,dc=org");
4445
}
4546

4647
@PreDestroy

0 commit comments

Comments
 (0)