[UnusedVariable] Add MockitoBean in exempting variable annotations#4800
Conversation
…r UnusedVariable because spring 6.2 is migrating from MockBean to MockitoBean
|
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. |
|
I just signed the CLA, I don't know how to rebuild the PR (just I tried close / reopen the PR). |
cushon
left a comment
There was a problem hiding this comment.
@alexandrenavarro I can't find a CLA on file, did you sign it with a different email address than the one associated with your GitHub account?
|
No, I signed it with the same mail. Tell me if I need to redo something. |
cushon
left a comment
There was a problem hiding this comment.
Sorry I had checked in the wrong place, the CLA looks good.
|
@alexandrenavarro could you resurrect this pr please? |
`MockitoBean` is the replacement for `MockBean`, which was [deprecated](https://docs.spring.io/spring-boot/3.5/api/java/org/springframework/boot/test/mock/mockito/MockBean.html) but otherwise used in the same way. Since upgrading our Spring Boot version and migrating over, we've been getting `UnusedVariable` warnings since `MockitoBean` isn't exempted. There's a [previous PR that was approved here](#4800) but never merged and is now out of date, so creating this new one. Thank you! Fixes: #4804 Fixes #5614 FUTURE_COPYBARA_INTEGRATE_REVIEW=#5614 from elyse-yao:exempt-mockito-bean-annotation ac742b1 PiperOrigin-RevId: 886586716
`MockitoBean` is the replacement for `MockBean`, which was [deprecated](https://docs.spring.io/spring-boot/3.5/api/java/org/springframework/boot/test/mock/mockito/MockBean.html) but otherwise used in the same way. Since upgrading our Spring Boot version and migrating over, we've been getting `UnusedVariable` warnings since `MockitoBean` isn't exempted. There's a [previous PR that was approved here](#4800) but never merged and is now out of date, so creating this new one. Thank you! Fixes: #4804 Fixes #5614 COPYBARA_INTEGRATE_REVIEW=#5614 from elyse-yao:exempt-mockito-bean-annotation ac742b1 PiperOrigin-RevId: 886918640
[UnusedVariable] Add MockitoBean in EXEMPTING_VARIABLE_ANNOTATIONS for UnusedVariable because spring 6.2 is migrating from MockBean to MockitoBean.
See spring 6.2 documentation https://docs.spring.io/spring-boot/api/java/org/springframework/boot/test/mock/mockito/MockBean.html
Don't hesitate if you have any questions / comments.
Thank you for your amazing error prone checker, it really helps to code better and avoid to make some common bug patterns.