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.Builder
instance.
-
configurationCustomizer
public EmbeddedLdapServer.Builder configurationCustomizer(Consumer<com.unboundid.ldap.listener.InMemoryDirectoryServerConfig> configurationCustomizer) Sets a customizer for theInMemoryDirectoryServerConfig
.- Parameters:
configurationCustomizer
- aConsumer
function that will be applied to theInMemoryDirectoryServerConfig
before creating theInMemoryDirectoryServer
. The default values, it a Consumer function that does nothing: (config) -> {}- Returns:
- this
EmbeddedLdapServer.Builder
instance.
-
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.Builder
instance.
-
build
Builds and returns aEmbeddedLdapServer
.In order to start the server, you should call
EmbeddedLdapServer.start()
.- Returns:
- a new
EmbeddedLdapServer
.
-