@Test public void testEnableDisable() throws Exception { User user = getTestUser(); Tree userTree = root.getTree(user.getPath()); PasswordHistory history = new PasswordHistory(CONFIG); for (String pw : PASSWORDS) { assertTrue(history.updatePasswordHistory(userTree, pw)); } assertEquals(10, getHistory(user).size()); history = new PasswordHistory(ConfigurationParameters.EMPTY); history.updatePasswordHistory(userTree, PASSWORDS[8]); assertEquals(10, getHistory(user).size()); }
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);   }