PasswordPolicyConfig masterPasswdPolicyConfig = createNiceMock(PasswordPolicyConfig.class);
expect(masterPasswdPolicyConfig.getMinLength()).andReturn(8).anyTimes();
expect(masterPasswdPolicyConfig.getMaxLength()).andReturn(-1).anyTimes();
PasswordValidatorImpl masterPasswdValidator = new PasswordValidatorImpl(secMgr);
masterPasswdValidator.setConfig(masterPasswdPolicyConfig);
expect(secMgr.loadPasswordValidator(PasswordValidator.MASTERPASSWORD_NAME))
.andReturn(masterPasswdValidator).anyTimes();
expect(secMgr.listPasswordValidators()).andReturn(
new TreeSet<String>(Arrays.asList(PasswordValidator.DEFAULT_NAME, PasswordValidator.MASTERPASSWORD_NAME))).anyTimes();;