@@ -98,59 +98,59 @@ func TestBasicRouterFunctionality(t *testing.T) {
9898
9999 {
100100 // Register a method on the first client
101- result , reqErr , err := cl1 .SendRequest (context .Background (), "$/register" , [] any { "ping" } )
101+ result , reqErr , err := cl1 .SendRequest (context .Background (), "$/register" , "ping" )
102102 require .Equal (t , true , result )
103103 require .Nil (t , reqErr )
104104 require .NoError (t , err )
105105 }
106106 {
107107 // Try to re-register the same method
108- result , reqErr , err := cl1 .SendRequest (context .Background (), "$/register" , [] any { "ping" } )
108+ result , reqErr , err := cl1 .SendRequest (context .Background (), "$/register" , "ping" )
109109 require .Nil (t , result )
110110 require .Equal (t , []any {int8 (msgpackrouter .ErrCodeRouteAlreadyExists ), "route already exists: ping" }, reqErr )
111111 require .NoError (t , err )
112112 }
113113 {
114114 // Register a method on the second client
115- result , reqErr , err := cl2 .SendRequest (context .Background (), "$/register" , [] any { "temperature" } )
115+ result , reqErr , err := cl2 .SendRequest (context .Background (), "$/register" , "temperature" )
116116 require .Equal (t , true , result )
117117 require .Nil (t , reqErr )
118118 require .NoError (t , err )
119119 }
120120 {
121121 // Call from client2 the registered method on client1
122- result , reqErr , err := cl2 .SendRequest (context .Background (), "ping" , [] any { "1" , 2 , true } )
122+ result , reqErr , err := cl2 .SendRequest (context .Background (), "ping" , "1" , 2 , true )
123123 require .Equal (t , []any {"1" , int8 (2 ), true }, result )
124124 require .Nil (t , reqErr )
125125 require .NoError (t , err )
126126 }
127127 {
128128 // Self-call from client1
129- result , reqErr , err := cl1 .SendRequest (context .Background (), "ping" , [] any { "c" , 12 , false } )
129+ result , reqErr , err := cl1 .SendRequest (context .Background (), "ping" , "c" , 12 , false )
130130 require .Equal (t , []any {"c" , int8 (12 ), false }, result )
131131 require .Nil (t , reqErr )
132132 require .NoError (t , err )
133133 }
134134 {
135135 // Call from client2 an un-registered method
136- result , reqErr , err := cl2 .SendRequest (context .Background (), "not-existent-method" , [] any { "1" , 2 , true } )
136+ result , reqErr , err := cl2 .SendRequest (context .Background (), "not-existent-method" , "1" , 2 , true )
137137 require .Nil (t , result )
138138 require .Equal (t , []any {int8 (msgpackrouter .ErrCodeMethodNotAvailable ), "method not-existent-method not available" }, reqErr )
139139 require .NoError (t , err )
140140 }
141141 {
142142 // Send notification to client1
143- err := cl2 .SendNotification ("ping" , [] any { "a" , int16 (4 ), false } )
143+ err := cl2 .SendNotification ("ping" , "a" , int16 (4 ), false )
144144 require .NoError (t , err )
145145 }
146146 {
147147 // Send notification to unregistered method
148- err := cl2 .SendNotification ("notexistent" , [] any { "a" , int16 (4 ), false } )
148+ err := cl2 .SendNotification ("notexistent" , "a" , int16 (4 ), false )
149149 require .NoError (t , err )
150150 }
151151 {
152152 // Self-send notification
153- err := cl1 .SendNotification ("ping" , [] any { "b" , int16 (14 ), true , true } )
153+ err := cl1 .SendNotification ("ping" , "b" , int16 (14 ), true , true )
154154 require .NoError (t , err )
155155 }
156156 time .Sleep (100 * time .Millisecond ) // Give some time for the notifications to be processed
@@ -190,7 +190,7 @@ func TestMessageForwarderCongestionControl(t *testing.T) {
190190
191191 {
192192 // Register a method on the first client
193- result , reqErr , err := cl1 .SendRequest (context .Background (), "$/register" , [] any { "test" } )
193+ result , reqErr , err := cl1 .SendRequest (context .Background (), "$/register" , "test" )
194194 require .Equal (t , true , result )
195195 require .Nil (t , reqErr )
196196 require .NoError (t , err )
@@ -201,7 +201,7 @@ func TestMessageForwarderCongestionControl(t *testing.T) {
201201 var wg sync.WaitGroup
202202 for range batchSize {
203203 wg .Go (func () {
204- _ , _ , err := cl2 .SendRequest (t .Context (), "test" , [] any {} )
204+ _ , _ , err := cl2 .SendRequest (t .Context (), "test" )
205205 require .NoError (t , err )
206206 })
207207 }
0 commit comments