diff --git a/internal/integration/caching_integration_test.go b/internal/integration/caching_integration_test.go index f6e5765..2d57cb5 100644 --- a/internal/integration/caching_integration_test.go +++ b/internal/integration/caching_integration_test.go @@ -36,21 +36,10 @@ func setupCachingTestContext(t *testing.T) *testContext { staticDir := t.TempDir() - router := server.NewRouter(server.RouterConfig{ - AuthHandler: authHandler, - PostHandler: postHandler, - VoteHandler: voteHandler, - UserHandler: userHandler, - APIHandler: apiHandler, - AuthService: authService, - PageHandler: nil, - StaticDir: staticDir, - Debug: false, - DisableCache: false, - DisableCompression: false, - DBMonitor: middleware.NewInMemoryDBMonitor(), - RateLimitConfig: testutils.AppTestConfig.RateLimit, - }) + router := server.NewRouter(newRouterConfigBuilder(). + withIndividualHandlers(authHandler, postHandler, voteHandler, userHandler, apiHandler, authService). + withStaticDir(staticDir). + build()) return &testContext{ Router: router, diff --git a/internal/integration/ratelimit_integration_test.go b/internal/integration/ratelimit_integration_test.go index faf09e2..06b94f5 100644 --- a/internal/integration/ratelimit_integration_test.go +++ b/internal/integration/ratelimit_integration_test.go @@ -35,21 +35,11 @@ func setupRateLimitRouter(t *testing.T, rateLimitConfig config.RateLimitConfig) staticDir := t.TempDir() - router := server.NewRouter(server.RouterConfig{ - AuthHandler: authHandler, - PostHandler: postHandler, - VoteHandler: voteHandler, - UserHandler: userHandler, - APIHandler: apiHandler, - AuthService: authService, - PageHandler: nil, - StaticDir: staticDir, - Debug: false, - DisableCache: false, - DisableCompression: false, - DBMonitor: middleware.NewInMemoryDBMonitor(), - RateLimitConfig: rateLimitConfig, - }) + router := server.NewRouter(newRouterConfigBuilder(). + withIndividualHandlers(authHandler, postHandler, voteHandler, userHandler, apiHandler, authService). + withStaticDir(staticDir). + withRateLimitConfig(rateLimitConfig). + build()) return router, suite }