diff options
author | Wouter Admiraal <wouter.admiraal@sonarsource.com> | 2021-04-29 11:26:05 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2021-04-29 20:03:27 +0000 |
commit | 9fcb622a986e9b8110cccf1be0467cd43a8f58dc (patch) | |
tree | f0c1c2811ce26545e1db5b4cc2a399c4bd1fd6d4 /server/sonar-webserver-auth/src | |
parent | db8f11adf1df8de48ca9a4ec00e820f6636db6d5 (diff) | |
download | sonarqube-9fcb622a986e9b8110cccf1be0467cd43a8f58dc.tar.gz sonarqube-9fcb622a986e9b8110cccf1be0467cd43a8f58dc.zip |
SONAR-14320 Fix unit test
Diffstat (limited to 'server/sonar-webserver-auth/src')
-rw-r--r-- | server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/CredentialsLocalAuthenticationTest.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/CredentialsLocalAuthenticationTest.java b/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/CredentialsLocalAuthenticationTest.java index 7cac4072035..2d7ab741fb3 100644 --- a/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/CredentialsLocalAuthenticationTest.java +++ b/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/CredentialsLocalAuthenticationTest.java @@ -310,9 +310,13 @@ public class CredentialsLocalAuthenticationTest { .setCryptedPassword(DigestUtils.sha1Hex("--" + salt + "--" + password + "--")) .setSalt(salt); + assertThatThrownBy(() -> underTest.authenticate(dbSession, userInvalidHash, "WHATEVER", AuthenticationEvent.Method.BASIC)) + .isInstanceOf(AuthenticationException.class) + .hasMessage("invalid hash stored"); + UserDto userInvalidIterations = newUserDto() .setHashMethod(PBKDF2.name()) - .setCryptedPassword("$$") + .setCryptedPassword("a$") .setSalt(salt); assertThatThrownBy(() -> underTest.authenticate(dbSession, userInvalidIterations, "WHATEVER", AuthenticationEvent.Method.BASIC)) |