Package org.apache.hadoop.hbase.http
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 Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
End of fields required by ApacheDSTestExtensionprotected static URL
static org.apache.directory.server.core.api.DirectoryService
The class DirectoryService instancestatic org.apache.directory.server.ldap.LdapServer
The class LdapServer instancestatic org.apache.directory.server.core.api.DirectoryService
The current DirectoryService instancestatic org.apache.directory.ldap.client.template.LdapConnectionTemplate
The Ldap connection templatestatic org.apache.directory.server.ldap.LdapServer
The current LdapServer instanceprivate static final org.slf4j.Logger
static org.apache.directory.server.core.api.DirectoryService
The test DirectoryService instancestatic org.apache.directory.server.ldap.LdapServer
The test LdapServer instancestatic long
The current revisionprotected static org.apache.hadoop.hbase.http.HttpServer
Fields inherited from class org.apache.hadoop.hbase.http.HttpServerFunctionalTest
TEST_BUILD_WEBAPPS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate String
getBasicAuthHeader
(String credentials) Generates a Basic Authentication header from the provided credentials.protected static org.apache.directory.server.ldap.LdapServer
protected HttpURLConnection
openConnection
(String endpoint, String credentials) Opens an HTTP connection to the specified endpoint with optional Basic Authentication.protected static void
setLdapConfigurations
(org.apache.hadoop.conf.Configuration conf) Configures the provided Configuration object for LDAP authentication.static void
Sets up the HTTP server with LDAP authentication before any tests are run.static void
Stops the HTTP server after all tests are completed.Methods inherited from class org.apache.hadoop.hbase.http.HttpServerFunctionalTest
access, createAndStartTestServer, createServer, createServer, createServer, createServer, createServer, createTestServer, createTestServer, createTestServer, createTestServer, createTestServerWithSecurity, createTestServerWithSecurityAndAcl, deleteRecursively, getFreePort, getServerURL, prepareTestWebapp, readOutput, stop
-
Field Details
-
LOG
-
server
-
baseUrl
-
classDirectoryService
The class DirectoryService instance -
methodDirectoryService
The test DirectoryService instance -
directoryService
The current DirectoryService instance -
classLdapServer
The class LdapServer instance -
methodLdapServer
The test LdapServer instance -
ldapServer
The current LdapServer instance -
ldapConnectionTemplate
public static org.apache.directory.ldap.client.template.LdapConnectionTemplate ldapConnectionTemplateThe Ldap connection template -
revision
The current revision -
AUTH_TYPE
End of fields required by ApacheDSTestExtension- See Also:
-
-
Constructor Details
-
LdapServerTestBase
public LdapServerTestBase()
-
-
Method Details
-
getLdapServer
-
setupServer
Sets up the HTTP server with LDAP authentication before any tests are run.- Throws:
Exception
- if an error occurs during server setup
-
stopServer
Stops the HTTP server after all tests are completed.- Throws:
Exception
- if an error occurs during server shutdown
-
setLdapConfigurations
Configures the provided Configuration object for LDAP authentication.- Parameters:
conf
- the Configuration object to set LDAP properties on
-
getBasicAuthHeader
Generates a Basic Authentication header from the provided credentials.- Parameters:
credentials
- the credentials to encode- Returns:
- the Basic Authentication header
-
openConnection
Opens an HTTP connection to the specified endpoint with optional Basic Authentication.- Parameters:
endpoint
- the endpoint to connect tocredentials
- the credentials for Basic Authentication (optional)- Returns:
- the opened HttpURLConnection
- Throws:
IOException
- if an error occurs while opening the connection
-