modelcontextprotocol / modelcontextprotocol/java-sdk

Bad assertion in testCallTool

オープン 初心者向け
#464 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

needs confirmation P3 tests
主要言語
Java
スター
3.7k
フォーク
1.1k
平均マージ
1日 15時間
マージ済み PR(30日)
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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

mcp/src/test/java/io/modelcontextprotocol/client/AbstractMcpSyncClientTests.java の testCallTool と、247 行目付近にあるそのアサーションから始めてください。everything server の成功レスポンスも確認してください。成功した結果で isError() is false が assert され、everything server が null ではなく false を返せば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java, javascript
領域
testing
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
静か
明瞭さ
明確に書かれている
初心者へのやさしさ
75/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。