Skip to content

Commit ec6f6ed

Browse files
authored
Delete secrets management api test causing intermittent errors (#782)
Signed-off-by: lujunsan <[email protected]>
1 parent 67df1e4 commit ec6f6ed

File tree

1 file changed

+0
-41
lines changed

1 file changed

+0
-41
lines changed

pkg/api/v1/secrets_test.go

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -473,44 +473,3 @@ func TestConstants(t *testing.T) {
473473
t.Parallel()
474474
assert.Equal(t, "default", defaultSecretsProviderName)
475475
}
476-
477-
// Test for endpoint path validation
478-
func TestEndpointPaths(t *testing.T) {
479-
t.Parallel()
480-
router := SecretsRouter()
481-
482-
// Test that the router responds to expected paths
483-
testCases := []struct {
484-
method string
485-
path string
486-
}{
487-
{http.MethodPost, "/"},
488-
{http.MethodGet, "/default"},
489-
{http.MethodGet, "/default/keys"},
490-
{http.MethodPost, "/default/keys"},
491-
{http.MethodPut, "/default/keys/test-key"},
492-
{http.MethodDelete, "/default/keys/test-key"},
493-
}
494-
495-
for _, tc := range testCases {
496-
tc := tc
497-
t.Run(tc.method+"_"+tc.path, func(t *testing.T) {
498-
t.Parallel()
499-
var req *http.Request
500-
if tc.method == http.MethodPost || tc.method == http.MethodPut {
501-
body := `{"test": "data"}`
502-
req = httptest.NewRequest(tc.method, tc.path, strings.NewReader(body))
503-
req.Header.Set("Content-Type", "application/json")
504-
} else {
505-
req = httptest.NewRequest(tc.method, tc.path, nil)
506-
}
507-
508-
w := httptest.NewRecorder()
509-
router.ServeHTTP(w, req)
510-
511-
// We expect some response (not 404 Not Found)
512-
// The actual response code will depend on the handler logic
513-
assert.NotEqual(t, http.StatusNotFound, w.Code, "Route should be defined")
514-
})
515-
}
516-
}

0 commit comments

Comments
 (0)