Class EmbeddedLdapServer.Builder

java.lang.Object
org.springframework.ldap.test.unboundid.EmbeddedLdapServer.Builder
Enclosing class:
EmbeddedLdapServer

public static final class EmbeddedLdapServer.Builder extends Object
Helper class for embedded Unboundid ldap server.
Since:
3.3
  • Method Details

    • port

      public EmbeddedLdapServer.Builder port(int 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 the InMemoryDirectoryServerConfig.
      Parameters:
      configurationCustomizer - a Consumer function that will be applied to the InMemoryDirectoryServerConfig before creating the InMemoryDirectoryServer. The default values, it a Consumer function that does nothing: (config) -> {}
      Returns:
      this EmbeddedLdapServer.Builder instance.
    • partitionName

      public EmbeddedLdapServer.Builder partitionName(String 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

      public EmbeddedLdapServer build()
      Builds and returns a EmbeddedLdapServer.

      In order to start the server, you should call EmbeddedLdapServer.start().

      Returns:
      a new EmbeddedLdapServer.