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

Added null checks and tests to constructors #6915

Merged

Conversation

clementkng
Copy link
Contributor

RequestKey, JaasGrantedAuthority, and SwitchUserGrantedAuthority
assume certain final members are non-null.

Issue: gh-6892

@pivotal-issuemaster
Copy link

@clementkng Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-issuemaster
Copy link

@clementkng Thank you for signing the Contributor License Agreement!

Copy link
Contributor

@jzheaux jzheaux left a comment

Choose a reason for hiding this comment

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

@clementkng thanks for the PR! I've left one piece of feedback inline.

@Test
public void authorityWithNullRoleFailsAssertion() {
try {
JaasGrantedAuthority authority =
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for adding these tests. For consistency with other tests in the codebase, would you please change the way you are handling these exceptions to use AssertJ instead? Something similar to:

assertThatThrownBy(() -> ...)
    .isInstanceOf(IllegalArgumentException.class)

RequestKey, JaasGrantedAuthority, and SwitchUserGrantedAuthority
assume certain final members are non-null.

Issue: spring-projectsgh-6892
@clementkng clementkng force-pushed the gh-6892-constructor-null-checks branch from 947de70 to a9fbb70 Compare May 29, 2019 21:02
@clementkng
Copy link
Contributor Author

@jzheaux Thanks for the review! I made the changes to the tests.

@jzheaux jzheaux merged commit e66369f into spring-projects:master May 29, 2019
@jzheaux
Copy link
Contributor

jzheaux commented May 29, 2019

Thanks, @clementkng, this is now merged into master.

@clementkng clementkng deleted the gh-6892-constructor-null-checks branch May 29, 2019 22:53
@clementkng clementkng restored the gh-6892-constructor-null-checks branch May 30, 2019 06:22
@clementkng clementkng deleted the gh-6892-constructor-null-checks branch May 30, 2019 11:04
@rwinch rwinch added in: core An issue in spring-security-core status: duplicate A duplicate of another issue type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 13, 2019
@rwinch rwinch added this to the 5.2.0.M3 milestone Jun 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core An issue in spring-security-core status: duplicate A duplicate of another issue type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants