use of org.passay.PasswordGenerator in project cia by Hack23.
the class UserRoleSystemTest method generatePassword.
private String generatePassword() {
final List<CharacterRule> rules = Arrays.asList(new CharacterRule(EnglishCharacterData.UpperCase, 1), new CharacterRule(EnglishCharacterData.LowerCase, 1), new CharacterRule(EnglishCharacterData.Digit, 1), new CharacterRule(EnglishCharacterData.Special, 1));
final PasswordGenerator generator = new PasswordGenerator();
// Generated password is 12 characters long, which complies with policy
return generator.generatePassword(12, rules);
}
Aggregations