Skip to content

Commit 3f756aa

Browse files
skarpovdevdevcrocod
authored andcommitted
fixup! Introduce Kotlin integration tests
1 parent 4363945 commit 3f756aa

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

kotlin-sdk-test/src/jvmTest/kotlin/io/modelcontextprotocol/kotlin/sdk/integration/typescript/KotlinClientTypeScriptServerEdgeCasesTest.kt

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -208,20 +208,15 @@ class KotlinClientTypeScriptServerEdgeCasesTest : TypeScriptTestBase() {
208208
"name" to JsonObject(mapOf("nested" to JsonPrimitive("value"))),
209209
)
210210

211-
try {
212-
val result = client.callTool("greet", invalidArguments)
213-
assertNotNull(result, "Tool call result should not be null")
214-
215-
val callResult = result as CallToolResult
216-
val textContent = callResult.content.firstOrNull { it is TextContent } 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)
224213
}
214+
215+
assertTrue(
216+
exception.message?.contains("invalid") == true ||
217+
exception.message?.contains("error") == true,
218+
"Exception should indicate invalid arguments: ${exception.message}",
219+
)
225220
}
226221
}
227222
}

0 commit comments

Comments
 (0)