Skip to content

Commit 8e493e8

Browse files
authored
Remove redundant buildMCPHTTPServer endpoint tests
1 parent 73e8058 commit 8e493e8

1 file changed

Lines changed: 0 additions & 39 deletions

File tree

internal/server/http_server_test.go

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -97,45 +97,6 @@ func TestBuildMCPHTTPServer_RouteBuilderReceivesSessionTimeout(t *testing.T) {
9797
assert.Equal(t, 15*time.Minute, capturedTimeout)
9898
}
9999

100-
// TestBuildMCPHTTPServer_HealthEndpointResponds verifies that the /health endpoint
101-
// registered by buildMCPHTTPServer returns a successful response.
102-
func TestBuildMCPHTTPServer_HealthEndpointResponds(t *testing.T) {
103-
us, err := NewUnified(context.Background(), &config.Config{})
104-
require.NoError(t, err)
105-
t.Cleanup(func() { us.Close() })
106-
107-
server := buildMCPHTTPServer("127.0.0.1:0", us, "", "", func(_ *http.ServeMux, _ time.Duration) {})
108-
109-
req := httptest.NewRequest(http.MethodGet, "/health", nil)
110-
rr := httptest.NewRecorder()
111-
server.Handler.ServeHTTP(rr, req)
112-
113-
assert.Equal(t, http.StatusOK, rr.Code)
114-
}
115-
116-
// TestBuildMCPHTTPServer_OAuthDiscoveryEndpointResponds verifies that the OAuth
117-
// discovery endpoint registered by buildMCPHTTPServer returns 404.
118-
func TestBuildMCPHTTPServer_OAuthDiscoveryEndpointResponds(t *testing.T) {
119-
us, err := NewUnified(context.Background(), &config.Config{})
120-
require.NoError(t, err)
121-
t.Cleanup(func() { us.Close() })
122-
123-
server := buildMCPHTTPServer("127.0.0.1:0", us, "", "", func(_ *http.ServeMux, _ time.Duration) {})
124-
125-
for _, path := range []string{
126-
"/.well-known/oauth-authorization-server",
127-
"/mcp/.well-known/oauth-authorization-server",
128-
} {
129-
t.Run(path, func(t *testing.T) {
130-
req := httptest.NewRequest(http.MethodGet, path, nil)
131-
rr := httptest.NewRecorder()
132-
server.Handler.ServeHTTP(rr, req)
133-
134-
assert.Equal(t, http.StatusNotFound, rr.Code)
135-
})
136-
}
137-
}
138-
139100
// TestBuildMCPHTTPServer_CustomRouteFromBuilder verifies that routes registered
140101
// inside the routeBuilder callback are accessible via the returned server's handler.
141102
func TestBuildMCPHTTPServer_CustomRouteFromBuilder(t *testing.T) {

0 commit comments

Comments
 (0)