From 2cd0b7ff31b03fdd03d459fe8660c0f6d9398898 Mon Sep 17 00:00:00 2001 From: Maxim Lebedev Date: Fri, 25 Feb 2022 20:36:40 +0500 Subject: [PATCH] :art: Format auth http delivery tests --- internal/client/delivery/http/client_http_test.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/internal/client/delivery/http/client_http_test.go b/internal/client/delivery/http/client_http_test.go index bff37ac..cf2fdf8 100644 --- a/internal/client/delivery/http/client_http_test.go +++ b/internal/client/delivery/http/client_http_test.go @@ -11,6 +11,8 @@ import ( delivery "source.toby3d.me/website/indieauth/internal/client/delivery/http" "source.toby3d.me/website/indieauth/internal/domain" + "source.toby3d.me/website/indieauth/internal/profile" + profilerepo "source.toby3d.me/website/indieauth/internal/profile/repository/memory" "source.toby3d.me/website/indieauth/internal/session" sessionrepo "source.toby3d.me/website/indieauth/internal/session/repository/memory" "source.toby3d.me/website/indieauth/internal/testing/httptest" @@ -20,6 +22,7 @@ import ( ) type Dependencies struct { + profiles profile.Repository client *domain.Client config *domain.Config matcher language.Matcher @@ -65,13 +68,19 @@ func TestRead(t *testing.T) { func NewDependencies(tb testing.TB) Dependencies { tb.Helper() + store := new(sync.Map) client := domain.TestClient(tb) config := domain.TestConfig(tb) matcher := language.NewMatcher(message.DefaultCatalog.Languages()) - store := new(sync.Map) sessions := sessionrepo.NewMemorySessionRepository(store, config) tokens := tokenrepo.NewMemoryTokenRepository(store) - tokenService := tokenucase.NewTokenUseCase(tokens, sessions, config) + profiles := profilerepo.NewMemoryProfileRepository(store) + tokenService := tokenucase.NewTokenUseCase(tokenucase.Config{ + Config: config, + Profiles: profiles, + Sessions: sessions, + Tokens: tokens, + }) return Dependencies{ client: client, @@ -79,6 +88,7 @@ func NewDependencies(tb testing.TB) Dependencies { matcher: matcher, sessions: sessions, store: store, + profiles: profiles, tokens: tokens, tokenService: tokenService, }