"UniqueCharactersPasswordValidator",
"ds-cfg-enabled: true",
"ds-cfg-min-unique-characters: 0",
"ds-cfg-case-sensitive-validation: true");
UniqueCharactersPasswordValidatorCfg configuration =
AdminTestCaseUtils.getConfiguration(
UniqueCharactersPasswordValidatorCfgDefn.getInstance(),
validatorEntry);
UniqueCharactersPasswordValidator validator =
new UniqueCharactersPasswordValidator();
validator.initializePasswordValidator(configuration);
ByteString password = ByteString.valueOf("aaaaaaaa");
ArrayList<Modification> mods = new ArrayList<Modification>();
mods.add(new Modification(ModificationType.REPLACE,
Attributes.create("userpassword", "aaaaaaaa")));
InternalClientConnection conn =
InternalClientConnection.getRootConnection();
ModifyOperationBasis modifyOperation =
new ModifyOperationBasis(conn, conn.nextOperationID(),
conn.nextMessageID(),
new ArrayList<Control>(),
DN.decode("uid=test.user,o=test"), mods);
MessageBuilder invalidReason = new MessageBuilder();
assertTrue(validator.passwordIsAcceptable(password,
new HashSet<ByteString>(0), modifyOperation,
userEntry, invalidReason),
invalidReason.toString());
Entry updatedValidatorEntry = TestCaseUtils.makeEntry(
"dn: cn=Unique Characters,cn=Password Validators,cn=config",
"objectClass: top",
"objectClass: ds-cfg-password-validator",
"objectClass: ds-cfg-unique-characters-password-validator",
"cn: Unique Characters",
"ds-cfg-java-class: org.nasutekds.server.extensions." +
"UniqueCharactersPasswordValidator",
"ds-cfg-enabled: true",
"ds-cfg-min-unique-characters: 5",
"ds-cfg-case-sensitive-validation: true");
UniqueCharactersPasswordValidatorCfg updatedConfiguration =
AdminTestCaseUtils.getConfiguration(
UniqueCharactersPasswordValidatorCfgDefn.getInstance(),
updatedValidatorEntry);
ArrayList<Message> unacceptableReasons = new ArrayList<Message>();