@@ -22,6 +22,10 @@ import (
22
22
"go.uber.org/mock/gomock"
23
23
)
24
24
25
+ const (
26
+ KeyUnitTest = "DoWithLogic!@#"
27
+ )
28
+
25
29
func createUserMatcher (user entities.User ) gomock.Matcher {
26
30
return eqUserMatcher {
27
31
users : user ,
@@ -52,8 +56,8 @@ func Test_usecase_CreateUser(t *testing.T) {
52
56
ctrl := gomock .NewController (t )
53
57
defer ctrl .Finish ()
54
58
55
- crypto := app_crypto .NewCrypto ("DoWithLogic!@#" )
56
- appJwt := app_jwt .NewJWT (config.JWTConfig {Key : "DoWithLogic!@#" , Expired : 60 , Label : "XXXX" })
59
+ crypto := app_crypto .NewCrypto (KeyUnitTest )
60
+ appJwt := app_jwt .NewJWT (config.JWTConfig {Key : KeyUnitTest , Expired : 60 , Label : "XXXX" })
57
61
ctx := context .Background ()
58
62
repo := mocks .NewMockRepository (ctrl )
59
63
uc := usecase .NewUseCase (
@@ -123,8 +127,8 @@ func Test_usecase_UpdateUserStatus(t *testing.T) {
123
127
ctrl := gomock .NewController (t )
124
128
defer ctrl .Finish ()
125
129
126
- crypto := app_crypto .NewCrypto ("DoWithLogic!@#" )
127
- appJwt := app_jwt .NewJWT (config.JWTConfig {Key : "DoWithLogic!@#" , Expired : 60 , Label : "XXXX" })
130
+ crypto := app_crypto .NewCrypto (KeyUnitTest )
131
+ appJwt := app_jwt .NewJWT (config.JWTConfig {Key : KeyUnitTest , Expired : 60 , Label : "XXXX" })
128
132
ctx := context .Background ()
129
133
repo := mocks .NewMockRepository (ctrl )
130
134
uc := usecase .NewUseCase (
@@ -181,8 +185,8 @@ func Test_usecase_Detail(t *testing.T) {
181
185
ctrl := gomock .NewController (t )
182
186
defer ctrl .Finish ()
183
187
184
- crypto := app_crypto .NewCrypto ("DoWithLogic!@#" )
185
- appJwt := app_jwt .NewJWT (config.JWTConfig {Key : "DoWithLogic!@#" , Expired : 60 , Label : "XXXX" })
188
+ crypto := app_crypto .NewCrypto (KeyUnitTest )
189
+ appJwt := app_jwt .NewJWT (config.JWTConfig {Key : KeyUnitTest , Expired : 60 , Label : "XXXX" })
186
190
ctx := context .Background ()
187
191
repo := mocks .NewMockRepository (ctrl )
188
192
uc := usecase .NewUseCase (
@@ -230,8 +234,8 @@ func Test_usecase_Login(t *testing.T) {
230
234
email = "martin@test.com"
231
235
)
232
236
233
- crypto := app_crypto .NewCrypto ("DoWithLogic!@#" )
234
- appJwt := app_jwt .NewJWT (config.JWTConfig {Key : "DoWithLogic!@#" , Expired : 60 , Label : "XXXX" })
237
+ crypto := app_crypto .NewCrypto (KeyUnitTest )
238
+ appJwt := app_jwt .NewJWT (config.JWTConfig {Key : KeyUnitTest , Expired : 60 , Label : "XXXX" })
235
239
ctx := context .Background ()
236
240
repo := mocks .NewMockRepository (ctrl )
237
241
uc := usecase .NewUseCase (
@@ -289,8 +293,8 @@ func Test_usecase_PartialUpdate(t *testing.T) {
289
293
}
290
294
)
291
295
292
- crypto := app_crypto .NewCrypto ("DoWithLogic!@#" )
293
- appJwt := app_jwt .NewJWT (config.JWTConfig {Key : "DoWithLogic!@#" , Expired : 60 , Label : "XXXX" })
296
+ crypto := app_crypto .NewCrypto (KeyUnitTest )
297
+ appJwt := app_jwt .NewJWT (config.JWTConfig {Key : KeyUnitTest , Expired : 60 , Label : "XXXX" })
294
298
repo := mocks .NewMockRepository (ctrl )
295
299
uc := usecase .NewUseCase (
296
300
repo ,
0 commit comments