Skip to content

test(bigquery-jdbc): use withoutAnnotations() for Mockito mocks on JDK 8 - #15452

Merged
lqiu96 merged 1 commit into
mainfrom
fix/bq-jdbc-jdk8-mockito
Dec 4, 2026
Merged

lqiu96 merged 1 commit into
mainfrom
fix/bq-jdbc-jdk8-mockito

Conversation

@lqiu96

@lqiu96 lqiu96 commented Dec 4, 2026

Copy link
Copy Markdown
Member

Pass withSettings().withoutAnnotations() to five Mockito mocks of ServerStreamingCallable and Page in BigQueryStatementTest.

On Java 8, Mockito's default annotation copying fails with ArrayStoreException: sun.reflect.annotation.EnumConstantNotPresentExceptionProxy when mocking classes annotated with JSpecify @NullMarked (which targets Java 9's ElementType.MODULE). Other tests in java-bigquery-jdbc (BigQueryStatementTest, BigQueryConnectionTest, and BigQueryDatabaseMetaDataTest) already pass withSettings().withoutAnnotations() for the same reason.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates several Mockito mock instantiations in BigQueryStatementTest.java to use withSettings().withoutAnnotations() for ServerStreamingCallable and Page classes. I have no feedback to provide.

@lqiu96
lqiu96 requested a review from logachev December 4, 2026 20:29
@lqiu96
lqiu96 marked this pull request as ready for review December 4, 2026 20:29
@lqiu96
lqiu96 requested review from a team as code owners December 4, 2026 20:29
@lqiu96
lqiu96 merged commit e938305 into main Dec 4, 2026
194 checks passed
@lqiu96
lqiu96 deleted the fix/bq-jdbc-jdk8-mockito branch December 4, 2026 21:16
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.

2 participants