mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-22 12:58:46 +00:00
chore: move gofakeit integration testing calls (#10684)
# Which Problems Are Solved Flakiness and conflicts in value from gofakeit. # How the Problems Are Solved Move Gofakeit calls to the integration package, to guarantee proper usage and values for integration testing. # Additional Changes None # Additional Context None
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/brianvoe/gofakeit/v6"
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
@@ -63,7 +62,7 @@ func TestServer_AddPersonalAccessToken(t *testing.T) {
|
||||
ExpirationDate: expirationDate,
|
||||
},
|
||||
func(request *user.AddPersonalAccessTokenRequest) error {
|
||||
resp := Instance.CreateUserTypeHuman(IamCTX, gofakeit.Email())
|
||||
resp := Instance.CreateUserTypeHuman(IamCTX, integration.Email())
|
||||
request.UserId = resp.Id
|
||||
return nil
|
||||
},
|
||||
@@ -109,12 +108,12 @@ func TestServer_AddPersonalAccessToken(t *testing.T) {
|
||||
|
||||
func TestServer_AddPersonalAccessToken_Permission(t *testing.T) {
|
||||
OrgCTX := CTX
|
||||
otherOrg := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), gofakeit.Email())
|
||||
otherOrg := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), integration.Email())
|
||||
otherOrgUser, err := Client.CreateUser(IamCTX, &user.CreateUserRequest{
|
||||
OrganizationId: otherOrg.OrganizationId,
|
||||
UserType: &user.CreateUserRequest_Machine_{
|
||||
Machine: &user.CreateUserRequest_Machine{
|
||||
Name: gofakeit.Name(),
|
||||
Name: integration.Username(),
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -248,12 +247,12 @@ func TestServer_RemovePersonalAccessToken(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestServer_RemovePersonalAccessToken_Permission(t *testing.T) {
|
||||
otherOrg := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), gofakeit.Email())
|
||||
otherOrg := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), integration.Email())
|
||||
otherOrgUser, err := Client.CreateUser(IamCTX, &user.CreateUserRequest{
|
||||
OrganizationId: otherOrg.OrganizationId,
|
||||
UserType: &user.CreateUserRequest_Machine_{
|
||||
Machine: &user.CreateUserRequest_Machine{
|
||||
Name: gofakeit.Name(),
|
||||
Name: integration.Username(),
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -327,12 +326,12 @@ func TestServer_ListPersonalAccessTokens(t *testing.T) {
|
||||
want *user.ListPersonalAccessTokensResponse
|
||||
}
|
||||
OrgCTX := CTX
|
||||
otherOrg := Instance.CreateOrganization(SystemCTX, integration.OrganizationName(), gofakeit.Email())
|
||||
otherOrg := Instance.CreateOrganization(SystemCTX, integration.OrganizationName(), integration.Email())
|
||||
otherOrgUser, err := Client.CreateUser(SystemCTX, &user.CreateUserRequest{
|
||||
OrganizationId: otherOrg.OrganizationId,
|
||||
UserType: &user.CreateUserRequest_Machine_{
|
||||
Machine: &user.CreateUserRequest_Machine{
|
||||
Name: gofakeit.Name(),
|
||||
Name: integration.Username(),
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user