Skip to content

Commit

Permalink
[Hexlet#260] fix workspace email validation message interpolation wit…
Browse files Browse the repository at this point in the history
…h test
  • Loading branch information
d1z3d committed Jun 15, 2024
1 parent c5ccfa6 commit 4cdfb60
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
@NoArgsConstructor
public class WorkspaceUserModel {

@Email(regexp = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", message = "The email \"{0}\" is not valid")
@Email(regexp = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
message = "The email \"${validatedValue}\" is not valid")
private String email;
}
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ void addUserNonValidEmailTest() throws Exception {
.with(csrf()))
.andReturn();
var body = response.getResponse().getContentAsString();
assertThat(body).contains("The email %s is not valid", ACCOUNT_INCORRECT_EMAIL);
assertThat(body).contains(String.format("The email "%s" is not valid", ACCOUNT_INCORRECT_EMAIL));
}
}

Expand Down

0 comments on commit 4cdfb60

Please sign in to comment.