Package de.cuioss.test.generator.domain
Class DistinguishedNamesGenerator
java.lang.Object
de.cuioss.test.generator.domain.DistinguishedNamesGenerator
- All Implemented Interfaces:
TypedGenerator<String>
Generates LDAP Distinguished Names (DN) for testing purposes.
The generated DNs follow the standard format of comma-separated name-value pairs.
Components:
- Prefixes: ou (Organizational Unit), o (Organization), dc (Domain Component)
- Values: Common LDAP terms like proxies, accounts, groups, roles, etc.
Generation rules:
- Each DN contains 2-12 components
- Components are in the format prefix=value
- Components are joined with commas
Example outputs:
"ou=proxies,dc=accounts,o=services" "dc=groups,ou=roles,dc=ID"
Example usage:
var generator = new DistinguishedNamesGenerator(); String dn = generator.next(); // Returns a valid LDAP DN string
- Author:
- Oliver Wolff
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
DistinguishedNamesGenerator
public DistinguishedNamesGenerator()
-
-
Method Details
-
next
Description copied from interface:TypedGeneratorGenerates the next instance based on the generator's configuration. Implementations must ensure thread-safety.- Specified by:
nextin interfaceTypedGenerator<String>- Returns:
- A newly created instance. May be null if the generator explicitly supports null value generation.
-
getType
Description copied from interface:TypedGeneratorProvides type information about what kind of objects this generator creates. The default implementation uses the first non-null result fromTypedGenerator.next()to determine the type.Note: If your generator may return null values or the generated type differs from the actual instance type, you should override this method.
- Specified by:
getTypein interfaceTypedGenerator<String>- Returns:
- The class information indicating which type this generator is responsible for.
-