-
Notifications
You must be signed in to change notification settings - Fork 774
fix: support implicit @MethodSource to UnusedMethod
#5210
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
base: master
Are you sure you want to change the base?
fix: support implicit @MethodSource to UnusedMethod
#5210
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
e74fbe1 to
f67790b
Compare
f67790b to
457c855
Compare
|
Hi @cushon, @graememorgan; could you please run the CI on this PR? |
|
nice plz include There will be new stuff to come for sure. right @marcphilipp? thank you.
|
|
@Pankraz76 |
| // normalizing unset value to the empty value | ||
| .map(a -> getAnnotationValue(a, "value") | ||
| .map(y -> asStrings(y).map(state::getName).map(Name::toString).collect(toImmutableSet())) | ||
| .orElse(ImmutableSet.of()) |
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.
nit: could this be .orElse(ImmutableSet.of(sym.name.toString())) instead of separately checking of names is empty below?
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.
It couldn't, since we also want to handle the case @MethodSource({})
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.
Thanks, looks good overall!
Currently,
UnusedMethodcheck does not recognize implicitly referenced JUnit@MethodSource, e.g. the ones which are derived from test method name when none are specified explicitly. This PR fixes this issue.Fixes #5289