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

Handle assertThat in JUnit and Hamcrest. #310

Merged
merged 2 commits into from Apr 29, 2019
Merged

Conversation

navahgar
Copy link
Contributor

Copy link
Collaborator

@lazaroclapp lazaroclapp left a comment

Choose a reason for hiding this comment

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

Some minor nits, but overall I'd be happy to merge this.

nullaway/src/test/java/com/uber/nullaway/NullAwayTest.java Outdated Show resolved Hide resolved
"import javax.annotation.Nullable;",
"class Test {",
" private void foo(@Nullable Object a, @Nullable Object b) {",
" org.hamcrest.MatcherAssert.assertThat(a, org.hamcrest.Matchers.is("
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just add the static imports to make this both easier to read and more representative of idiomatic code:

import static org.hamcrest.MatcherAssert.assertThat;
...
assertThat(a, is(notNullValue));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, good point. I didn't know about static imports. Updated the tests now.

…aries and matchers to make the code more readable.
@lazaroclapp
Copy link
Collaborator

Looks great to me. Feel free to "Squash and merge" after CI passes :)

@navahgar navahgar merged commit c3979b4 into uber:master Apr 29, 2019
@navahgar navahgar deleted the junit-assert branch April 29, 2019 22:47
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.

None yet

2 participants