diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-02-21 10:46:02 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-02-21 10:46:02 +0900 |
| commit | 642d3b4e1d33afd521f315b9aa99b8993d252902 (patch) | |
| tree | f39e7c191033354db56675d9d3dc4c4be17d7aba /backend/api/handler_test.go | |
| parent | e8db174d3e464a5764a9f4bfd82172261bd50519 (diff) | |
| download | phperkaigi-2026-albatross-642d3b4e1d33afd521f315b9aa99b8993d252902.tar.gz phperkaigi-2026-albatross-642d3b4e1d33afd521f315b9aa99b8993d252902.tar.zst phperkaigi-2026-albatross-642d3b4e1d33afd521f315b9aa99b8993d252902.zip | |
refactor(admin): separate business logic into game and tournament services
Move transaction handling, rejudge workflow, tournament bracket creation,
and data repair logic from admin handler into game.Service and
tournament.Service, mirroring the earlier api package separation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'backend/api/handler_test.go')
| -rw-r--r-- | backend/api/handler_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/backend/api/handler_test.go b/backend/api/handler_test.go index 2b8c06a..a4e08dc 100644 --- a/backend/api/handler_test.go +++ b/backend/api/handler_test.go @@ -160,7 +160,7 @@ func newTestHandler(q *mockQuerier) Handler { hub := &mockGameHub{} return Handler{ gameSvc: game.NewService(q, &mockTxManager{}, hub), - tournamentSvc: tournament.NewService(q), + tournamentSvc: tournament.NewService(q, &mockTxManager{}), auth: &mockAuthenticator{}, conf: &config.Config{}, q: q, @@ -170,7 +170,7 @@ func newTestHandler(q *mockQuerier) Handler { func newTestHandlerWithHub(q *mockQuerier, hub *mockGameHub) Handler { return Handler{ gameSvc: game.NewService(q, &mockTxManager{}, hub), - tournamentSvc: tournament.NewService(q), + tournamentSvc: tournament.NewService(q, &mockTxManager{}), auth: &mockAuthenticator{}, conf: &config.Config{}, q: q, @@ -443,7 +443,7 @@ func TestGetGame_PublicGameSuccess(t *testing.T) { func TestPostLogin_AuthFailure(t *testing.T) { h := Handler{ gameSvc: game.NewService(&mockQuerier{}, &mockTxManager{}, &mockGameHub{}), - tournamentSvc: tournament.NewService(&mockQuerier{}), + tournamentSvc: tournament.NewService(&mockQuerier{}, &mockTxManager{}), auth: &mockAuthenticator{loginErr: errors.New("invalid credentials")}, conf: &config.Config{}, q: &mockQuerier{}, @@ -462,7 +462,7 @@ func TestPostLogin_AuthFailure(t *testing.T) { func TestPostLogout(t *testing.T) { h := Handler{ gameSvc: game.NewService(&mockQuerier{}, &mockTxManager{}, &mockGameHub{}), - tournamentSvc: tournament.NewService(&mockQuerier{}), + tournamentSvc: tournament.NewService(&mockQuerier{}, &mockTxManager{}), auth: &mockAuthenticator{}, conf: &config.Config{BasePath: "/"}, q: &mockQuerier{}, |
