Skip to content

test: Add comprehensive JUnit 5 unit tests for HttpMcpToolboxClient#57

Open
stenalpjolly wants to merge 1 commit intogoogleapis:mainfrom
stenalpjolly:stenalpjolly_httptoolboxclient_tests
Open

test: Add comprehensive JUnit 5 unit tests for HttpMcpToolboxClient#57
stenalpjolly wants to merge 1 commit intogoogleapis:mainfrom
stenalpjolly:stenalpjolly_httptoolboxclient_tests

Conversation

@stenalpjolly
Copy link
Copy Markdown

Summary

  • Added HttpMcpToolboxClientTest.java to cover core functionality of HttpMcpToolboxClient.
  • Uses Mockito to mock HttpClient and injects it via reflection to avoid modifying the constructor.
  • Covers ensureInitialized() (called exactly once), listTools(), and invokeTool().
  • Parses Mock JSON responses with ObjectMapper.
  • Compatible with Java 25 tests using -Dnet.bytebuddy.experimental=true.

This improves test coverage for the default HTTP client implementation.

@stenalpjolly stenalpjolly requested a review from a team as a code owner April 6, 2026 17:26
@stenalpjolly
Copy link
Copy Markdown
Author

/gcbrun

3 similar comments
@stenalpjolly
Copy link
Copy Markdown
Author

/gcbrun

@stenalpjolly
Copy link
Copy Markdown
Author

/gcbrun

@stenalpjolly
Copy link
Copy Markdown
Author

/gcbrun

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.

1 participant