Skip to content

Commit b795fe7

Browse files
🚨 : sonar cloud warning
1 parent d90cee8 commit b795fe7

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

internal/users/usecase/usecase_test.go

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ import (
2222
"go.uber.org/mock/gomock"
2323
)
2424

25+
const (
26+
KeyUnitTest = "DoWithLogic!@#"
27+
)
28+
2529
func createUserMatcher(user entities.User) gomock.Matcher {
2630
return eqUserMatcher{
2731
users: user,
@@ -52,8 +56,8 @@ func Test_usecase_CreateUser(t *testing.T) {
5256
ctrl := gomock.NewController(t)
5357
defer ctrl.Finish()
5458

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"})
5761
ctx := context.Background()
5862
repo := mocks.NewMockRepository(ctrl)
5963
uc := usecase.NewUseCase(
@@ -123,8 +127,8 @@ func Test_usecase_UpdateUserStatus(t *testing.T) {
123127
ctrl := gomock.NewController(t)
124128
defer ctrl.Finish()
125129

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"})
128132
ctx := context.Background()
129133
repo := mocks.NewMockRepository(ctrl)
130134
uc := usecase.NewUseCase(
@@ -181,8 +185,8 @@ func Test_usecase_Detail(t *testing.T) {
181185
ctrl := gomock.NewController(t)
182186
defer ctrl.Finish()
183187

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"})
186190
ctx := context.Background()
187191
repo := mocks.NewMockRepository(ctrl)
188192
uc := usecase.NewUseCase(
@@ -230,8 +234,8 @@ func Test_usecase_Login(t *testing.T) {
230234
email = "martin@test.com"
231235
)
232236

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"})
235239
ctx := context.Background()
236240
repo := mocks.NewMockRepository(ctrl)
237241
uc := usecase.NewUseCase(
@@ -289,8 +293,8 @@ func Test_usecase_PartialUpdate(t *testing.T) {
289293
}
290294
)
291295

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"})
294298
repo := mocks.NewMockRepository(ctrl)
295299
uc := usecase.NewUseCase(
296300
repo,

0 commit comments

Comments
 (0)