-
Notifications
You must be signed in to change notification settings - Fork 86
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
Update signup with empty names #299
Merged
Merged
Changes from 15 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
75fa243
update signup account model for empty names
uchitsa 259a1b8
add test for signup account with empty names
uchitsa 0c12ef6
empty row
uchitsa 68b2c3c
fix createAccountWithEmptyNames test
uchitsa 5ed862f
fix lombok imports
uchitsa 4382def
fix min size to 0 for names
uchitsa 0060eef
Merge branch 'Hexlet:main' into fix-name-not-required
uchitsa 194b85e
fix min size to 0 for names
uchitsa 5ebe1b7
update createAccountWithEmptyNames test
uchitsa 166ff71
update createAccountWithEmptyNames test
uchitsa 8816f2e
Update SignupControllerIT.java
uchitsa 185c982
Update UpdateProfile.java
uchitsa 4099d62
Update SignupControllerIT.java
uchitsa 133ac70
Update SignupControllerIT.java
uchitsa 0185d3a
Update UpdateProfile.java
uchitsa 93c3eb3
Merge branch 'Hexlet:main' into fix-name-not-required
uchitsa a7e8a1f
#286 update SignupControllerIT.java
uchitsa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,7 @@ static void datasourceProperties(DynamicPropertyRegistry registry) { | |
|
||
private static final String EMAIL_UPPER_CASE = "[email protected]"; | ||
private static final String EMAIL_LOWER_CASE = EMAIL_UPPER_CASE.toLowerCase(); | ||
private static final String EMPTY_NAME = ""; | ||
|
||
private final SignupAccountModel model = new SignupAccountModel( | ||
"model_upper_case", | ||
|
@@ -93,6 +94,23 @@ void createAccountWithIgnoreEmailCase() throws Exception { | |
assertThat(accountRepository.count()).isEqualTo(1L); | ||
} | ||
|
||
@Test | ||
void createAccountWithEmptyNames() throws Exception { | ||
String emptyNamesUser = "testEmptyNamesUser"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Лучше просто username, email, если считаете, что переменные нужны. А то сейчас диссонанс, называется empty, а по факту там не путсая строка There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. исправлено |
||
String emptyNamesEmail = "[email protected]"; | ||
String emptyNamesPassword = "P@$$w0rd"; | ||
mockMvc.perform(post("/signup") | ||
.param("username", emptyNamesUser) | ||
.param("email", emptyNamesEmail) | ||
.param("password", emptyNamesPassword) | ||
.param("confirmPassword", emptyNamesPassword) | ||
.param("firstName", EMPTY_NAME) | ||
.param("lastName", EMPTY_NAME) | ||
.with(csrf())) | ||
.andReturn(); | ||
assertThat(accountRepository.findAccountByEmail(emptyNamesEmail)).isNotEmpty(); | ||
} | ||
|
||
@Test | ||
void createAccountWithWrongEmailDomain() throws Exception { | ||
String userName = "testUser"; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Давайте не будем это в статические свойства класса выносить. У нас ведь только один тест использует это свойство. Достаточно локальной переменной
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
исправлено