Class EmbeddedLdapServer.Builder
java.lang.Object
org.springframework.ldap.test.unboundid.EmbeddedLdapServer.Builder
- Enclosing class:
- EmbeddedLdapServer
Helper class for embedded Unboundid ldap server.
- Since:
- 3.3
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns aEmbeddedLdapServer.configurationCustomizer(Consumer<com.unboundid.ldap.listener.InMemoryDirectoryServerConfig> configurationCustomizer) Sets a customizer for theInMemoryDirectoryServerConfig.partitionName(String partitionName) Sets the partition name for the embedded LDAP server.port(int port) Sets the port for the embedded LDAP server.
-
Method Details
-
port
Sets the port for the embedded LDAP server.- Parameters:
port- the port for the embedded LDAP server. Defaults to 0 in which case the server should automatically choose an available port.- Returns:
- this
EmbeddedLdapServer.Builderinstance.
-
configurationCustomizer
public EmbeddedLdapServer.Builder configurationCustomizer(Consumer<com.unboundid.ldap.listener.InMemoryDirectoryServerConfig> configurationCustomizer) Sets a customizer for theInMemoryDirectoryServerConfig.- Parameters:
configurationCustomizer- aConsumerfunction that will be applied to theInMemoryDirectoryServerConfigbefore creating theInMemoryDirectoryServer. The default values, it a Consumer function that does nothing: (config) -> {}- Returns:
- this
EmbeddedLdapServer.Builderinstance.
-
partitionName
Sets the partition name for the embedded LDAP server.- Parameters:
partitionName- the partition name for the embedded LDAP server. Defaults to the left most element of the partition suffix.- Returns:
- this
EmbeddedLdapServer.Builderinstance.
-
build
Builds and returns aEmbeddedLdapServer.In order to start the server, you should call
EmbeddedLdapServer.start().- Returns:
- a new
EmbeddedLdapServer.
-