Skip to content

feat(demo): update cymbal-transit to Java SDK 1.0.0 and add comprehensive tests - #88

Merged
stenalpjolly merged 2 commits into
googleapis:mainfrom
stenalpjolly:stenalpjolly/stenalpjolly_cymbal-transit-1.0.0
Sep 11, 2026
Merged

feat(demo): update cymbal-transit to Java SDK 1.0.0 and add comprehensive tests#88
stenalpjolly merged 2 commits into
googleapis:mainfrom
stenalpjolly:stenalpjolly/stenalpjolly_cymbal-transit-1.0.0

Conversation

@stenalpjolly

@stenalpjolly stenalpjolly commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Updates demo-applications/cymbal-transit to use the newly released 1.0.0 version of mcp-toolbox-sdk-java, tracks the demo in release-please-config.json, adds comprehensive unit test coverage, and resolves operational gaps in UI routing and credential resolution.

Expectation & Implementation

  • Version Alignment:
    • Bumped mcp-toolbox-sdk-java version in demo-applications/cymbal-transit/pom.xml to 1.0.0 and added {x-version-update} release-please annotations.
    • Added demo-applications/cymbal-transit/pom.xml and demo-applications/cymbal-transit/README.md to release-please-config.json under extra-files for automated versioning in future releases.
    • Updated Gradle sample dependency in root README.md to 1.0.0.
  • UI Web Route:
    • Added @GetMapping("/") in CymbalTransitController to return "index", ensuring the Thymeleaf web interface (templates/index.html) is rendered when accessing the root application URL.
  • Resilient Identity & Error Handling:
    • Handled non-IdTokenProvider credentials gracefully in McpToolboxService.init() (such as local UserCredentials from standard ADC login) so local development does not crash with an unhandled exception.
    • Added defensive guards in McpToolboxService.bookTicket() against empty content payloads to prevent potential IndexOutOfBoundsException when the server returns validation errors.
    • Ensured externalized model configuration through GEMINI_MODEL_NAME.
  • Unit Test Suite:
    • Added JUnit 5 tests covering McpToolboxService, TransitAgentTools, and TransitAgentController.
    • Configured Maven Surefire in demo-applications/cymbal-transit/pom.xml to execute **/*Test.java.

Test cases

  • cloudcode.cymbal.web.McpToolboxServiceTest:
    • Verified findAllSchedules with successful response formatting, empty content, null content, and error flags.
    • Verified querySchedules parameter passing and response formatting.
    • Verified searchPolicies semantic search and query formatting.
    • Verified bookTicket parameter binding, success, and graceful failure handling without IndexOutOfBoundsException.
    • Verified init() resilient exception handling.
  • cloudcode.cymbal.web.TransitAgentToolsTest:
    • Verified @Tool method delegating to McpToolboxService for findAllSchedules, querySchedules, bookTicket, and searchPolicies.
  • cloudcode.cymbal.web.TransitAgentControllerTest:
    • Verified index() returns "index".
    • Verified handleUserChat() returns HTTP 200 OK with agent chat response.
    • Successfully tested full conversational flow: schedule lookup between New York and Boston, vector search for pet policy (Golden Retriever), and booking action.

Acceptance criteria

  • All 20 unit tests in demo-applications/cymbal-transit pass cleanly.
  • All 130 unit tests in the core SDK (mvn test -Dtest="*Test,!*E2ETest") pass cleanly.
  • All modified and newly created Java files formatted with Google Java style.
  • Web interface loads successfully at /.
  • End-to-end chat queries against live MCP Toolbox server function properly.

Breaking changes

None.

…sive tests

- Bump mcp-toolbox-sdk-java dependency in cymbal-transit to 1.0.0 with release-please annotation
- Add demo-applications/cymbal-transit files to release-please-config.json
- Map root GET / in CymbalTransitController to serve Thymeleaf index.html
- Ensure resilient ADC credential handling during local execution
- Fix potential IndexOutOfBoundsException in bookTicket when tool response content is empty
- Add unit test suite covering McpToolboxService, TransitAgentTools, and TransitAgentController
- Update demo documentation and deployment instructions
@stenalpjolly
stenalpjolly requested a review from a team as a code owner September 10, 2026 14:37
@stenalpjolly
stenalpjolly merged commit 262869c into googleapis:main Sep 11, 2026
11 checks passed
@stenalpjolly
stenalpjolly deleted the stenalpjolly/stenalpjolly_cymbal-transit-1.0.0 branch September 11, 2026 15:32
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