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 行附近的断言开始。也检查 everything server 的成功响应。完成的标准是:成功结果 assert isError() is false,并且 everything server 返回 false 而不是 null。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java, javascript
- 领域
- testing
- Issue 类型
- 缺陷
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 冷清
- 描述清晰度
- 描述清楚
- 新手友好度
- 75/100