Class LdapServerTestBase

java.lang.Object
org.apache.hadoop.hbase.http.HttpServerFunctionalTest
org.apache.hadoop.hbase.http.LdapServerTestBase
Direct Known Subclasses:
TestLdapAdminACL, TestLdapHttpServer

@ExtendWith(org.apache.directory.server.core.integ.ApacheDSTestExtension.class) public class LdapServerTestBase extends HttpServerFunctionalTest
Base class for setting up and testing an HTTP server with LDAP authentication.
  • Field Details

    • LOG

      private static final org.slf4j.Logger LOG
    • server

      protected static org.apache.hadoop.hbase.http.HttpServer server
    • baseUrl

      protected static URL baseUrl
    • classDirectoryService

      public static org.apache.directory.server.core.api.DirectoryService classDirectoryService
      The class DirectoryService instance
    • methodDirectoryService

      public static org.apache.directory.server.core.api.DirectoryService methodDirectoryService
      The test DirectoryService instance
    • directoryService

      public static org.apache.directory.server.core.api.DirectoryService directoryService
      The current DirectoryService instance
    • classLdapServer

      public static org.apache.directory.server.ldap.LdapServer classLdapServer
      The class LdapServer instance
    • methodLdapServer

      public static org.apache.directory.server.ldap.LdapServer methodLdapServer
      The test LdapServer instance
    • ldapServer

      public static org.apache.directory.server.ldap.LdapServer ldapServer
      The current LdapServer instance
    • ldapConnectionTemplate

      public static org.apache.directory.ldap.client.template.LdapConnectionTemplate ldapConnectionTemplate
      The Ldap connection template
    • revision

      public static long revision
      The current revision
    • AUTH_TYPE

      private static final String AUTH_TYPE
      End of fields required by ApacheDSTestExtension
      See Also:
  • Constructor Details

  • Method Details

    • getLdapServer

      protected static org.apache.directory.server.ldap.LdapServer getLdapServer()
    • setupServer

      @BeforeAll public static void setupServer() throws Exception
      Sets up the HTTP server with LDAP authentication before any tests are run.
      Throws:
      Exception - if an error occurs during server setup
    • stopServer

      @AfterAll public static void stopServer() throws Exception
      Stops the HTTP server after all tests are completed.
      Throws:
      Exception - if an error occurs during server shutdown
    • setLdapConfigurations

      protected static void setLdapConfigurations(org.apache.hadoop.conf.Configuration conf)
      Configures the provided Configuration object for LDAP authentication.
      Parameters:
      conf - the Configuration object to set LDAP properties on
    • getBasicAuthHeader

      private String getBasicAuthHeader(String credentials)
      Generates a Basic Authentication header from the provided credentials.
      Parameters:
      credentials - the credentials to encode
      Returns:
      the Basic Authentication header
    • openConnection

      protected HttpURLConnection openConnection(String endpoint, String credentials) throws IOException
      Opens an HTTP connection to the specified endpoint with optional Basic Authentication.
      Parameters:
      endpoint - the endpoint to connect to
      credentials - the credentials for Basic Authentication (optional)
      Returns:
      the opened HttpURLConnection
      Throws:
      IOException - if an error occurs while opening the connection