Skip to content

Conversation

@jeandersonbc
Copy link
Contributor

Description
This PR introduces basic test coverage for the new version of Capital

Tested scenarios

  • Tested some invalid parameters
  • Simple requests

Fixed issue:

  • N/A

@jeandersonbc jeandersonbc self-assigned this Jan 20, 2026
@jeandersonbc jeandersonbc requested review from a team as code owners January 20, 2026 14:16
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jeandersonbc, 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 significantly enhances the test suite by introducing extensive coverage for the new Capital API. It establishes dedicated test classes for different Capital API services, ensuring that key functionalities like grant account management, grant offer retrieval, and grant disbursement operations are thoroughly validated. The changes also involve a reorganization of mock data, moving some existing mocks and adding new ones to accurately simulate API responses for the newly covered endpoints.

Highlights

  • New Capital API Test Coverage: Introduced comprehensive test coverage for the new Capital API, including dedicated test classes for Grant Accounts, Grant Offers, and Grants.
  • Mock Data Refactoring: Refactored existing mock file paths in TransfersTest.java to align with a new transfers directory structure and added numerous new mock JSON response files to support the new Capital API tests.
  • API Endpoint Testing: Added tests for various Capital API endpoints, covering operations such as retrieving grant accounts, listing and fetching grant offers, requesting new grants, and managing grant disbursements (retrieval, listing, and updates).
  • Parameter Validation: Included tests to ensure proper validation of input parameters for Capital API methods, specifically checking for IllegalArgumentException when null values are provided.

🧠 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.

Comment on lines 88 to 95
@Disabled("Because we are not currently validating against required query parameters")
@Test
void testGetAllGrantsParams() {
Client client = createMockClientFromFile("mocks/capital/grants-success.json");
GrantsApi grantsApi = new GrantsApi(client);
Assertions.assertThrows(IllegalArgumentException.class, () -> grantsApi.getAllGrants(null));

}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

depends on #1665

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 introduces valuable test coverage for the new Capital API, adding several new test classes and mock data files. The tests cover success scenarios and parameter validation, which is great. I've provided a few suggestions to improve test method naming for clarity, ensure consistent use of the JUnit 5 assertion library, and fix missing exception declarations in test signatures which could cause compilation issues. Addressing these will improve the correctness and maintainability of the test suite.

@jeandersonbc jeandersonbc force-pushed the dev-coverage-capital branch 2 times, most recently from 2bd865a to 75f3d08 Compare January 20, 2026 14:26
@jeandersonbc jeandersonbc enabled auto-merge (rebase) January 20, 2026 14:29
@jeandersonbc jeandersonbc merged commit b9be3f6 into main Jan 20, 2026
5 checks passed
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.

3 participants