modelcontextprotocol / modelcontextprotocol/java-sdk
Bad assertion in testCallTool
還沒有人認領這個 Issue。
- 主要語言
- Java
- 星號
- 3.7k
- 分支
- 1.1k
- 平均合併
- 1 天 15 小時
- 30 天內合併 PR
- 9
描述
In AbstractMcpSyncClientTests, there is a test case called {testCallTool](https://github.com/modelcontextprotocol/java-sdk/blob/110a8d1940ca2edf45524332dcc84b606e52d879/mcp/src/test/java/io/modelcontextprotocol/client/AbstractMcpSyncClientTests.java#L238)
on line 247 is this assertion:
assertThat(result.isError()).isNull();
Although currently satisfied by the 'everything server' (assertion passes with javascript server) this assumes that the result.isError() (a Boolean value) is null if there is no error. Since 'isError() is set to 'false' and not null on success (by java server at least) this line should probably be:
assertThat(result.isError()).isFalse();
and that the everything server should be fixed to return isError=false rather than isError=null as it does currently.
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從 mcp/src/test/java/io/modelcontextprotocol/client/AbstractMcpSyncClientTests.java 中的 testCallTool 及其第 247 行附近的 assertion 開始。也檢查 everything server 的成功回應。完成的標準是:成功結果 assert isError() is false,且 everything server 回傳 false 而不是 null。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- java, javascript
- 領域
- testing
- Issue 類型
- 缺陷
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 活躍度
- 冷清
- 描述清晰度
- 描述清楚
- 新手友好度
- 75/100