PasswordValidationAction extends AbstractAuthorizableAction { @Override public void onCreate(@NotNull User user, @Nullable String password, @NotNull Root root, @NotNull NamePathMapper namePathMapper) throws RepositoryException { validatePassword(password, false); }  @Override void init(SecurityProvider securityProvider, ConfigurationParameters config); @Override void onCreate(@NotNull User user, @Nullable String password, @NotNull Root root, @NotNull NamePathMapper namePathMapper); @Override void onPasswordChange(@NotNull User user, @Nullable String newPassword, @NotNull Root root, @NotNull NamePathMapper namePathMapper); static final String CONSTRAINT; }
@Test public void testOnCreateNullPw() throws Exception { pwAction.onCreate(user, null, root, namePathMapper); }
@Test(expected = ConstraintViolationException.class) public void testOnCreateInvalidPw() throws Exception { pwAction.onCreate(user, "pw", root, namePathMapper); }
@Test(expected = ConstraintViolationException.class) public void testOnCreateEmptyPw() throws Exception { pwAction.onCreate(user, "", root, namePathMapper); }
@Test public void testOnCreateValidPw() throws Exception { pwAction.onCreate(user, "abCDefGH", root, namePathMapper); }
@Test public void testOnCreateHashedInvalidPw() throws Exception { pwAction.onCreate(user, PasswordUtil.buildPasswordHash("pw1"), root, namePathMapper); }