Skip to content

Conversation

@lqiu96
Copy link
Member

@lqiu96 lqiu96 commented Jan 8, 2026

Follows the changes in #4052.

@lqiu96 lqiu96 requested a review from jinseopkim0 January 8, 2026 22:38
@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. api: bigquery Issues related to the googleapis/java-bigquery API. labels Jan 8, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @lqiu96, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request modernizes the testing infrastructure by migrating from JUnit 4 to JUnit 5, which significantly enhances test execution performance. Local testing indicates a speedup from approximately 3 minutes to just 30 seconds. This upgrade ensures better maintainability and leverages the latest features of the JUnit ecosystem.

Highlights

  • JUnit 5 Migration: The project's testing framework has been upgraded from JUnit 4 to JUnit 5, involving significant dependency updates and code refactoring across test classes.
  • Parallel Test Execution: JUnit 5's parallel test execution feature has been enabled and configured, leading to substantial improvements in test run times.
  • Dependency Updates: Key dependencies such as junit:junit and mockito-core have been replaced with their JUnit 5 and BOM counterparts (junit-jupiter-api, junit-jupiter-engine, mockito-junit-jupiter, mockito-bom).
  • Test Class Refactoring: Test classes have been refactored to align with JUnit 5's API, including changes to annotations (@RunWith to @ExtendWith, @Before to @BeforeEach), assertion styles (org.junit.Assert to org.junit.jupiter.api.Assertions), and method signatures (public void to void).

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

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

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 migrates the test suite from JUnit 4 to JUnit 5 and enables parallel test execution, which significantly speeds up the unit tests. The changes are extensive and mostly mechanical, including updating dependencies, annotations, and assertions. The migration to assertThrows from the try-catch-fail pattern is a great improvement for readability and conciseness. I've noted a couple of places where this pattern could be applied for consistency. Overall, this is a solid improvement to the test infrastructure.

Comment on lines 1005 to 1010
try {
bigquery.getTable(DATASET, "table-not-found");
Assert.fail();
Assertions.fail();
} catch (BigQueryException ex) {
Assert.assertNotNull(ex.getMessage());
Assertions.assertNotNull(ex.getMessage());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For consistency with other test migrations in this PR, consider using Assertions.assertThrows here instead of the try-catch-fail block. This would make the test more concise and idiomatic for JUnit 5.

    BigQueryException ex =
        Assertions.assertThrows(
            BigQueryException.class, () -> bigquery.getTable(DATASET, "table-not-found"));
    Assertions.assertNotNull(ex.getMessage());

Comment on lines 1494 to 1499
try {
bigquery.insertAll(request);
Assert.fail();
Assertions.fail();
} catch (BigQueryException ex) {
Assert.assertNotNull(ex.getMessage());
Assertions.assertNotNull(ex.getMessage());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Similar to other tests in this file, this try-catch-fail block can be refactored to use Assertions.assertThrows for better readability and consistency with JUnit 5 practices.

    BigQueryException ex =
        Assertions.assertThrows(BigQueryException.class, () -> bigquery.insertAll(request));
    Assertions.assertNotNull(ex.getMessage());

@lqiu96 lqiu96 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 9, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 9, 2026
@product-auto-label product-auto-label bot added size: s Pull request size is small. and removed size: xl Pull request size is extra large. labels Jan 9, 2026
@product-auto-label product-auto-label bot removed the size: s Pull request size is small. label Jan 10, 2026
@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Jan 10, 2026
@lqiu96 lqiu96 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 10, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 10, 2026
@lqiu96 lqiu96 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 10, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the googleapis/java-bigquery API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants