Browse Source

SONAR-14320 Fix unit test

tags/8.9.0.43852
Wouter Admiraal 3 years ago
parent
commit
9fcb622a98

+ 5
- 1
server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/CredentialsLocalAuthenticationTest.java View File

@@ -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))

Loading…
Cancel
Save