Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set maxPasswordLength in password tests #19735

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ void testValidatePasswordGet_PasswordValid() {

@Test
void testValidatePasswordGet_PasswordNotValid() {
POST("/systemSettings/maxPasswordLength", "72").content(HttpStatus.OK);
assertMessage(
"response",
"error",
Expand All @@ -209,6 +210,7 @@ void testValidatePasswordPost_PasswordValid() {

@Test
void testValidatePasswordPost_PasswordNotValid() {
POST("/systemSettings/maxPasswordLength", "72").content(HttpStatus.OK);
assertMessage(
"response",
"error",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ void testChangePassword() {

@Test
void testChangePassword_WrongNew() {
POST("/systemSettings/maxPasswordLength", "72").content(HttpStatus.OK);
assertEquals(
"Password must have at least 8, and at most 72 characters",
PUT("/me/changePassword", "{'oldPassword':'district','newPassword':'secret'}")
Expand Down Expand Up @@ -203,6 +204,7 @@ void testValidatePasswordText() {

@Test
void testValidatePasswordText_TooShort() {
POST("/systemSettings/maxPasswordLength", "72").content(HttpStatus.OK);
JsonPasswordValidation result =
POST("/me/validatePassword", ContentType("text/plain"), Body("secret"))
.content()
Expand All @@ -214,6 +216,7 @@ void testValidatePasswordText_TooShort() {

@Test
void testValidatePasswordText_TooLong() {
POST("/systemSettings/maxPasswordLength", "72").content(HttpStatus.OK);
JsonPasswordValidation result =
POST(
"/me/validatePassword",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ void selfRegSurnameTooLong() {
void selfRegInvalidPassword(String input, String expectedError) {
disableRecaptcha();
enableSelfRegistration();

POST("/systemSettings/maxPasswordLength", "72").content(HttpStatus.OK);
assertWebMessage(
"Bad Request",
400,
Expand Down Expand Up @@ -527,7 +527,7 @@ void inviteRegSurnameTooLong() {
@DisplayName("Invite registration error when invalid password data")
void inviteRegInvalidPassword(String password, String expectedError) {
disableRecaptcha();

POST("/systemSettings/maxPasswordLength", "72").content(HttpStatus.OK);
assertWebMessage(
"Bad Request",
400,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,7 @@ void testReplicateUser_PasswordNotSpecified() {

@Test
void testReplicateUser_PasswordNotValid() {
POST("/systemSettings/maxPasswordLength", "72").content(HttpStatus.OK);
assertWebMessage(
"Conflict",
409,
Expand Down
Loading