@@ -54,7 +54,7 @@ func TestNewHTTPConnection_WithCustomHeaders(t *testing.T) {
5454 "X-Custom-Header" : "custom-value" ,
5555 }
5656
57- conn , err := NewHTTPConnection (context .Background (), "test-server" , testServer .URL , customHeaders , nil , "" )
57+ conn , err := NewHTTPConnection (context .Background (), "test-server" , testServer .URL , customHeaders , nil , "" , 0 )
5858 require .NoError (err , "Failed to create HTTP connection with custom headers" )
5959 require .NotNil (conn , "Connection should not be nil" )
6060 defer conn .Close ()
@@ -112,7 +112,7 @@ func TestNewHTTPConnection_WithoutHeaders_FallbackSequence(t *testing.T) {
112112 defer testServer .Close ()
113113
114114 // Create connection without custom headers - streamable transport should succeed first
115- conn , err := NewHTTPConnection (context .Background (), "test-server" , testServer .URL , nil , nil , "" )
115+ conn , err := NewHTTPConnection (context .Background (), "test-server" , testServer .URL , nil , nil , "" , 0 )
116116 require .NoError (err , "Connection should succeed" )
117117 require .NotNil (conn )
118118 defer conn .Close ()
@@ -134,7 +134,7 @@ func TestNewHTTPConnection_AllTransportsFail(t *testing.T) {
134134 defer testServer .Close ()
135135
136136 // Try to create connection without custom headers (will try all transports)
137- conn , err := NewHTTPConnection (context .Background (), "test-server" , testServer .URL , nil , nil , "" )
137+ conn , err := NewHTTPConnection (context .Background (), "test-server" , testServer .URL , nil , nil , "" , 0 )
138138
139139 // Should fail after trying all transports
140140 require .Error (err , "Should fail when all transports fail" )
@@ -161,7 +161,7 @@ func TestNewHTTPConnection_ContextCancellation(t *testing.T) {
161161 cancel ()
162162
163163 // Try to create connection with cancelled context
164- conn , err := NewHTTPConnection (ctx , "test-server" , testServer .URL , map [string ]string {"Auth" : "token" }, nil , "" )
164+ conn , err := NewHTTPConnection (ctx , "test-server" , testServer .URL , map [string ]string {"Auth" : "token" }, nil , "" , 0 )
165165
166166 // Should fail due to context cancellation
167167 require .Error (err , "Should fail with cancelled context" )
@@ -198,7 +198,7 @@ func TestNewHTTPConnection_InvalidURL(t *testing.T) {
198198
199199 for _ , tt := range tests {
200200 t .Run (tt .name , func (t * testing.T ) {
201- conn , err := NewHTTPConnection (context .Background (), "test-server" , tt .url , tt .headers , nil , "" )
201+ conn , err := NewHTTPConnection (context .Background (), "test-server" , tt .url , tt .headers , nil , "" , 0 )
202202
203203 if tt .expectError {
204204 assert .Error (t , err , "Expected error for invalid URL" )
@@ -273,7 +273,7 @@ func TestTryPlainJSONTransport_InitializeFailure(t *testing.T) {
273273 // Try to create connection
274274 conn , err := NewHTTPConnection (context .Background (), "test-server" , testServer .URL , map [string ]string {
275275 "Authorization" : "test-token" ,
276- }, nil , "" )
276+ }, nil , "" , 0 )
277277
278278 // Should fail with appropriate error
279279 require .Error (t , err , "Should fail on initialization error" )
@@ -306,7 +306,7 @@ data: {"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2024-11-05","serverIn
306306 // Create connection
307307 conn , err := NewHTTPConnection (context .Background (), "test-server" , testServer .URL , map [string ]string {
308308 "Authorization" : "test-token" ,
309- }, nil , "" )
309+ }, nil , "" , 0 )
310310
311311 require .NoError (err , "Should successfully parse SSE-formatted initialize response" )
312312 require .NotNil (conn )
@@ -347,7 +347,7 @@ func TestHTTPConnection_NoSessionIDInResponse(t *testing.T) {
347347 // Create connection
348348 conn , err := NewHTTPConnection (context .Background (), "test-server" , testServer .URL , map [string ]string {
349349 "Authorization" : "test-token" ,
350- }, nil , "" )
350+ }, nil , "" , 0 )
351351
352352 require .NoError (err , "Should succeed even without session ID from server" )
353353 require .NotNil (conn )
@@ -393,7 +393,7 @@ func TestNewHTTPConnection_HeadersPropagation(t *testing.T) {
393393 "X-Custom-2" : "value2" ,
394394 }
395395
396- conn , err := NewHTTPConnection (context .Background (), "test-server" , testServer .URL , customHeaders , nil , "" )
396+ conn , err := NewHTTPConnection (context .Background (), "test-server" , testServer .URL , customHeaders , nil , "" , 0 )
397397 require .NoError (err )
398398 require .NotNil (conn )
399399 defer conn .Close ()
@@ -440,7 +440,7 @@ func TestNewHTTPConnection_EmptyHeaders(t *testing.T) {
440440 defer testServer .Close ()
441441
442442 // Create connection with empty headers - should try SDK transports first
443- conn , err := NewHTTPConnection (context .Background (), "test-server" , testServer .URL , map [string ]string {}, nil , "" )
443+ conn , err := NewHTTPConnection (context .Background (), "test-server" , testServer .URL , map [string ]string {}, nil , "" , 0 )
444444 require .NoError (err , "Should succeed with empty headers" )
445445 require .NotNil (conn )
446446 defer conn .Close ()
@@ -473,7 +473,7 @@ func TestNewHTTPConnection_NilHeaders(t *testing.T) {
473473 defer testServer .Close ()
474474
475475 // Create connection with nil headers (should try SDK transports first)
476- conn , err := NewHTTPConnection (context .Background (), "test-server" , testServer .URL , nil , nil , "" )
476+ conn , err := NewHTTPConnection (context .Background (), "test-server" , testServer .URL , nil , nil , "" , 0 )
477477 require .NoError (err , "Should succeed with nil headers" )
478478 require .NotNil (conn )
479479 defer conn .Close ()
@@ -509,7 +509,7 @@ func TestNewHTTPConnection_HTTPClientTimeout(t *testing.T) {
509509 // Create connection
510510 conn , err := NewHTTPConnection (context .Background (), "test-server" , testServer .URL , map [string ]string {
511511 "Authorization" : "test" ,
512- }, nil , "" )
512+ }, nil , "" , 0 )
513513
514514 // Should succeed (delay is within timeout)
515515 require .NoError (err , "Should succeed within timeout" )
@@ -530,7 +530,7 @@ func TestNewHTTPConnection_ConnectionRefused(t *testing.T) {
530530 // Try to create connection
531531 conn , err := NewHTTPConnection (context .Background (), "test-server" , unreachableURL , map [string ]string {
532532 "Authorization" : "test" ,
533- }, nil , "" )
533+ }, nil , "" , 0 )
534534
535535 // Should fail with connection error
536536 require .Error (err , "Should fail with connection refused" )
@@ -563,7 +563,7 @@ func TestNewHTTPConnection_GettersAfterCreation(t *testing.T) {
563563 "X-Custom" : "custom-value" ,
564564 }
565565
566- conn , err := NewHTTPConnection (context .Background (), "test-server" , testServer .URL , customHeaders , nil , "" )
566+ conn , err := NewHTTPConnection (context .Background (), "test-server" , testServer .URL , customHeaders , nil , "" , 0 )
567567 require .NoError (err )
568568 require .NotNil (conn )
569569 defer conn .Close ()
0 commit comments