test(bigtable): fix remaining JSpecify CI issues on Java 8#13834
Merged
Conversation
Disable annotations in Mockito mocks for GAX classes across 17 test files in `google-cloud-bigtable` to avoid ArrayStoreException on Java 8. These tests were missed in the previous round of fixes. TAG=agy CONV=de3ef09d-a26c-4190-b578-4c993f807bdc
… mocks Remove `defaultAnswer(Answers.RETURNS_DEEP_STUBS)` from programmatic mocks of `ServerStreamingCallable` in `BigtableDataClientTests`. Mockito's deep stubs cause reflection crashes on Java 8 when dealing with JSpecify annotations. Since the tests do not rely on deep stubs for these callables, they can be safely removed. TAG=agy CONV=de3ef09d-a26c-4190-b578-4c993f807bdc
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates various unit tests across the google-cloud-bigtable module to use Mockito.mock(..., Mockito.withSettings().withoutAnnotations()) instead of standard @Mock annotations or simple Mockito.mock(...) calls. This change prevents Mockito from copying annotations to the mock objects, which helps avoid potential issues with annotation processing or reflection. There are no review comments, so no additional feedback is provided.
lqiu96
marked this pull request as ready for review
July 20, 2026 17:28
lqiu96
enabled auto-merge (squash)
July 20, 2026 17:43
mutianf
approved these changes
Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.