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

[WIP] CODENVY-627 Check for reserved usernames on user creation #1511

Closed
wants to merge 6 commits into from

Conversation

mkuznyetsov
Copy link
Contributor

No description provided.

@benoitf
Copy link
Contributor

benoitf commented Jun 15, 2016

Missing test to check ConflictException when calling create method with a reserved name

@@ -68,6 +76,9 @@ public UserManager(UserDao userDao,
* when any other error occurs
*/
public void create(User user, boolean isTemporary) throws ConflictException, ServerException {
if (isNameReserved(user.getName())) {
throw new ConflictException("Username is reserved");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add name to exception message

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@mkuznyetsov mkuznyetsov changed the title CODENVY-627 Check for reserved usernames on user creation [WIP] CODENVY-627 Check for reserved usernames on user creation Jun 15, 2016
@codenvy-ci
Copy link

@Test
public void shouldCreateProfileAndPreferencesOnUserCreation() throws Exception {
final User user = new User().withEmail("test@email.com").withName("testName");
manager.create(user, false);

new UserManager(userDao, profileDao, preferenceDao, new String[0]).create(user, false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mb it would be better to create instance of UserManager in method annotated with @BeforeMethod

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it's ok as is it. If there will be more tests, maybe then add BeforeMethod.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mb it would be better to create instance of UserManager in method annotated with @BeforeMethod
+1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@codenvy-ci
Copy link

Build # 926 - FAILED

Please check console output at http://ci.codenvy-dev.com/jenkins/job/che-pullrequests-build/926/ to view the results.

@@ -68,6 +74,9 @@ public UserManager(UserDao userDao,
* when any other error occurs
*/
public void create(User user, boolean isTemporary) throws ConflictException, ServerException {
if (reservedNames.contains(user.getName())) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I propose to do this case-insensitive

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@skabashnyuk
Copy link
Contributor

ок, wait for feature approval before merge

@skabashnyuk skabashnyuk added this to the 4.5.0 milestone Jun 17, 2016
@codenvy-ci
Copy link

Build # 940 - FAILED

Please check console output at http://ci.codenvy-dev.com/jenkins/job/che-pullrequests-build/940/ to view the results.

@skabashnyuk
Copy link
Contributor

ci-build

@codenvy-ci
Copy link

Build # 949 - FAILED

Please check console output at http://ci.codenvy-dev.com/jenkins/job/che-pullrequests-build/949/ to view the results.

@mkuznyetsov
Copy link
Contributor Author

merged as part of #1572

@mkuznyetsov mkuznyetsov closed this Jul 7, 2016
@mkuznyetsov mkuznyetsov deleted the CODENVY-627 branch July 7, 2016 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants