DelegatingPasswordEncoder handles null encodedPassword

Fixes: gh-4872
This commit is contained in:
Rob Winch
2017-11-27 10:51:30 -06:00
parent e377dcf81b
commit f558b5016c
2 changed files with 8 additions and 0 deletions

View File

@@ -177,4 +177,9 @@ public class DelegatingPasswordEncoderTests {
verify(this.invalidId).matches(this.rawPassword, this.encodedPassword);
verifyZeroInteractions(this.bcrypt, this.noop);
}
@Test(expected = IllegalStateException.class)
public void matchesWhenRawPasswordNotNullAndEncodedPasswordNullThenThrowsIllegalStateException() {
this.passwordEncoder.matches(this.rawPassword, null);
}
}