You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: kotlin-sdk-test/src/jvmTest/kotlin/io/modelcontextprotocol/kotlin/sdk/integration/typescript/KotlinClientTypeScriptServerEdgeCasesTest.kt
+8-13Lines changed: 8 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -208,20 +208,15 @@ class KotlinClientTypeScriptServerEdgeCasesTest : TypeScriptTestBase() {
208
208
"name" to JsonObject(mapOf("nested" to JsonPrimitive("value"))),
209
209
)
210
210
211
-
try {
212
-
val result = client.callTool("greet", invalidArguments)
213
-
assertNotNull(result, "Tool call result should not be null")
214
-
215
-
val callResult = result asCallToolResult
216
-
val textContent = callResult.content.firstOrNull { it isTextContent } as?TextContent
217
-
assertNotNull(textContent, "Text content should be present in the result")
218
-
} catch (e:Exception) {
219
-
assertTrue(
220
-
e.message?.contains("invalid") ==true||
221
-
e.message?.contains("error") ==true,
222
-
"Exception should indicate invalid arguments: ${e.message}",
223
-
)
211
+
val exception = assertThrows<IllegalStateException> {
212
+
client.callTool("greet", invalidArguments)
224
213
}
214
+
215
+
assertTrue(
216
+
exception.message?.contains("invalid") ==true||
217
+
exception.message?.contains("error") ==true,
218
+
"Exception should indicate invalid arguments: ${exception.message}",
0 commit comments