BCryptPasswordEncoder rawPassword cannot be null
Closes gh-8317
This commit is contained in:
committed by
Rob Winch
parent
39e09e4ca5
commit
4b2afdf825
@@ -200,4 +200,16 @@ public class BCryptPasswordEncoderTests {
|
||||
encoder.upgradeEncoding("not-a-bcrypt-password");
|
||||
}
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void encodeNullRawPassword() {
|
||||
BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
|
||||
encoder.encode(null);
|
||||
}
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void matchNullRawPassword() {
|
||||
BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
|
||||
encoder.matches(null, "does-not-matter");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user