@@ -522,4 +522,44 @@ void testRootsChangeHandlers() {
522522 .doesNotThrowAnyException ();
523523 }
524524
525+ // ---------------------------------------
526+ // Ignorable JSON-RPC Methods Tests
527+ // ---------------------------------------
528+
529+ @ Test
530+ void testIgnorableJsonRpcMethodsBuilderList () {
531+ List <String > customIgnorables = List .of ("custom/method1" , "custom/method2" );
532+
533+ var server = McpServer .async (createMcpTransportProvider ())
534+ .serverInfo ("test-server" , "1.0.0" )
535+ .ignorableJsonRpcMethods (customIgnorables )
536+ .build ();
537+
538+ assertThat (server ).isNotNull ();
539+ assertThatCode (() -> server .closeGracefully ().block (Duration .ofSeconds (10 ))).doesNotThrowAnyException ();
540+ }
541+
542+ @ Test
543+ void testIgnorableJsonRpcMethodsBuilderVarargs () {
544+ var server = McpServer .async (createMcpTransportProvider ())
545+ .serverInfo ("test-server" , "1.0.0" )
546+ .ignorableJsonRpcMethods ("custom/method1" , "custom/method2" , "custom/method3" )
547+ .build ();
548+
549+ assertThat (server ).isNotNull ();
550+ assertThatCode (() -> server .closeGracefully ().block (Duration .ofSeconds (10 ))).doesNotThrowAnyException ();
551+ }
552+
553+ @ Test
554+ void testIgnorableMethodsBuilderNullValidation () {
555+ assertThatThrownBy (
556+ () -> McpServer .async (createMcpTransportProvider ()).ignorableJsonRpcMethods ((List <String >) null ))
557+ .isInstanceOf (IllegalArgumentException .class )
558+ .hasMessage ("Ignorable JSON-RPC methods must not be null" );
559+
560+ assertThatThrownBy (() -> McpServer .async (createMcpTransportProvider ()).ignorableJsonRpcMethods ((String []) null ))
561+ .isInstanceOf (IllegalArgumentException .class )
562+ .hasMessage ("Ignorable JSON-RPC methods must not be null" );
563+ }
564+
525565}
0 commit comments