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:
Stefan Benz
2025-09-10 09:00:31 +03:00
committed by GitHub
parent b9b9baf67f
commit 492f1826ee
71 changed files with 1083 additions and 980 deletions
@@ -5,7 +5,6 @@ package user_test
import (
"testing"
"github.com/brianvoe/gofakeit/v6"
"github.com/muhlemmer/gu"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -147,7 +146,7 @@ func TestServer_Deprecated_SetEmail(t *testing.T) {
func TestServer_ResendEmailCode(t *testing.T) {
userID := Instance.CreateHumanUser(CTX).GetUserId()
verifiedUserID := Instance.CreateHumanUserVerified(CTX, Instance.DefaultOrg.Id, gofakeit.Email(), gofakeit.Phone()).GetUserId()
verifiedUserID := Instance.CreateHumanUserVerified(CTX, Instance.DefaultOrg.Id, integration.Email(), integration.Phone()).GetUserId()
tests := []struct {
name string
@@ -251,7 +250,7 @@ func TestServer_ResendEmailCode(t *testing.T) {
func TestServer_SendEmailCode(t *testing.T) {
userID := Instance.CreateHumanUser(CTX).GetUserId()
verifiedUserID := Instance.CreateHumanUserVerified(CTX, Instance.DefaultOrg.Id, gofakeit.Email(), gofakeit.Phone()).GetUserId()
verifiedUserID := Instance.CreateHumanUserVerified(CTX, Instance.DefaultOrg.Id, integration.Email(), integration.Phone()).GetUserId()
tests := []struct {
name string
@@ -7,7 +7,6 @@ import (
"testing"
"time"
"github.com/brianvoe/gofakeit/v6"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"google.golang.org/grpc/metadata"
@@ -98,20 +97,20 @@ func TestServer_AddIDPLink(t *testing.T) {
}
func TestServer_ListIDPLinks(t *testing.T) {
orgResp := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), gofakeit.Email())
orgResp := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), integration.Email())
instanceIdpResp := Instance.AddGenericOAuthProvider(IamCTX, Instance.DefaultOrg.Id)
userInstanceResp := Instance.CreateHumanUserVerified(IamCTX, orgResp.OrganizationId, gofakeit.Email(), gofakeit.Phone())
userInstanceResp := Instance.CreateHumanUserVerified(IamCTX, orgResp.OrganizationId, integration.Email(), integration.Phone())
_, err := Instance.CreateUserIDPlink(IamCTX, userInstanceResp.GetUserId(), "external_instance", instanceIdpResp.Id, "externalUsername_instance")
require.NoError(t, err)
ctxOrg := metadata.AppendToOutgoingContext(IamCTX, "x-zitadel-orgid", orgResp.GetOrganizationId())
orgIdpResp := Instance.AddOrgGenericOAuthProvider(ctxOrg, orgResp.OrganizationId)
userOrgResp := Instance.CreateHumanUserVerified(ctxOrg, orgResp.OrganizationId, gofakeit.Email(), gofakeit.Phone())
userOrgResp := Instance.CreateHumanUserVerified(ctxOrg, orgResp.OrganizationId, integration.Email(), integration.Phone())
_, err = Instance.CreateUserIDPlink(ctxOrg, userOrgResp.GetUserId(), "external_org", orgIdpResp.Id, "externalUsername_org")
require.NoError(t, err)
userMultipleResp := Instance.CreateHumanUserVerified(IamCTX, orgResp.OrganizationId, gofakeit.Email(), gofakeit.Phone())
userMultipleResp := Instance.CreateHumanUserVerified(IamCTX, orgResp.OrganizationId, integration.Email(), integration.Phone())
_, err = Instance.CreateUserIDPlink(IamCTX, userMultipleResp.GetUserId(), "external_multi", instanceIdpResp.Id, "externalUsername_multi")
require.NoError(t, err)
_, err = Instance.CreateUserIDPlink(ctxOrg, userMultipleResp.GetUserId(), "external_multi", orgIdpResp.Id, "externalUsername_multi")
@@ -252,20 +251,20 @@ func TestServer_ListIDPLinks(t *testing.T) {
}
func TestServer_RemoveIDPLink(t *testing.T) {
orgResp := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), gofakeit.Email())
orgResp := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), integration.Email())
instanceIdpResp := Instance.AddGenericOAuthProvider(IamCTX, Instance.DefaultOrg.Id)
userInstanceResp := Instance.CreateHumanUserVerified(IamCTX, orgResp.OrganizationId, gofakeit.Email(), gofakeit.Phone())
userInstanceResp := Instance.CreateHumanUserVerified(IamCTX, orgResp.OrganizationId, integration.Email(), integration.Phone())
_, err := Instance.CreateUserIDPlink(IamCTX, userInstanceResp.GetUserId(), "external_instance", instanceIdpResp.Id, "externalUsername_instance")
require.NoError(t, err)
ctxOrg := metadata.AppendToOutgoingContext(IamCTX, "x-zitadel-orgid", orgResp.GetOrganizationId())
orgIdpResp := Instance.AddOrgGenericOAuthProvider(ctxOrg, orgResp.OrganizationId)
userOrgResp := Instance.CreateHumanUserVerified(ctxOrg, orgResp.OrganizationId, gofakeit.Email(), gofakeit.Phone())
userOrgResp := Instance.CreateHumanUserVerified(ctxOrg, orgResp.OrganizationId, integration.Email(), integration.Phone())
_, err = Instance.CreateUserIDPlink(ctxOrg, userOrgResp.GetUserId(), "external_org", orgIdpResp.Id, "externalUsername_org")
require.NoError(t, err)
userNoLinkResp := Instance.CreateHumanUserVerified(IamCTX, orgResp.OrganizationId, gofakeit.Email(), gofakeit.Phone())
userNoLinkResp := Instance.CreateHumanUserVerified(IamCTX, orgResp.OrganizationId, integration.Email(), integration.Phone())
type args struct {
ctx context.Context
@@ -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"
@@ -107,7 +106,7 @@ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
ExpirationDate: expirationDate,
},
func(request *user.AddKeyRequest) error {
resp := Instance.CreateUserTypeHuman(IamCTX, gofakeit.Email())
resp := Instance.CreateUserTypeHuman(IamCTX, integration.Email())
request.UserId = resp.Id
return nil
},
@@ -157,12 +156,12 @@ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
func TestServer_AddKey_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(),
},
},
})
@@ -297,12 +296,12 @@ func TestServer_RemoveKey(t *testing.T) {
func TestServer_RemoveKey_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(),
},
},
})
@@ -376,12 +375,12 @@ func TestServer_ListKeys(t *testing.T) {
want *user.ListKeysResponse
}
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(),
},
},
})
@@ -8,7 +8,6 @@ import (
"testing"
"time"
"github.com/brianvoe/gofakeit/v6"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -33,7 +32,7 @@ func TestServer_SetUserMetadata(t *testing.T) {
name: "missing permission",
ctx: Instance.WithAuthorizationToken(context.Background(), integration.UserTypeNoPermission),
dep: func(req *user.SetUserMetadataRequest) {
req.UserId = Instance.CreateUserTypeHuman(CTX, gofakeit.Email()).GetId()
req.UserId = Instance.CreateUserTypeHuman(CTX, integration.Email()).GetId()
},
req: &user.SetUserMetadataRequest{
Metadata: []*user.Metadata{{Key: "key1", Value: []byte(base64.StdEncoding.EncodeToString([]byte("value1")))}},
@@ -44,7 +43,7 @@ func TestServer_SetUserMetadata(t *testing.T) {
name: "set user metadata",
ctx: iamOwnerCTX,
dep: func(req *user.SetUserMetadataRequest) {
req.UserId = Instance.CreateUserTypeHuman(CTX, gofakeit.Email()).GetId()
req.UserId = Instance.CreateUserTypeHuman(CTX, integration.Email()).GetId()
},
req: &user.SetUserMetadataRequest{
Metadata: []*user.Metadata{{Key: "key1", Value: []byte(base64.StdEncoding.EncodeToString([]byte("value1")))}},
@@ -55,7 +54,7 @@ func TestServer_SetUserMetadata(t *testing.T) {
name: "set user metadata, multiple",
ctx: iamOwnerCTX,
dep: func(req *user.SetUserMetadataRequest) {
req.UserId = Instance.CreateUserTypeHuman(CTX, gofakeit.Email()).GetId()
req.UserId = Instance.CreateUserTypeHuman(CTX, integration.Email()).GetId()
},
req: &user.SetUserMetadataRequest{
Metadata: []*user.Metadata{
@@ -79,7 +78,7 @@ func TestServer_SetUserMetadata(t *testing.T) {
name: "update user metadata",
ctx: Instance.WithAuthorizationToken(CTX, integration.UserTypeIAMOwner),
dep: func(req *user.SetUserMetadataRequest) {
req.UserId = Instance.CreateUserTypeHuman(iamOwnerCTX, gofakeit.Email()).GetId()
req.UserId = Instance.CreateUserTypeHuman(iamOwnerCTX, integration.Email()).GetId()
Instance.SetUserMetadata(iamOwnerCTX, req.UserId, "key1", "value1")
},
req: &user.SetUserMetadataRequest{
@@ -91,7 +90,7 @@ func TestServer_SetUserMetadata(t *testing.T) {
name: "update user metadata with same value",
ctx: Instance.WithAuthorizationToken(CTX, integration.UserTypeIAMOwner),
dep: func(req *user.SetUserMetadataRequest) {
req.UserId = Instance.CreateUserTypeHuman(iamOwnerCTX, gofakeit.Email()).GetId()
req.UserId = Instance.CreateUserTypeHuman(iamOwnerCTX, integration.Email()).GetId()
Instance.SetUserMetadata(iamOwnerCTX, req.UserId, "key1", "value1")
},
req: &user.SetUserMetadataRequest{
@@ -151,7 +150,7 @@ func TestServer_ListUserMetadata(t *testing.T) {
args: args{
ctx: Instance.WithAuthorizationToken(context.Background(), integration.UserTypeNoPermission),
dep: func(ctx context.Context, request *user.ListUserMetadataRequest, response *user.ListUserMetadataResponse) {
userID := Instance.CreateUserTypeHuman(iamOwnerCTX, gofakeit.Email()).GetId()
userID := Instance.CreateUserTypeHuman(iamOwnerCTX, integration.Email()).GetId()
request.UserId = userID
Instance.SetUserMetadata(iamOwnerCTX, userID, "key1", "value1")
},
@@ -164,7 +163,7 @@ func TestServer_ListUserMetadata(t *testing.T) {
args: args{
ctx: iamOwnerCTX,
dep: func(ctx context.Context, request *user.ListUserMetadataRequest, response *user.ListUserMetadataResponse) {
userID := Instance.CreateUserTypeHuman(iamOwnerCTX, gofakeit.Email()).GetId()
userID := Instance.CreateUserTypeHuman(iamOwnerCTX, integration.Email()).GetId()
request.UserId = userID
metadataResp := Instance.SetUserMetadata(iamOwnerCTX, userID, "key1", "value1")
@@ -192,7 +191,7 @@ func TestServer_ListUserMetadata(t *testing.T) {
args: args{
ctx: iamOwnerCTX,
dep: func(ctx context.Context, request *user.ListUserMetadataRequest, response *user.ListUserMetadataResponse) {
userID := Instance.CreateUserTypeHuman(iamOwnerCTX, gofakeit.Email()).GetId()
userID := Instance.CreateUserTypeHuman(iamOwnerCTX, integration.Email()).GetId()
request.UserId = userID
key := "key1"
response.Metadata[0] = setUserMetadata(iamOwnerCTX, userID, key, "value1")
@@ -221,7 +220,7 @@ func TestServer_ListUserMetadata(t *testing.T) {
args: args{
ctx: iamOwnerCTX,
dep: func(ctx context.Context, request *user.ListUserMetadataRequest, response *user.ListUserMetadataResponse) {
userID := Instance.CreateUserTypeHuman(iamOwnerCTX, gofakeit.Email()).GetId()
userID := Instance.CreateUserTypeHuman(iamOwnerCTX, integration.Email()).GetId()
request.UserId = userID
response.Metadata[2] = setUserMetadata(iamOwnerCTX, userID, "key1", "value1")
@@ -312,7 +311,7 @@ func TestServer_DeleteUserMetadata(t *testing.T) {
ctx: iamOwnerCTX,
prepare: func(request *user.DeleteUserMetadataRequest) (time.Time, time.Time) {
creationDate := time.Now().UTC()
userID := Instance.CreateUserTypeHuman(iamOwnerCTX, gofakeit.Email()).GetId()
userID := Instance.CreateUserTypeHuman(iamOwnerCTX, integration.Email()).GetId()
request.UserId = userID
key := "key1"
Instance.SetUserMetadata(iamOwnerCTX, userID, key, "value1")
@@ -327,7 +326,7 @@ func TestServer_DeleteUserMetadata(t *testing.T) {
ctx: iamOwnerCTX,
prepare: func(request *user.DeleteUserMetadataRequest) (time.Time, time.Time) {
creationDate := time.Now().UTC()
userID := Instance.CreateUserTypeHuman(iamOwnerCTX, gofakeit.Email()).GetId()
userID := Instance.CreateUserTypeHuman(iamOwnerCTX, integration.Email()).GetId()
request.UserId = userID
key := "key1"
Instance.SetUserMetadata(iamOwnerCTX, userID, key, "value1")
@@ -342,7 +341,7 @@ func TestServer_DeleteUserMetadata(t *testing.T) {
ctx: iamOwnerCTX,
prepare: func(request *user.DeleteUserMetadataRequest) (time.Time, time.Time) {
creationDate := time.Now().UTC()
userID := Instance.CreateUserTypeHuman(iamOwnerCTX, gofakeit.Email()).GetId()
userID := Instance.CreateUserTypeHuman(iamOwnerCTX, integration.Email()).GetId()
request.UserId = userID
key := "key1"
Instance.SetUserMetadata(iamOwnerCTX, userID, key, "value1")
@@ -358,7 +357,7 @@ func TestServer_DeleteUserMetadata(t *testing.T) {
ctx: iamOwnerCTX,
prepare: func(request *user.DeleteUserMetadataRequest) (time.Time, time.Time) {
creationDate := time.Now().UTC()
userID := Instance.CreateUserTypeHuman(iamOwnerCTX, gofakeit.Email()).GetId()
userID := Instance.CreateUserTypeHuman(iamOwnerCTX, integration.Email()).GetId()
request.UserId = userID
key1 := "key1"
Instance.SetUserMetadata(iamOwnerCTX, userID, key1, "value1")
@@ -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(),
},
},
})
@@ -6,7 +6,6 @@ import (
"context"
"testing"
"github.com/brianvoe/gofakeit/v6"
"github.com/muhlemmer/gu"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -123,7 +122,7 @@ func TestServer_Deprecated_SetPhone(t *testing.T) {
func TestServer_ResendPhoneCode(t *testing.T) {
userID := Instance.CreateHumanUser(CTX).GetUserId()
verifiedUserID := Instance.CreateHumanUserVerified(CTX, Instance.DefaultOrg.Id, gofakeit.Email(), gofakeit.Phone()).GetUserId()
verifiedUserID := Instance.CreateHumanUserVerified(CTX, Instance.DefaultOrg.Id, integration.Email(), integration.Phone()).GetUserId()
tests := []struct {
name string
@@ -10,7 +10,6 @@ import (
"testing"
"time"
"github.com/brianvoe/gofakeit/v6"
"github.com/muhlemmer/gu"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -75,7 +74,7 @@ func setPermissionCheckV2Flag(t *testing.T, setFlag bool) {
}
func TestServer_GetUserByID(t *testing.T) {
orgResp := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), gofakeit.Email())
orgResp := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), integration.Email())
type args struct {
ctx context.Context
req *user.GetUserByIDRequest
@@ -239,7 +238,7 @@ func TestServer_GetUserByID(t *testing.T) {
}
func TestServer_GetUserByID_Permission(t *testing.T) {
newOrgOwnerEmail := gofakeit.Email()
newOrgOwnerEmail := integration.Email()
newOrg := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), newOrgOwnerEmail)
newUserID := newOrg.CreatedAdmins[0].GetUserId()
type args struct {
@@ -422,7 +421,7 @@ func createUser(ctx context.Context, orgID string, passwordChangeRequired bool)
func createUserWithUserName(ctx context.Context, username string, orgID string, passwordChangeRequired bool) userAttr {
// used as default country prefix
phone := "+41" + gofakeit.Phone()
phone := integration.Phone()
resp := Instance.CreateHumanUserVerified(ctx, orgID, username, phone)
info := userAttr{resp.GetUserId(), username, phone, nil, resp.GetDetails()}
// as the change date of the creation is the creation date
@@ -440,7 +439,7 @@ func TestServer_ListUsers(t *testing.T) {
require.NoError(t, err)
})
orgResp := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), gofakeit.Email())
orgResp := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), integration.Email())
type args struct {
ctx context.Context
req *user.ListUsersRequest
@@ -997,7 +996,7 @@ func TestServer_ListUsers(t *testing.T) {
IamCTX,
&user.ListUsersRequest{},
func(ctx context.Context, request *user.ListUsersRequest) userAttrs {
orgResp := Instance.CreateOrganization(ctx, integration.OrganizationName(), gofakeit.Email())
orgResp := Instance.CreateOrganization(ctx, integration.OrganizationName(), integration.Email())
infos := createUsers(ctx, orgResp.OrganizationId, 3, false)
request.Queries = []*user.SearchQuery{}
@@ -1084,7 +1083,7 @@ func TestServer_ListUsers(t *testing.T) {
IamCTX,
&user.ListUsersRequest{},
func(ctx context.Context, request *user.ListUsersRequest) userAttrs {
orgRespForOrgTests := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), gofakeit.Email())
orgRespForOrgTests := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), integration.Email())
info := createUser(ctx, orgRespForOrgTests.OrganizationId, false)
request.Queries = []*user.SearchQuery{}
request.Queries = append(request.Queries, OrganizationIdQuery(orgRespForOrgTests.OrganizationId))
@@ -1131,8 +1130,8 @@ func TestServer_ListUsers(t *testing.T) {
IamCTX,
&user.ListUsersRequest{},
func(ctx context.Context, request *user.ListUsersRequest) userAttrs {
orgRespForOrgTests := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), gofakeit.Email())
orgRespForOrgTests2 := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), gofakeit.Email())
orgRespForOrgTests := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), integration.Email())
orgRespForOrgTests2 := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), integration.Email())
createUser(ctx, orgRespForOrgTests.OrganizationId, false)
request.Queries = []*user.SearchQuery{}
request.Queries = append(request.Queries, OrganizationIdQuery(orgRespForOrgTests2.OrganizationId))
@@ -1234,9 +1233,9 @@ func TestServer_SystemUsers_ListUsers(t *testing.T) {
require.NoError(t, err)
}()
org1 := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), gofakeit.Email())
org1 := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), integration.Email())
org2 := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), "[email protected]")
org3 := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), gofakeit.Email())
org3 := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), integration.Email())
_ = createUserWithUserName(IamCTX, "[email protected]", org1.OrganizationId, false)
_ = createUserWithUserName(IamCTX, "[email protected]", org2.OrganizationId, false)
_ = createUserWithUserName(IamCTX, "[email protected]", org3.OrganizationId, false)
@@ -7,7 +7,6 @@ import (
"testing"
"time"
"github.com/brianvoe/gofakeit/v6"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -97,12 +96,12 @@ func TestServer_AddSecret(t *testing.T) {
}
func TestServer_AddSecret_Permission(t *testing.T) {
otherOrg := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), gofakeit.Email())
otherOrg := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), integration.Email())
otherOrgUser, err := Instance.Client.UserV2.CreateUser(IamCTX, &user.CreateUserRequest{
OrganizationId: otherOrg.OrganizationId,
UserType: &user.CreateUserRequest_Machine_{
Machine: &user.CreateUserRequest_Machine{
Name: gofakeit.Name(),
Name: integration.Username(),
},
},
})
@@ -244,12 +243,12 @@ func TestServer_RemoveSecret(t *testing.T) {
}
func TestServer_RemoveSecret_Permission(t *testing.T) {
otherOrg := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), gofakeit.Email())
otherOrg := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), integration.Email())
otherOrgUser, err := Instance.Client.UserV2.CreateUser(IamCTX, &user.CreateUserRequest{
OrganizationId: otherOrg.OrganizationId,
UserType: &user.CreateUserRequest_Machine_{
Machine: &user.CreateUserRequest_Machine{
Name: gofakeit.Name(),
Name: integration.Username(),
},
},
})
@@ -11,7 +11,6 @@ import (
"testing"
"time"
"github.com/brianvoe/gofakeit/v6"
"github.com/muhlemmer/gu"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -687,7 +686,7 @@ func TestServer_Deprecated_AddHumanUser(t *testing.T) {
}
func TestServer_Deprecated_AddHumanUser_Permission(t *testing.T) {
newOrgOwnerEmail := gofakeit.Email()
newOrgOwnerEmail := integration.Email()
newOrg := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), newOrgOwnerEmail)
type args struct {
ctx context.Context
@@ -915,7 +914,7 @@ func TestServer_Deprecated_UpdateHumanUser(t *testing.T) {
args: args{
CTX,
&user.UpdateHumanUserRequest{
Username: gu.Ptr(gofakeit.Username()),
Username: gu.Ptr(integration.Username()),
},
},
want: &user.UpdateHumanUserResponse{
@@ -1241,7 +1240,7 @@ func TestServer_Deprecated_UpdateHumanUser(t *testing.T) {
}
func TestServer_Deprecated_UpdateHumanUser_Permission(t *testing.T) {
newOrgOwnerEmail := gofakeit.Email()
newOrgOwnerEmail := integration.Email()
newOrg := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), newOrgOwnerEmail)
newUserID := newOrg.CreatedAdmins[0].GetUserId()
type args struct {
@@ -1260,7 +1259,7 @@ func TestServer_Deprecated_UpdateHumanUser_Permission(t *testing.T) {
SystemCTX,
&user.UpdateHumanUserRequest{
UserId: newUserID,
Username: gu.Ptr(gofakeit.Username()),
Username: gu.Ptr(integration.Username()),
},
},
want: &user.UpdateHumanUserResponse{
@@ -1276,7 +1275,7 @@ func TestServer_Deprecated_UpdateHumanUser_Permission(t *testing.T) {
IamCTX,
&user.UpdateHumanUserRequest{
UserId: newUserID,
Username: gu.Ptr(gofakeit.Username()),
Username: gu.Ptr(integration.Username()),
},
},
want: &user.UpdateHumanUserResponse{
@@ -1292,7 +1291,7 @@ func TestServer_Deprecated_UpdateHumanUser_Permission(t *testing.T) {
CTX,
&user.UpdateHumanUserRequest{
UserId: newUserID,
Username: gu.Ptr(gofakeit.Username()),
Username: gu.Ptr(integration.Username()),
},
},
wantErr: true,
@@ -1303,7 +1302,7 @@ func TestServer_Deprecated_UpdateHumanUser_Permission(t *testing.T) {
UserCTX,
&user.UpdateHumanUserRequest{
UserId: newUserID,
Username: gu.Ptr(gofakeit.Username()),
Username: gu.Ptr(integration.Username()),
},
},
wantErr: true,
@@ -1756,7 +1755,7 @@ func TestServer_ReactivateUser(t *testing.T) {
}
func TestServer_DeleteUser(t *testing.T) {
projectResp := Instance.CreateProject(CTX, t, "", integration.ProjectName(), false, false)
projectResp := Instance.CreateProject(CTX, t, Instance.DefaultOrg.GetId(), integration.ProjectName(), false, false)
type args struct {
req *user.DeleteUserRequest
@@ -1819,7 +1818,7 @@ func TestServer_DeleteUser(t *testing.T) {
prepare: func(_ *testing.T, request *user.DeleteUserRequest) context.Context {
resp := Instance.CreateHumanUser(CTX)
request.UserId = resp.GetUserId()
Instance.CreateProjectUserGrant(t, CTX, projectResp.GetId(), request.UserId)
Instance.CreateProjectUserGrant(t, CTX, Instance.DefaultOrg.GetId(), projectResp.GetId(), request.UserId)
Instance.CreateProjectMembership(t, CTX, projectResp.GetId(), request.UserId)
Instance.CreateOrgMembership(t, CTX, Instance.DefaultOrg.Id, request.UserId)
return CTX
@@ -1846,7 +1845,7 @@ func TestServer_DeleteUser(t *testing.T) {
FamilyName: "familyName",
},
Email: &user.SetHumanEmail{
Email: gofakeit.Email(),
Email: integration.Email(),
Verification: &user.SetHumanEmail_IsVerified{IsVerified: true},
},
},
@@ -1855,7 +1854,7 @@ func TestServer_DeleteUser(t *testing.T) {
require.NoError(t, err)
request.UserId = removeUser.Id
Instance.RegisterUserPasskey(CTX, removeUser.Id)
_, token, _, _ := Instance.CreateVerifiedWebAuthNSession(t, LoginCTX, removeUser.Id)
token := createVerifiedWebAuthNSession(LoginCTX, t, removeUser.Id)
return integration.WithAuthorizationToken(UserCTX, token)
},
},
@@ -1884,7 +1883,7 @@ func TestServer_DeleteUser(t *testing.T) {
func TestServer_StartIdentityProviderIntent(t *testing.T) {
idpResp := Instance.AddGenericOAuthProvider(IamCTX, Instance.DefaultOrg.Id)
orgIdpResp := Instance.AddOrgGenericOAuthProvider(CTX, Instance.DefaultOrg.Id)
orgResp := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), gofakeit.Email())
orgResp := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), integration.Email())
notDefaultOrgIdpResp := Instance.AddOrgGenericOAuthProvider(IamCTX, orgResp.OrganizationId)
samlIdpID := Instance.AddSAMLProvider(IamCTX)
samlRedirectIdpID := Instance.AddSAMLRedirectProvider(IamCTX, "")
@@ -2180,10 +2179,22 @@ func TestServer_StartIdentityProviderIntent(t *testing.T) {
}
}
func createVerifiedWebAuthNSession(ctx context.Context, t *testing.T, userID string) string {
// check if user is already processed
retryDuration, tick := integration.WaitForAndTickWithMaxDuration(ctx, time.Minute)
require.EventuallyWithT(t, func(collect *assert.CollectT) {
_, err := Client.GetUserByID(ctx, &user.GetUserByIDRequest{UserId: userID})
require.NoError(collect, err)
}, retryDuration, tick)
_, token, _, _ := Instance.CreateVerifiedWebAuthNSession(t, ctx, userID)
return token
}
func TestServer_RetrieveIdentityProviderIntent(t *testing.T) {
oauthIdpID := Instance.AddGenericOAuthProvider(IamCTX, gofakeit.AppName()).GetId()
azureIdpID := Instance.AddAzureADProvider(IamCTX, gofakeit.AppName()).GetId()
oidcIdpID := Instance.AddGenericOIDCProvider(IamCTX, gofakeit.AppName()).GetId()
oauthIdpID := Instance.AddGenericOAuthProvider(IamCTX, integration.IDPName()).GetId()
azureIdpID := Instance.AddAzureADProvider(IamCTX, integration.IDPName()).GetId()
oidcIdpID := Instance.AddGenericOIDCProvider(IamCTX, integration.IDPName()).GetId()
samlIdpID := Instance.AddSAMLPostProvider(IamCTX)
ldapIdpID := Instance.AddLDAPProvider(IamCTX)
jwtIdPID := Instance.AddJWTProvider(IamCTX)
@@ -2857,7 +2868,7 @@ func TestServer_RetrieveIdentityProviderIntent(t *testing.T) {
func ctxFromNewUserWithRegisteredPasswordlessLegacy(t *testing.T) (context.Context, string, *auth.AddMyPasswordlessResponse) {
userID := Instance.CreateHumanUser(CTX).GetUserId()
Instance.RegisterUserPasskey(CTX, userID)
_, sessionToken, _, _ := Instance.CreateVerifiedWebAuthNSession(t, LoginCTX, userID)
sessionToken := createVerifiedWebAuthNSession(LoginCTX, t, userID)
ctx := integration.WithAuthorizationToken(CTX, sessionToken)
pkr, err := Instance.Client.Auth.AddMyPasswordless(ctx, &auth.AddMyPasswordlessRequest{})
@@ -3228,7 +3239,7 @@ func TestServer_ListAuthenticationFactors(t *testing.T) {
},
},
dep: func(args *user.ListAuthenticationFactorsRequest, want *user.ListAuthenticationFactorsResponse) {
userWithSMS := Instance.CreateHumanUserVerified(CTX, Instance.DefaultOrg.GetId(), gofakeit.Email(), gofakeit.Phone()).GetUserId()
userWithSMS := Instance.CreateHumanUserVerified(CTX, Instance.DefaultOrg.GetId(), integration.Email(), integration.Phone()).GetUserId()
Instance.RegisterUserOTPSMS(CTX, userWithSMS)
args.UserId = userWithSMS
@@ -3249,7 +3260,7 @@ func TestServer_ListAuthenticationFactors(t *testing.T) {
},
},
dep: func(args *user.ListAuthenticationFactorsRequest, want *user.ListAuthenticationFactorsResponse) {
userWithEmail := Instance.CreateHumanUserVerified(CTX, Instance.DefaultOrg.GetId(), gofakeit.Email(), gofakeit.Phone()).GetUserId()
userWithEmail := Instance.CreateHumanUserVerified(CTX, Instance.DefaultOrg.GetId(), integration.Email(), integration.Phone()).GetUserId()
Instance.RegisterUserOTPEmail(CTX, userWithEmail)
args.UserId = userWithEmail
@@ -3347,7 +3358,7 @@ func TestServer_ListAuthenticationFactors(t *testing.T) {
}
require.NoError(ttt, err)
assert.ElementsMatch(t, tt.want.GetResult(), got.GetResult())
assert.ElementsMatch(ttt, tt.want.GetResult(), got.GetResult())
}, retryDuration, tick, "timeout waiting for expected auth methods result")
})
}
@@ -4411,7 +4422,7 @@ func TestServer_CreateUser(t *testing.T) {
Username: &username,
UserType: &user.CreateUserRequest_Machine_{
Machine: &user.CreateUserRequest_Machine{
Name: gofakeit.Name(),
Name: integration.Username(),
},
},
},
@@ -4606,7 +4617,7 @@ func TestServer_CreateUser_And_Compare(t *testing.T) {
}
func TestServer_CreateUser_Permission(t *testing.T) {
newOrgOwnerEmail := gofakeit.Email()
newOrgOwnerEmail := integration.Email()
newOrg := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), newOrgOwnerEmail)
type args struct {
ctx context.Context
@@ -5041,7 +5052,7 @@ func TestServer_UpdateUserTypeHuman(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
now := time.Now()
runId := fmt.Sprint(now.UnixNano() + int64(i))
userId := Instance.CreateUserTypeHuman(CTX, gofakeit.Email()).GetId()
userId := Instance.CreateUserTypeHuman(CTX, integration.Email()).GetId()
test := tt.testCase(runId, userId)
got, err := Client.UpdateUser(test.args.ctx, test.args.req)
if test.wantErr {
@@ -5277,7 +5288,7 @@ func TestServer_UpdateUser_And_Compare(t *testing.T) {
}
func TestServer_UpdateUser_Permission(t *testing.T) {
newOrgOwnerEmail := gofakeit.Email()
newOrgOwnerEmail := integration.Email()
newOrg := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), newOrgOwnerEmail)
newHumanUserID := newOrg.CreatedAdmins[0].GetUserId()
machineUserResp, err := Instance.Client.UserV2.CreateUser(IamCTX, &user.CreateUserRequest{
@@ -5,7 +5,6 @@ package user_test
import (
"testing"
"github.com/brianvoe/gofakeit/v6"
"github.com/muhlemmer/gu"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -147,7 +146,7 @@ func TestServer_SetEmail(t *testing.T) {
func TestServer_ResendEmailCode(t *testing.T) {
userID := Instance.CreateHumanUser(CTX).GetUserId()
verifiedUserID := Instance.CreateHumanUserVerified(CTX, Instance.DefaultOrg.Id, gofakeit.Email(), gofakeit.Phone()).GetUserId()
verifiedUserID := Instance.CreateHumanUserVerified(CTX, Instance.DefaultOrg.Id, integration.Email(), integration.Phone()).GetUserId()
tests := []struct {
name string
@@ -6,7 +6,6 @@ import (
"context"
"testing"
"github.com/brianvoe/gofakeit/v6"
"github.com/muhlemmer/gu"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -125,7 +124,7 @@ func TestServer_SetPhone(t *testing.T) {
func TestServer_ResendPhoneCode(t *testing.T) {
userID := Instance.CreateHumanUser(CTX).GetUserId()
verifiedUserID := Instance.CreateHumanUserVerified(CTX, Instance.DefaultOrg.Id, gofakeit.Email(), gofakeit.Phone()).GetUserId()
verifiedUserID := Instance.CreateHumanUserVerified(CTX, Instance.DefaultOrg.Id, integration.Email(), integration.Phone()).GetUserId()
tests := []struct {
name string
@@ -5,12 +5,10 @@ package user_test
import (
"context"
"errors"
"fmt"
"slices"
"testing"
"time"
"github.com/brianvoe/gofakeit/v6"
"github.com/muhlemmer/gu"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -82,7 +80,7 @@ func setPermissionCheckV2Flag(t *testing.T, setFlag bool) {
}
func TestServer_GetUserByID(t *testing.T) {
orgResp := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), gofakeit.Email())
orgResp := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), integration.Email())
type args struct {
ctx context.Context
req *user_v2beta.GetUserByIDRequest
@@ -245,7 +243,7 @@ func TestServer_GetUserByID(t *testing.T) {
func TestServer_GetUserByID_Permission(t *testing.T) {
timeNow := time.Now().UTC()
newOrgOwnerEmail := gofakeit.Email()
newOrgOwnerEmail := integration.Email()
newOrg := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), newOrgOwnerEmail)
newUserID := newOrg.CreatedAdmins[0].GetUserId()
type args struct {
@@ -422,7 +420,7 @@ func createUsers(ctx context.Context, orgID string, count int, passwordChangeReq
func createUser(ctx context.Context, orgID string, passwordChangeRequired bool) userAttr {
username := integration.Email()
// used as default country prefix
phone := "+41" + gofakeit.Phone()
phone := integration.Phone()
resp := Instance.CreateHumanUserVerified(ctx, orgID, username, phone)
info := userAttr{resp.GetUserId(), username, phone, nil, resp.GetDetails()}
if passwordChangeRequired {
@@ -438,7 +436,7 @@ func TestServer_ListUsers(t *testing.T) {
require.NoError(t, err)
})
orgResp := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), gofakeit.Email())
orgResp := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), integration.Email())
type args struct {
ctx context.Context
req *user_v2beta.ListUsersRequest
@@ -979,7 +977,7 @@ func TestServer_ListUsers(t *testing.T) {
IamCTX,
&user_v2beta.ListUsersRequest{},
func(ctx context.Context, request *user_v2beta.ListUsersRequest) userAttrs {
orgResp := Instance.CreateOrganization(ctx, fmt.Sprintf("ListUsersResourceowner-%s", gofakeit.AppName()), gofakeit.Email())
orgResp := Instance.CreateOrganization(ctx, integration.OrganizationName(), integration.Email())
infos := createUsers(ctx, orgResp.OrganizationId, 3, false)
request.Queries = []*user_v2beta.SearchQuery{}
@@ -1065,7 +1063,7 @@ func TestServer_ListUsers(t *testing.T) {
IamCTX,
&user_v2beta.ListUsersRequest{},
func(ctx context.Context, request *user_v2beta.ListUsersRequest) userAttrs {
orgRespForOrgTests := Instance.CreateOrganization(IamCTX, fmt.Sprintf("GetUserByIDOrg-%s", gofakeit.AppName()), gofakeit.Email())
orgRespForOrgTests := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), integration.Email())
info := createUser(ctx, orgRespForOrgTests.OrganizationId, false)
request.Queries = []*user_v2beta.SearchQuery{}
request.Queries = append(request.Queries, OrganizationIdQuery(orgRespForOrgTests.OrganizationId))
@@ -1111,8 +1109,8 @@ func TestServer_ListUsers(t *testing.T) {
IamCTX,
&user_v2beta.ListUsersRequest{},
func(ctx context.Context, request *user_v2beta.ListUsersRequest) userAttrs {
orgRespForOrgTests := Instance.CreateOrganization(IamCTX, fmt.Sprintf("GetUserByIDOrg-%s", gofakeit.AppName()), gofakeit.Email())
orgRespForOrgTests2 := Instance.CreateOrganization(IamCTX, fmt.Sprintf("GetUserByIDOrg-%s", gofakeit.AppName()), gofakeit.Email())
orgRespForOrgTests := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), integration.Email())
orgRespForOrgTests2 := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), integration.Email())
// info := createUser(ctx, orgRespForOrgTests.OrganizationId, false)
createUser(ctx, orgRespForOrgTests.OrganizationId, false)
request.Queries = []*user_v2beta.SearchQuery{}
@@ -10,7 +10,6 @@ import (
"testing"
"time"
"github.com/brianvoe/gofakeit/v6"
"github.com/muhlemmer/gu"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -641,7 +640,7 @@ func TestServer_AddHumanUser(t *testing.T) {
}
func TestServer_AddHumanUser_Permission(t *testing.T) {
newOrg := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), gofakeit.Email())
newOrg := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), integration.Email())
type args struct {
ctx context.Context
req *user.AddHumanUserRequest
@@ -868,7 +867,7 @@ func TestServer_UpdateHumanUser(t *testing.T) {
args: args{
CTX,
&user.UpdateHumanUserRequest{
Username: gu.Ptr(gofakeit.Username()),
Username: gu.Ptr(integration.Username()),
},
},
want: &user.UpdateHumanUserResponse{
@@ -1194,7 +1193,7 @@ func TestServer_UpdateHumanUser(t *testing.T) {
}
func TestServer_UpdateHumanUser_Permission(t *testing.T) {
newOrg := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), gofakeit.Email())
newOrg := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), integration.Email())
newUserID := newOrg.CreatedAdmins[0].GetUserId()
type args struct {
ctx context.Context
@@ -1212,7 +1211,7 @@ func TestServer_UpdateHumanUser_Permission(t *testing.T) {
SystemCTX,
&user.UpdateHumanUserRequest{
UserId: newUserID,
Username: gu.Ptr(gofakeit.Username()),
Username: gu.Ptr(integration.Username()),
},
},
want: &user.UpdateHumanUserResponse{
@@ -1228,7 +1227,7 @@ func TestServer_UpdateHumanUser_Permission(t *testing.T) {
IamCTX,
&user.UpdateHumanUserRequest{
UserId: newUserID,
Username: gu.Ptr(gofakeit.Username()),
Username: gu.Ptr(integration.Username()),
},
},
want: &user.UpdateHumanUserResponse{
@@ -1244,7 +1243,7 @@ func TestServer_UpdateHumanUser_Permission(t *testing.T) {
CTX,
&user.UpdateHumanUserRequest{
UserId: newUserID,
Username: gu.Ptr(gofakeit.Username()),
Username: gu.Ptr(integration.Username()),
},
},
wantErr: true,
@@ -1255,7 +1254,7 @@ func TestServer_UpdateHumanUser_Permission(t *testing.T) {
UserCTX,
&user.UpdateHumanUserRequest{
UserId: newUserID,
Username: gu.Ptr(gofakeit.Username()),
Username: gu.Ptr(integration.Username()),
},
},
wantErr: true,
@@ -1708,7 +1707,7 @@ func TestServer_ReactivateUser(t *testing.T) {
}
func TestServer_DeleteUser(t *testing.T) {
projectResp := Instance.CreateProject(CTX, t, "", gofakeit.AppName(), false, false)
projectResp := Instance.CreateProject(CTX, t, Instance.DefaultOrg.GetId(), integration.ProjectName(), false, false)
type args struct {
ctx context.Context
req *user.DeleteUserRequest
@@ -1773,7 +1772,7 @@ func TestServer_DeleteUser(t *testing.T) {
prepare: func(request *user.DeleteUserRequest) {
resp := Instance.CreateHumanUser(CTX)
request.UserId = resp.GetUserId()
Instance.CreateProjectUserGrant(t, CTX, projectResp.GetId(), request.UserId)
Instance.CreateProjectUserGrant(t, CTX, Instance.DefaultOrg.GetId(), projectResp.GetId(), request.UserId)
Instance.CreateProjectMembership(t, CTX, projectResp.GetId(), request.UserId)
Instance.CreateOrgMembership(t, CTX, Instance.DefaultOrg.Id, request.UserId)
},
@@ -1885,7 +1884,7 @@ func TestServer_AddIDPLink(t *testing.T) {
func TestServer_StartIdentityProviderIntent(t *testing.T) {
idpResp := Instance.AddGenericOAuthProvider(IamCTX, Instance.DefaultOrg.Id)
orgIdpID := Instance.AddOrgGenericOAuthProvider(CTX, Instance.DefaultOrg.Id)
orgResp := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), gofakeit.Email())
orgResp := Instance.CreateOrganization(IamCTX, integration.OrganizationName(), integration.Email())
notDefaultOrgIdpID := Instance.AddOrgGenericOAuthProvider(IamCTX, orgResp.OrganizationId)
samlIdpID := Instance.AddSAMLProvider(IamCTX)
samlRedirectIdpID := Instance.AddSAMLRedirectProvider(IamCTX, "")
@@ -2157,8 +2156,8 @@ func TestServer_StartIdentityProviderIntent(t *testing.T) {
}
func TestServer_RetrieveIdentityProviderIntent(t *testing.T) {
oauthIdpID := Instance.AddGenericOAuthProvider(IamCTX, gofakeit.AppName()).GetId()
oidcIdpID := Instance.AddGenericOIDCProvider(IamCTX, gofakeit.AppName()).GetId()
oauthIdpID := Instance.AddGenericOAuthProvider(IamCTX, integration.IDPName()).GetId()
oidcIdpID := Instance.AddGenericOIDCProvider(IamCTX, integration.IDPName()).GetId()
samlIdpID := Instance.AddSAMLPostProvider(IamCTX)
ldapIdpID := Instance.AddLDAPProvider(IamCTX)
authURL, err := url.Parse(Instance.CreateIntent(CTX, oauthIdpID).GetAuthUrl())