This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
|
||||
"github.com/break/junhong_cmp_fiber/internal/model"
|
||||
"github.com/break/junhong_cmp_fiber/internal/service/account"
|
||||
"github.com/break/junhong_cmp_fiber/internal/service/account_audit"
|
||||
"github.com/break/junhong_cmp_fiber/internal/store/postgres"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/constants"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/middleware"
|
||||
@@ -24,7 +25,11 @@ func TestRoleAssignmentLimit_PlatformUser(t *testing.T) {
|
||||
accountStore := postgres.NewAccountStore(tx, rdb)
|
||||
roleStore := postgres.NewRoleStore(tx)
|
||||
accountRoleStore := postgres.NewAccountRoleStore(tx, rdb)
|
||||
service := account.New(accountStore, roleStore, accountRoleStore)
|
||||
shopStore := postgres.NewShopStore(tx, rdb)
|
||||
enterpriseStore := postgres.NewEnterpriseStore(tx, rdb)
|
||||
auditLogStore := postgres.NewAccountOperationLogStore(tx)
|
||||
auditService := account_audit.NewService(auditLogStore)
|
||||
service := account.New(accountStore, roleStore, accountRoleStore, shopStore, enterpriseStore, auditService)
|
||||
|
||||
ctx := context.Background()
|
||||
ctx = middleware.SetUserContext(ctx, middleware.NewSimpleUserContext(1, constants.UserTypeSuperAdmin, 0))
|
||||
@@ -65,7 +70,11 @@ func TestRoleAssignmentLimit_AgentUser(t *testing.T) {
|
||||
accountStore := postgres.NewAccountStore(tx, rdb)
|
||||
roleStore := postgres.NewRoleStore(tx)
|
||||
accountRoleStore := postgres.NewAccountRoleStore(tx, rdb)
|
||||
service := account.New(accountStore, roleStore, accountRoleStore)
|
||||
shopStore := postgres.NewShopStore(tx, rdb)
|
||||
enterpriseStore := postgres.NewEnterpriseStore(tx, rdb)
|
||||
auditLogStore := postgres.NewAccountOperationLogStore(tx)
|
||||
auditService := account_audit.NewService(auditLogStore)
|
||||
service := account.New(accountStore, roleStore, accountRoleStore, shopStore, enterpriseStore, auditService)
|
||||
|
||||
ctx := context.Background()
|
||||
ctx = middleware.SetUserContext(ctx, middleware.NewSimpleUserContext(1, constants.UserTypeSuperAdmin, 0))
|
||||
@@ -109,7 +118,11 @@ func TestRoleAssignmentLimit_EnterpriseUser(t *testing.T) {
|
||||
accountStore := postgres.NewAccountStore(tx, rdb)
|
||||
roleStore := postgres.NewRoleStore(tx)
|
||||
accountRoleStore := postgres.NewAccountRoleStore(tx, rdb)
|
||||
service := account.New(accountStore, roleStore, accountRoleStore)
|
||||
shopStore := postgres.NewShopStore(tx, rdb)
|
||||
enterpriseStore := postgres.NewEnterpriseStore(tx, rdb)
|
||||
auditLogStore := postgres.NewAccountOperationLogStore(tx)
|
||||
auditService := account_audit.NewService(auditLogStore)
|
||||
service := account.New(accountStore, roleStore, accountRoleStore, shopStore, enterpriseStore, auditService)
|
||||
|
||||
ctx := context.Background()
|
||||
ctx = middleware.SetUserContext(ctx, middleware.NewSimpleUserContext(1, constants.UserTypeSuperAdmin, 0))
|
||||
@@ -153,7 +166,11 @@ func TestRoleAssignmentLimit_SuperAdmin(t *testing.T) {
|
||||
accountStore := postgres.NewAccountStore(tx, rdb)
|
||||
roleStore := postgres.NewRoleStore(tx)
|
||||
accountRoleStore := postgres.NewAccountRoleStore(tx, rdb)
|
||||
service := account.New(accountStore, roleStore, accountRoleStore)
|
||||
shopStore := postgres.NewShopStore(tx, rdb)
|
||||
enterpriseStore := postgres.NewEnterpriseStore(tx, rdb)
|
||||
auditLogStore := postgres.NewAccountOperationLogStore(tx)
|
||||
auditService := account_audit.NewService(auditLogStore)
|
||||
service := account.New(accountStore, roleStore, accountRoleStore, shopStore, enterpriseStore, auditService)
|
||||
|
||||
ctx := context.Background()
|
||||
ctx = middleware.SetUserContext(ctx, middleware.NewSimpleUserContext(1, constants.UserTypeSuperAdmin, 0))
|
||||
|
||||
Reference in New Issue
Block a user