StrongPasswordValidator implements IValidator<String> { @Override public void validate(IValidatable<String> pass) { if (badLength(pass.getValue())) { error(pass, "bad.password.short", Map.of("0", getMinPasswdLength())); } if (noLowerCase(pass.getValue())) { error(pass, "bad.password.lower"); } if (noUpperCase(pass.getValue())) { error(pass, "bad.password.upper"); } if (noDigit(pass.getValue())) { error(pass, "bad.password.digit"); } if (noSymbol(pass.getValue())) { error(pass, "bad.password.special"); } if (hasStopWords(pass.getValue())) { error(pass, "bad.password.stop"); } } StrongPasswordValidator(final User u);  StrongPasswordValidator(final boolean web, final User u); @Override void validate(IValidatable<String> pass); void setUser(User u);  }
@Test void testDefCtr() { runWrapped(() -> { Validatable<String> pass = new Validatable<>(null); StrongPasswordValidator validator = new StrongPasswordValidator(new User()); validator.validate(pass); assertEquals(5, pass.getErrors().size()); }); }