@Test public void testSingleTypeHistoryProperty() throws Exception { Tree userTree = root.getTree(getTestUser().getPath()); Tree pwdNode = TreeUtil.getOrAddChild(userTree, REP_PWD, NT_REP_PASSWORD); pwdNode.setProperty(REP_PWD_HISTORY, "singleValuedProperty"); assertFalse(pwdNode.getProperty(REP_PWD_HISTORY).isArray()); assertFalse(pwdNode.getProperty(REP_PWD_HISTORY).getType().isArray()); PasswordHistory history = new PasswordHistory(CONFIG); assertTrue(history.updatePasswordHistory(userTree, "anyOtherPassword")); assertTrue(pwdNode.getProperty(REP_PWD_HISTORY).isArray()); assertTrue(pwdNode.getProperty(REP_PWD_HISTORY).getType().isArray()); }
boolean updatePasswordHistory(@NotNull Tree userTree, @NotNull String password) throws ConstraintViolationException, AccessDeniedException { boolean updated = false; if (isEnabled) { checkPasswordInHistory(userTree, password); updated = shiftPasswordHistory(userTree); } return updated; }
PasswordHistory implements UserConstants { boolean updatePasswordHistory(@NotNull Tree userTree, @NotNull String password) throws ConstraintViolationException, AccessDeniedException { boolean updated = false; if (isEnabled) { checkPasswordInHistory(userTree, password); updated = shiftPasswordHistory(userTree); } return updated; } }
PasswordHistory implements UserConstants { boolean updatePasswordHistory(@NotNull Tree userTree, @NotNull String password) throws ConstraintViolationException, AccessDeniedException { boolean updated = false; if (isEnabled) { checkPasswordInHistory(userTree, password); updated = shiftPasswordHistory(userTree); } return updated; } PasswordHistory(@NotNull ConfigurationParameters config); }
PasswordHistory implements UserConstants { boolean updatePasswordHistory(@NotNull Tree userTree, @NotNull String password) throws ConstraintViolationException, AccessDeniedException { boolean updated = false; if (isEnabled) { checkPasswordInHistory(userTree, password); updated = shiftPasswordHistory(userTree); } return updated; } PasswordHistory(@NotNull ConfigurationParameters config);  }
PasswordHistory implements UserConstants { boolean updatePasswordHistory(@NotNull Tree userTree, @NotNull String password) throws ConstraintViolationException, AccessDeniedException { boolean updated = false; if (isEnabled) { checkPasswordInHistory(userTree, password); updated = shiftPasswordHistory(userTree); } return updated; } PasswordHistory(@NotNull ConfigurationParameters config);   }