IAM: Run user creation inside transaction (#106113)
This commit is contained in:
@@ -21,6 +21,7 @@ type FakeOrgService struct {
|
||||
ExpectedSearchOrgUsersResult *org.SearchOrgUsersQueryResult
|
||||
ExpectedOrgListResponse OrgListResponse
|
||||
SearchOrgUsersFn func(context.Context, *org.SearchOrgUsersQuery) (*org.SearchOrgUsersQueryResult, error)
|
||||
InsertOrgUserFn func(context.Context, *org.OrgUser) (int64, error)
|
||||
}
|
||||
|
||||
func NewOrgServiceFake() *FakeOrgService {
|
||||
@@ -36,6 +37,9 @@ func (f *FakeOrgService) Insert(ctx context.Context, cmd *org.OrgUser) (int64, e
|
||||
}
|
||||
|
||||
func (f *FakeOrgService) InsertOrgUser(ctx context.Context, cmd *org.OrgUser) (int64, error) {
|
||||
if f.InsertOrgUserFn != nil {
|
||||
return f.InsertOrgUserFn(ctx, cmd)
|
||||
}
|
||||
return f.ExpectedOrgUserID, f.ExpectedError
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user