Merge branch '3.0.x' into 3.1.x
Closes gh-38248
This commit is contained in:
@@ -36,6 +36,7 @@ import static org.mockito.BDDMockito.then;
|
||||
* Tests for {@link EncodePasswordCommand}.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Moritz Halbritter
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class EncodePasswordCommandTests {
|
||||
@@ -63,6 +64,17 @@ class EncodePasswordCommandTests {
|
||||
assertThat(status).isEqualTo(ExitStatus.OK);
|
||||
}
|
||||
|
||||
@Test
|
||||
void encodeWithDefaultShouldUseBcrypt() throws Exception {
|
||||
EncodePasswordCommand command = new EncodePasswordCommand();
|
||||
ExitStatus status = command.run("-a", "default", "boot");
|
||||
then(this.log).should().info(assertArg((message) -> {
|
||||
assertThat(message).startsWith("{bcrypt}");
|
||||
assertThat(PasswordEncoderFactories.createDelegatingPasswordEncoder().matches("boot", message)).isTrue();
|
||||
}));
|
||||
assertThat(status).isEqualTo(ExitStatus.OK);
|
||||
}
|
||||
|
||||
@Test
|
||||
void encodeWithBCryptShouldUseBCrypt() throws Exception {
|
||||
EncodePasswordCommand command = new EncodePasswordCommand();
|
||||
|
||||
Reference in New Issue
Block a user