modelcontextprotocol / modelcontextprotocol/java-sdk

Bad assertion in testCallTool

Offen Anfängerfreundlich
#464 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

needs confirmation P3 tests
Vorherrschende Sprache
Java
Sterne
3.7k
Forks
1.1k
Ø Merge
1 T. 15 Std.
Gemergte PRs (30 T.)
9

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne in mcp/src/test/java/io/modelcontextprotocol/client/AbstractMcpSyncClientTests.java bei testCallTool und der zugehörigen Assertion um Zeile 247. Prüfe auch die Erfolgsantwort des everything server. Erledigt ist die Aufgabe, wenn erfolgreiche Ergebnisse assert isError() is false und der everything server false statt null zurückgibt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java, javascript
Bereich
testing
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Ruhig
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
75/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.