Skip to content

Add MockitoBean to list of exempted variable annotations#5614

Closed
elyse-yao wants to merge 1 commit intogoogle:masterfrom
elyse-yao:exempt-mockito-bean-annotation
Closed

Add MockitoBean to list of exempted variable annotations#5614
elyse-yao wants to merge 1 commit intogoogle:masterfrom
elyse-yao:exempt-mockito-bean-annotation

Conversation

@elyse-yao
Copy link
Contributor

@elyse-yao elyse-yao commented Mar 19, 2026

MockitoBean is the replacement for MockBean, which was deprecated 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 but never merged and is now out of date, so creating this new one.

Thank you!

Fixes: #4804

MockitoBean is the replacement for MockBean, which was deprecated for removal.
copybara-service bot pushed a commit that referenced this pull request Mar 20, 2026
`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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants