diff --git a/middleware/auth_test.go b/middleware/auth_test.go index 0c41305d..c923b1a4 100644 --- a/middleware/auth_test.go +++ b/middleware/auth_test.go @@ -532,7 +532,8 @@ func TestAuthErrorHTTPHandler(t *testing.T) { handler := http.HandlerFunc( func(w http.ResponseWriter, _ *http.Request) { // token required - _, _ = w.Write([]byte("response body\n")) + _, _ = w.Write([]byte("must not be called\n")) + t.Error("auth error must be raised before this HTTP handler is called") }, ) diff --git a/v2/middleware/auth_test.go b/v2/middleware/auth_test.go index 035ceea0..37baa629 100644 --- a/v2/middleware/auth_test.go +++ b/v2/middleware/auth_test.go @@ -530,8 +530,9 @@ func TestAuthErrorHTTPHandler(t *testing.T) { a.AuthErrorHTTPHandler = testErrorHandler1 handler := http.HandlerFunc( - func(w http.ResponseWriter, _ *http.Request) { // token required - _, _ = w.Write([]byte("response body\n")) + func(w http.ResponseWriter, _ *http.Request) { + _, _ = w.Write([]byte("must not be called\n")) + t.Error("auth error must be raised before this HTTP handler is called") }, )