Skip to content

test(bigquery-jdbc): fix JSpecify compatibility issues on Java 8#13818

Merged
lqiu96 merged 1 commit into
mainfrom
fix-jspecify-ci-bigquery-jdbc-mockito
Jul 17, 2026
Merged

test(bigquery-jdbc): fix JSpecify compatibility issues on Java 8#13818
lqiu96 merged 1 commit into
mainfrom
fix-jspecify-ci-bigquery-jdbc-mockito

Conversation

@lqiu96

@lqiu96 lqiu96 commented Jul 17, 2026

Copy link
Copy Markdown
Member

Update Mockito mocks in BigQuery JDBC tests to ignore annotations, preventing ArrayStoreException when running tests on Java 8. Specifically, mock Page, ApiException, and StatusCode classes with withSettings().withoutAnnotations().

Update Mockito mocks in BigQuery JDBC tests to ignore annotations,
preventing ArrayStoreException when running tests on Java 8.
Specifically, mock Page, ApiException, and StatusCode classes
with withSettings().withoutAnnotations().

TAG=agy
CONV=de3ef09d-a26c-4190-b578-4c993f807bdc
@lqiu96
lqiu96 requested review from a team as code owners July 17, 2026 21:19

@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 unit tests in BigQueryConnectionTest, BigQueryDatabaseMetaDataTest, and BigQueryStatementTest to mock classes (such as Page, ApiException, and StatusCode) using Mockito's withSettings().withoutAnnotations(). A review comment correctly points out that BigQueryDatabaseMetaDataTest.java is missing the static import for withSettings, which will cause a compilation error.

Routine otherProc = mockBigQueryRoutine(catalog, schema, "another_proc", "PROCEDURE", "p3");

Page<Routine> page = mock(Page.class);
Page<Routine> page = mock(Page.class, withSettings().withoutAnnotations());

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.

high

The static import for withSettings is missing in this file, which will cause a compilation error. Please add import static org.mockito.Mockito.withSettings; to the imports section of this file, similar to the changes made in BigQueryConnectionTest.java and BigQueryStatementTest.java.

@lqiu96
lqiu96 merged commit cd3e524 into main Jul 17, 2026
204 checks passed
@lqiu96
lqiu96 deleted the fix-jspecify-ci-bigquery-jdbc-mockito branch July 17, 2026 21:43
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