Fix middleware tests for public dashboards (#53557)

pull/53269/head^2
Guilherme Caulada 3 years ago committed by GitHub
parent 7924d3b3b5
commit 7554322327
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      pkg/services/publicdashboards/api/middleware_test.go

@ -68,8 +68,14 @@ func runMiddleware(request *http.Request, pubdashService *publicdashboardsServic
initCtx.Context = c
c.Req = c.Req.WithContext(ctxkey.Set(c.Req.Context(), initCtx))
})
m.Get("/api/public/ma/events/:accessToken", RequiresValidAccessToken(pubdashService))
m.Get("/api/public/ma/events/:accessToken", RequiresValidAccessToken(pubdashService), mockValidRequestHandler)
m.ServeHTTP(recorder, request)
return recorder
}
func mockValidRequestHandler(c *models.ReqContext) {
resp := make(map[string]interface{})
resp["message"] = "Valid request"
c.JSON(http.StatusOK, resp)
}

Loading…
Cancel
Save