@@ -1882,31 +1882,6 @@ async fn test_url_elicitation_json_rpc_protocol() {
18821882 }
18831883}
18841884
1885- /// Test ElicitationCompleteNotification serialization/deserialization
1886- #[ tokio:: test]
1887- async fn test_elicitation_completion_notification ( ) {
1888- let notification_params = ElicitationResponseNotificationParam :: new ( "elicit-789" ) ;
1889-
1890- // Test serialization
1891- let json = serde_json:: to_value ( & notification_params) . unwrap ( ) ;
1892- let expected = json ! ( {
1893- "elicitationId" : "elicit-789"
1894- } ) ;
1895- assert_eq ! ( json, expected) ;
1896-
1897- // Test deserialization
1898- let deserialized: ElicitationResponseNotificationParam =
1899- serde_json:: from_value ( expected) . unwrap ( ) ;
1900- assert_eq ! ( deserialized. elicitation_id, "elicit-789" ) ;
1901-
1902- // Test complete notification structure
1903- let notification = ElicitationCompleteNotification :: new ( notification_params) ;
1904-
1905- let json = serde_json:: to_value ( & notification) . unwrap ( ) ;
1906- assert_eq ! ( json[ "method" ] , "notifications/elicitation/complete" ) ;
1907- assert_eq ! ( json[ "params" ] [ "elicitationId" ] , "elicit-789" ) ;
1908- }
1909-
19101885/// Test UrlElicitationCapability structure and serialization
19111886#[ tokio:: test]
19121887async fn test_url_elicitation_capability ( ) {
@@ -2020,40 +1995,6 @@ async fn test_elicitation_both_modes() {
20201995 assert ! ( url_json. get( "requestedSchema" ) . is_none( ) ) ;
20211996}
20221997
2023- /// Test URL_ELICITATION_REQUIRED error code
2024- #[ tokio:: test]
2025- #[ allow( deprecated) ]
2026- async fn test_url_elicitation_required_error_code ( ) {
2027- // Test the error code constant
2028- assert_eq ! ( ErrorCode :: URL_ELICITATION_REQUIRED . 0 , -32042 ) ;
2029-
2030- // Test creating error data with URL_ELICITATION_REQUIRED
2031- let error_data = ErrorData :: url_elicitation_required (
2032- "URL elicitation is required for this operation" ,
2033- Some ( json ! ( {
2034- "url" : "https://example.com/complete" ,
2035- "elicitationId" : "elicit-999"
2036- } ) ) ,
2037- ) ;
2038-
2039- assert_eq ! ( error_data. code, ErrorCode :: URL_ELICITATION_REQUIRED ) ;
2040- assert_eq ! (
2041- error_data. message,
2042- "URL elicitation is required for this operation"
2043- ) ;
2044- assert ! ( error_data. data. is_some( ) ) ;
2045-
2046- // Test serialization
2047- let json = serde_json:: to_value ( & error_data) . unwrap ( ) ;
2048- assert_eq ! ( json[ "code" ] , -32042 ) ;
2049- assert_eq ! (
2050- json[ "message" ] ,
2051- "URL elicitation is required for this operation"
2052- ) ;
2053- assert_eq ! ( json[ "data" ] [ "url" ] , "https://example.com/complete" ) ;
2054- assert_eq ! ( json[ "data" ] [ "elicitationId" ] , "elicit-999" ) ;
2055- }
2056-
20571998/// Test ClientCapabilities with different elicitation mode combinations
20581999#[ tokio:: test]
20592000async fn test_client_capabilities_elicitation_modes ( ) {
@@ -2103,32 +2044,6 @@ async fn test_client_capabilities_elicitation_modes() {
21032044 assert ! ( json[ "elicitation" ] [ "url" ] . is_object( ) ) ;
21042045}
21052046
2106- /// Test ElicitationCompleteNotification in ServerNotification enum
2107- #[ tokio:: test]
2108- async fn test_elicitation_completion_in_server_notification ( ) {
2109- let notification_param = ElicitationResponseNotificationParam :: new ( "notify-123" ) ;
2110-
2111- let completion_notification = ElicitationCompleteNotification :: new ( notification_param. clone ( ) ) ;
2112-
2113- // Test that it's part of ServerNotification
2114- let server_notification =
2115- ServerNotification :: ElicitationCompleteNotification ( completion_notification) ;
2116-
2117- // Test serialization
2118- let json = serde_json:: to_value ( & server_notification) . unwrap ( ) ;
2119- assert_eq ! ( json[ "method" ] , "notifications/elicitation/complete" ) ;
2120- assert_eq ! ( json[ "params" ] [ "elicitationId" ] , "notify-123" ) ;
2121-
2122- // Test deserialization
2123- let deserialized: ServerNotification = serde_json:: from_value ( json) . unwrap ( ) ;
2124- match deserialized {
2125- ServerNotification :: ElicitationCompleteNotification ( notif) => {
2126- assert_eq ! ( notif. params. elicitation_id, "notify-123" ) ;
2127- }
2128- _ => panic ! ( "Expected ElicitationCompleteNotification variant" ) ,
2129- }
2130- }
2131-
21322047/// Test ElicitationAction with URL elicitation workflow
21332048#[ tokio:: test]
21342049async fn test_url_elicitation_action_workflow ( ) {
@@ -2162,10 +2077,4 @@ async fn test_elicitation_method_constants() {
21622077 ElicitationResponseNotificationMethod :: VALUE ,
21632078 "notifications/elicitation/response"
21642079 ) ;
2165-
2166- // Test new completion notification method
2167- assert_eq ! (
2168- ElicitationCompletionNotificationMethod :: VALUE ,
2169- "notifications/elicitation/complete"
2170- ) ;
21712080}
0 commit comments