AuthenticationManagerDaoImpl extends AuthenticationManager { public boolean checkPassword(User user, String passwd) { return DigestUtils.shaHex(passwd).equalsIgnoreCase(user.getPassword()); } AuthenticationManagerDaoImpl(ConfigurationUtil cfg, IUserRolesService userRolesService); static AuthenticationManager getDefault(); boolean checkPassword(User user, String passwd); @Override void changePassword(User user, String password); String resetPassword(User user, String[] rnd0, String[] rnd1, String[] rnd2, String[] rnd3, String[] rnd4); String resetPasswordExternal(User user, String[] rnd0, String[] rnd1, String[] rnd2, String[] rnd3, String[] rnd4);  }
@Test public void givenCorrectPasswordChecksPassword() throws Exception { assertThat(sut.checkPassword(user, PASSWORD), is(Boolean.TRUE)); }
@Test public void givenIncorrectPasswordChecksPassword() throws Exception { assertThat(sut.checkPassword(user, "incorrect-password"), is(Boolean.FALSE)); }