(h *DataSourceHandler)
| 45 | } |
| 46 | |
| 47 | func newDataSourceTestRouter(h *DataSourceHandler) *gin.Engine { |
| 48 | gin.SetMode(gin.TestMode) |
| 49 | r := gin.New() |
| 50 | r.Use(errorCapture()) |
| 51 | r.Use(func(c *gin.Context) { |
| 52 | if tenantID, ok := c.Request.Context().Value(types.TenantIDContextKey).(uint64); ok { |
| 53 | c.Set(types.TenantIDContextKey.String(), tenantID) |
| 54 | } |
| 55 | c.Next() |
| 56 | }) |
| 57 | r.GET("/datasource/:id/logs", h.GetSyncLogs) |
| 58 | return r |
| 59 | } |
| 60 | |
| 61 | func withDSCtx(req *http.Request, tenantID uint64) *http.Request { |
| 62 | ctx := req.Context() |
no test coverage detected