9
9
"github.com/stretchr/testify/assert"
10
10
"github.com/traPtitech/traPortfolio/domain"
11
11
"github.com/traPtitech/traPortfolio/infrastructure/external/mock_external_e2e"
12
- "github.com/traPtitech/traPortfolio/integration_tests/testutils"
13
12
14
- irepository "github.com/traPtitech/traPortfolio/infrastructure/repository"
15
13
urepository "github.com/traPtitech/traPortfolio/usecases/repository"
16
14
"github.com/traPtitech/traPortfolio/util/mockdata"
17
15
"github.com/traPtitech/traPortfolio/util/random"
@@ -20,8 +18,8 @@ import (
20
18
func TestContestRepository_GetContests (t * testing.T ) {
21
19
t .Parallel ()
22
20
23
- db := testutils . SetupGormDB (t )
24
- repo := irepository . NewContestRepository (db , mock_external_e2e .NewMockPortalAPI ())
21
+ db := SetupTestGormDB (t )
22
+ repo := NewContestRepository (db , mock_external_e2e .NewMockPortalAPI ())
25
23
contest1 := mustMakeContest (t , repo , nil )
26
24
contest2 := mustMakeContest (t , repo , nil )
27
25
contests , err := repo .GetContests (context .Background ())
@@ -35,8 +33,8 @@ func TestContestRepository_GetContests(t *testing.T) {
35
33
func TestContestRepository_GetContest (t * testing.T ) {
36
34
t .Parallel ()
37
35
38
- db := testutils . SetupGormDB (t )
39
- repo := irepository . NewContestRepository (db , mock_external_e2e .NewMockPortalAPI ())
36
+ db := SetupTestGormDB (t )
37
+ repo := NewContestRepository (db , mock_external_e2e .NewMockPortalAPI ())
40
38
contest1 := mustMakeContest (t , repo , nil )
41
39
contest2 := mustMakeContest (t , repo , nil )
42
40
@@ -52,8 +50,8 @@ func TestContestRepository_GetContest(t *testing.T) {
52
50
func TestContestRepository_UpdateContest (t * testing.T ) {
53
51
t .Parallel ()
54
52
55
- db := testutils . SetupGormDB (t )
56
- repo := irepository . NewContestRepository (db , mock_external_e2e .NewMockPortalAPI ())
53
+ db := SetupTestGormDB (t )
54
+ repo := NewContestRepository (db , mock_external_e2e .NewMockPortalAPI ())
57
55
tests := []struct {
58
56
name string
59
57
ctx context.Context
@@ -109,8 +107,8 @@ func TestContestRepository_UpdateContest(t *testing.T) {
109
107
func TestContestRepository_DeleteContest (t * testing.T ) {
110
108
t .Parallel ()
111
109
112
- db := testutils . SetupGormDB (t )
113
- repo := irepository . NewContestRepository (db , mock_external_e2e .NewMockPortalAPI ())
110
+ db := SetupTestGormDB (t )
111
+ repo := NewContestRepository (db , mock_external_e2e .NewMockPortalAPI ())
114
112
contest1 := mustMakeContest (t , repo , nil )
115
113
contest2 := mustMakeContest (t , repo , nil )
116
114
@@ -137,8 +135,8 @@ func TestContestRepository_DeleteContest(t *testing.T) {
137
135
func TestContestRepository_GetContestTeams (t * testing.T ) {
138
136
t .Parallel ()
139
137
140
- db := testutils . SetupGormDB (t )
141
- repo := irepository . NewContestRepository (db , mock_external_e2e .NewMockPortalAPI ())
138
+ db := SetupTestGormDB (t )
139
+ repo := NewContestRepository (db , mock_external_e2e .NewMockPortalAPI ())
142
140
143
141
contest1 := mustMakeContest (t , repo , nil )
144
142
contest2 := mustMakeContest (t , repo , nil )
@@ -169,8 +167,8 @@ func TestContestRepository_GetContestTeams(t *testing.T) {
169
167
func TestContestRepository_GetContestTeam (t * testing.T ) {
170
168
t .Parallel ()
171
169
172
- db := testutils . SetupGormDB (t )
173
- repo := irepository . NewContestRepository (db , mock_external_e2e .NewMockPortalAPI ())
170
+ db := SetupTestGormDB (t )
171
+ repo := NewContestRepository (db , mock_external_e2e .NewMockPortalAPI ())
174
172
175
173
contest1 := mustMakeContest (t , repo , nil )
176
174
contest2 := mustMakeContest (t , repo , nil )
@@ -202,8 +200,8 @@ func TestContestRepository_GetContestTeam(t *testing.T) {
202
200
func TestContestRepository_UpdateContestTeam (t * testing.T ) {
203
201
t .Parallel ()
204
202
205
- db := testutils . SetupGormDB (t )
206
- repo := irepository . NewContestRepository (db , mock_external_e2e .NewMockPortalAPI ())
203
+ db := SetupTestGormDB (t )
204
+ repo := NewContestRepository (db , mock_external_e2e .NewMockPortalAPI ())
207
205
208
206
tests := []struct {
209
207
name string
@@ -251,8 +249,8 @@ func TestContestRepository_UpdateContestTeam(t *testing.T) {
251
249
func TestContestRepository_DeleteContestTeam (t * testing.T ) {
252
250
t .Parallel ()
253
251
254
- db := testutils . SetupGormDB (t )
255
- repo := irepository . NewContestRepository (db , mock_external_e2e .NewMockPortalAPI ())
252
+ db := SetupTestGormDB (t )
253
+ repo := NewContestRepository (db , mock_external_e2e .NewMockPortalAPI ())
256
254
257
255
contest1 := mustMakeContest (t , repo , nil )
258
256
contest2 := mustMakeContest (t , repo , nil )
@@ -297,10 +295,10 @@ func TestContestRepository_DeleteContestTeam(t *testing.T) {
297
295
func TestContestRepository_GetContestTeamMembers (t * testing.T ) {
298
296
t .Parallel ()
299
297
300
- db := testutils . SetupGormDB (t )
298
+ db := SetupTestGormDB (t )
301
299
err := mockdata .InsertSampleDataToDB (db )
302
300
assert .NoError (t , err )
303
- repo := irepository . NewContestRepository (db , mock_external_e2e .NewMockPortalAPI ())
301
+ repo := NewContestRepository (db , mock_external_e2e .NewMockPortalAPI ())
304
302
305
303
contest1 := mustMakeContest (t , repo , nil )
306
304
contest2 := mustMakeContest (t , repo , nil )
@@ -357,10 +355,10 @@ func TestContestRepository_GetContestTeamMembers(t *testing.T) {
357
355
func TestContestRepository_EditContestTeamMembers (t * testing.T ) {
358
356
t .Parallel ()
359
357
360
- db := testutils . SetupGormDB (t )
358
+ db := SetupTestGormDB (t )
361
359
err := mockdata .InsertSampleDataToDB (db )
362
360
assert .NoError (t , err )
363
- repo := irepository . NewContestRepository (db , mock_external_e2e .NewMockPortalAPI ())
361
+ repo := NewContestRepository (db , mock_external_e2e .NewMockPortalAPI ())
364
362
365
363
contest1 := mustMakeContest (t , repo , nil )
366
364
contest2 := mustMakeContest (t , repo , nil )
0 commit comments