@@ -473,13 +473,32 @@ class ServerTest {
473
473
assertEquals(" Server does not support resources capability." , exception.message)
474
474
}
475
475
476
+ @Test
477
+ fun `Server constructor should accept instructions provider parameter` () = runTest {
478
+ val serverInfo = Implementation (name = " test server" , version = " 1.0" )
479
+ val serverOptions = ServerOptions (capabilities = ServerCapabilities ())
480
+ val instructions = " This is a test server. Use it for testing purposes only."
481
+
482
+ val server = Server (serverInfo, serverOptions, { instructions })
483
+
484
+ // The instructions should be stored internally and used in handleInitialize
485
+ // We can't directly access the private field, but we can test it through initialization
486
+ val (clientTransport, serverTransport) = InMemoryTransport .createLinkedPair()
487
+ val client = Client (clientInfo = Implementation (name = " test client" , version = " 1.0" ))
488
+
489
+ server.connect(serverTransport)
490
+ client.connect(clientTransport)
491
+
492
+ assertEquals(instructions, client.serverInstructions)
493
+ }
494
+
476
495
@Test
477
496
fun `Server constructor should accept instructions parameter` () = runTest {
478
497
val serverInfo = Implementation (name = " test server" , version = " 1.0" )
479
498
val serverOptions = ServerOptions (capabilities = ServerCapabilities ())
480
499
val instructions = " This is a test server. Use it for testing purposes only."
481
500
482
- val server = Server (serverInfo, serverOptions) { instructions }
501
+ val server = Server (serverInfo, serverOptions, instructions)
483
502
484
503
// The instructions should be stored internally and used in handleInitialize
485
504
// We can't directly access the private field, but we can test it through initialization
0 commit comments