@@ -38,7 +38,7 @@ func (h *TestSamplingHandler) SetResponse(question, response string) {
3838
3939func (h * TestSamplingHandler ) CreateMessage (ctx context.Context , request mcp.CreateMessageRequest ) (* mcp.CreateMessageResult , error ) {
4040 log .Printf ("[TestSamplingHandler] *** CLIENT RECEIVED SAMPLING REQUEST *** with %d messages" , len (request .Messages ))
41-
41+
4242 if len (request .Messages ) == 0 {
4343 log .Printf ("[TestSamplingHandler] ERROR: no messages provided" )
4444 return nil , fmt .Errorf ("no messages provided" )
@@ -174,15 +174,15 @@ func TestSamplingHTTPE2E(t *testing.T) {
174174 }
175175
176176 log .Printf ("[E2E Test] SERVER calling RequestSampling..." )
177-
177+
178178 // Check what session we have
179179 session := server .ClientSessionFromContext (ctx )
180180 if session != nil {
181181 log .Printf ("[E2E Test] SERVER session ID: %s" , session .SessionID ())
182182 } else {
183183 log .Printf ("[E2E Test] SERVER ERROR: No session in context" )
184184 }
185-
185+
186186 // This creates the sampling request to the client
187187 result , err := serverFromCtx .RequestSampling (samplingCtx , samplingRequest )
188188 if err != nil {
@@ -221,7 +221,7 @@ func TestSamplingHTTPE2E(t *testing.T) {
221221
222222 // Start HTTP server
223223 httpServer := server .NewStreamableHTTPServer (mcpServer )
224-
224+
225225 serverDone := make (chan struct {})
226226 go func () {
227227 defer close (serverDone )
@@ -240,7 +240,7 @@ func TestSamplingHTTPE2E(t *testing.T) {
240240 t .Fatalf ("Failed to create HTTP transport: %v" , err )
241241 }
242242 defer httpTransport .Close ()
243-
243+
244244 log .Printf ("[E2E Test] HTTP transport created, will connect to: %s" , serverURL + "/mcp" )
245245
246246 // Create HTTP client with sampling handler - this is the actual client connecting over HTTP
@@ -288,7 +288,7 @@ func TestSamplingHTTPE2E(t *testing.T) {
288288 // Test Case 1: HTTP client calls "question" tool - complete e2e flow
289289 t .Run ("HTTPClientCallsQuestionTool" , func (t * testing.T ) {
290290 log .Printf ("[E2E Test] HTTP client calling 'question' tool" )
291-
291+
292292 // Client calls "question" tool over HTTP
293293 result , err := httpClient .CallTool (ctx , mcp.CallToolRequest {
294294 Params : mcp.CallToolParams {
@@ -379,10 +379,10 @@ func TestSamplingHTTPE2E(t *testing.T) {
379379
380380 // Cleanup
381381 httpClient .Close ()
382-
382+
383383 shutdownCtx , cancel := context .WithTimeout (context .Background (), 5 * time .Second )
384384 defer cancel ()
385-
385+
386386 if err := httpServer .Shutdown (shutdownCtx ); err != nil {
387387 t .Logf ("Server shutdown error: %v" , err )
388388 }
@@ -440,7 +440,7 @@ func TestSamplingHTTPBasic(t *testing.T) {
440440
441441 // Start HTTP server
442442 httpServer := server .NewStreamableHTTPServer (mcpServer )
443-
443+
444444 serverDone := make (chan struct {})
445445 go func () {
446446 defer close (serverDone )
@@ -526,10 +526,10 @@ func TestSamplingHTTPBasic(t *testing.T) {
526526
527527 // Cleanup
528528 mcpClient .Close ()
529-
529+
530530 shutdownCtx , cancel := context .WithTimeout (context .Background (), 5 * time .Second )
531531 defer cancel ()
532-
532+
533533 if err := httpServer .Shutdown (shutdownCtx ); err != nil {
534534 t .Logf ("Server shutdown error: %v" , err )
535535 }
@@ -543,7 +543,7 @@ func TestMain(m *testing.M) {
543543 // Enable debug logging for better visibility during tests
544544 log .SetOutput (os .Stdout )
545545 log .SetFlags (log .LstdFlags | log .Lshortfile )
546-
546+
547547 code := m .Run ()
548548 os .Exit (code )
549- }
549+ }
0 commit comments