@@ -214,7 +214,7 @@ void testGetClientInfo() {
214214
215215 @ Test
216216 void testLoggingNotificationWithNullMessage () {
217- assertThatThrownBy (() -> exchange .loggingNotification (null )).isInstanceOf (McpError .class )
217+ assertThatThrownBy (() -> exchange .loggingNotification (null )).isInstanceOf (IllegalStateException .class )
218218 .hasMessage ("Logging message must not be null" );
219219 }
220220
@@ -306,7 +306,7 @@ void testCreateElicitationWithNullCapabilities() {
306306 .build ();
307307
308308 assertThatThrownBy (() -> exchangeWithNullCapabilities .createElicitation (elicitRequest ))
309- .isInstanceOf (McpError .class )
309+ .isInstanceOf (IllegalStateException .class )
310310 .hasMessage ("Client must be initialized. Call the initialize method first!" );
311311
312312 // Verify that sendRequest was never called due to null capabilities
@@ -329,7 +329,7 @@ void testCreateElicitationWithoutElicitationCapabilities() {
329329 .build ();
330330
331331 assertThatThrownBy (() -> exchangeWithoutElicitation .createElicitation (elicitRequest ))
332- .isInstanceOf (McpError .class )
332+ .isInstanceOf (IllegalStateException .class )
333333 .hasMessage ("Client must be configured with elicitation capabilities" );
334334
335335 // Verify that sendRequest was never called due to missing elicitation
@@ -478,7 +478,7 @@ void testCreateMessageWithNullCapabilities() {
478478 .build ();
479479
480480 assertThatThrownBy (() -> exchangeWithNullCapabilities .createMessage (createMessageRequest ))
481- .isInstanceOf (McpError .class )
481+ .isInstanceOf (IllegalStateException .class )
482482 .hasMessage ("Client must be initialized. Call the initialize method first!" );
483483
484484 // Verify that sendRequest was never called due to null capabilities
@@ -503,7 +503,7 @@ void testCreateMessageWithoutSamplingCapabilities() {
503503 .build ();
504504
505505 assertThatThrownBy (() -> exchangeWithoutSampling .createMessage (createMessageRequest ))
506- .isInstanceOf (McpError .class )
506+ .isInstanceOf (IllegalStateException .class )
507507 .hasMessage ("Client must be configured with sampling capabilities" );
508508
509509 // Verify that sendRequest was never called due to missing sampling capabilities
0 commit comments