diff --git a/pkg/zrouter/zmiddlewares/zcache_test.go b/pkg/zrouter/zmiddlewares/zcache_test.go index be0cc44..8ffb25a 100644 --- a/pkg/zrouter/zmiddlewares/zcache_test.go +++ b/pkg/zrouter/zmiddlewares/zcache_test.go @@ -27,7 +27,9 @@ func TestCacheMiddleware(t *testing.T) { "/cached-path": 5 * time.Minute, }} - r.Use(CacheMiddleware(metrics.NewTaskMetrics("", "", "appName"), mockCache, cacheConfig)) + ms := metrics.NewTaskMetrics("", "", "appName") + RegisterRequestMetrics(ms) + r.Use(CacheMiddleware(ms, mockCache, cacheConfig)) // Simulate a response that should be cached r.Get("/cached-path", func(w http.ResponseWriter, r *http.Request) {