diff --git a/internal/server/router_test.go b/internal/server/router_test.go index da169fb..42b9936 100644 --- a/internal/server/router_test.go +++ b/internal/server/router_test.go @@ -77,7 +77,8 @@ func setupTestHandlers() (*handlers.AuthHandler, *handlers.PostHandler, *handler emailSender := &testutils.MockEmailSender{} voteService := services.NewVoteService(voteRepo, postRepo, nil) - metadataService := services.NewURLMetadataService() + titleFetcher := &testutils.MockTitleFetcher{} + titleFetcher.SetTitle("Example Domain") mockRefreshRepo := &mockRefreshTokenRepository{} mockDeletionRepo := &mockAccountDeletionRepository{} @@ -94,7 +95,7 @@ func setupTestHandlers() (*handlers.AuthHandler, *handlers.PostHandler, *handler } authHandler := handlers.NewAuthHandler(authFacade, userRepo) - postHandler := handlers.NewPostHandler(postRepo, metadataService, voteService) + postHandler := handlers.NewPostHandler(postRepo, titleFetcher, voteService) voteHandler := handlers.NewVoteHandler(voteService) userHandler := handlers.NewUserHandler(userRepo, authFacade) apiHandler := handlers.NewAPIHandler(testutils.AppTestConfig, postRepo, userRepo, voteService)