public void verifyPasswordEncoderBySHA1() {
final PasswordEncoderProperties p = new PasswordEncoderProperties();
p.setType(PasswordEncoderProperties.PasswordEncoderTypes.DEFAULT.name());
p.setEncodingAlgorithm("SHA-1");
p.setCharacterEncoding("UTF-8");
<BUG>final PasswordEncoder e = new SpringSecurityPasswordEncoder(Beans.newPasswordEncoder(p));
assertTrue(e.matches("asd123", "2891baceeef1652ee698294da0e71ba78a2a4064"));</BUG>
}
@Test
public void verifyPasswordEncoderBySHA256() {

public void verifyPasswordEncoderBySHA1() {
final PasswordEncoderProperties p = new PasswordEncoderProperties();
p.setType(PasswordEncoderProperties.PasswordEncoderTypes.DEFAULT.name());
p.setEncodingAlgorithm("SHA-1");
p.setCharacterEncoding("UTF-8");
final PasswordEncoder e = Beans.newPasswordEncoder(p);
assertTrue(e.matches("asd123", "2891baceeef1652ee698294da0e71ba78a2a4064"));
}
@Test
public void verifyPasswordEncoderBySHA256() {
