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

Review #1327

Merged
merged 4 commits into from
Nov 15, 2016
Merged

Review #1327

merged 4 commits into from
Nov 15, 2016

Conversation

jbartece
Copy link
Contributor

No description provided.

@jbartece
Copy link
Contributor Author

@matejonnet @michalszynkiewicz review, please

@@ -39,7 +39,7 @@ public JAASLoggedInUser(HttpServletRequest httpServletRequest) {

@Override
public String getEmail() {
return "Email N/A (" + getUserName() + ")";
return "unknown@unknown.com";
Copy link
Contributor

Choose a reason for hiding this comment

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

it's always better to use example.com :)

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

@michalszynkiewicz
Copy link
Contributor

looks ok to me

@@ -39,7 +39,7 @@ public JAASLoggedInUser(HttpServletRequest httpServletRequest) {

@Override
public String getEmail() {
return "Email N/A (" + getUserName() + ")";
return "example@example.com";
Copy link
Contributor

Choose a reason for hiding this comment

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

Although this class is currently not used in our production deployment it can be (generally looking, it is not for test only). The previous return string is better fit than hard-coded example.com.
You probably changed it due to email validation constraint. I see two options here:
a) update the class to read the email and other missing data from the User entity, in this case it would mean, if you use JAAS you should have another way to register new users (For tests we can use demo-data).
b) remove the constraint

Copy link
Contributor Author

@jbartece jbartece Nov 14, 2016

Choose a reason for hiding this comment

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

Yes, I changed it due to the constraint and removing it is not the right way, I think.

I don't understand the A):
How can I read it from the User entity, when the entity is meant to be created based on what's obtained from the JAASAuthenticator?

Currently there is no e-mail written to the DB, so I can change it to smth like:
getUserName() + "@example.com"
or
getUserName() + "@unknown.com"
to preserve the information there and to have the correct e-mail address format.

Copy link
Contributor

Choose a reason for hiding this comment

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

User entity inserted only when the user does not exists. We have "auto-registration" for authenticated users. You can insert a user with proper email and matching username, before the tests.

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. That could be done in the test probably, but why not to change it to return a valid e-mail?

@jbartece
Copy link
Contributor Author

@matejonnet Changes done

@jbartece jbartece merged commit 370ba1f into project-ncl:master Nov 15, 2016
@jbartece jbartece deleted the review branch April 27, 2018 12:27
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.

3 participants