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

(cherry picked from commit 492f1826ee)
This commit is contained in:
Stefan Benz
2025-09-10 08:00:31 +02:00
committed by Livio Spring
parent 78ded99017
commit b892fc9b28
70 changed files with 1404 additions and 1293 deletions

View File

@@ -5,12 +5,12 @@ import (
"net/url"
"testing"
"github.com/brianvoe/gofakeit/v6"
"github.com/muhlemmer/gu"
"github.com/stretchr/testify/assert"
"github.com/zitadel/zitadel/internal/domain"
"github.com/zitadel/zitadel/internal/eventstore/v1/models"
"github.com/zitadel/zitadel/internal/integration"
"github.com/zitadel/zitadel/internal/query"
app "github.com/zitadel/zitadel/pkg/grpc/app/v2beta"
)
@@ -38,7 +38,7 @@ func samlMetadataGen(entityID string) []byte {
func TestCreateSAMLAppRequestToDomain(t *testing.T) {
t.Parallel()
genMetaForValidRequest := samlMetadataGen(gofakeit.URL())
genMetaForValidRequest := samlMetadataGen(integration.URL())
tt := []struct {
testName string
@@ -55,7 +55,7 @@ func TestCreateSAMLAppRequestToDomain(t *testing.T) {
projectID: "proj-1",
req: &app.CreateSAMLApplicationRequest{
Metadata: &app.CreateSAMLApplicationRequest_MetadataXml{
MetadataXml: samlMetadataGen(gofakeit.URL()),
MetadataXml: samlMetadataGen(integration.URL()),
},
LoginVersion: &app.LoginVersion{
Version: &app.LoginVersion_LoginV2{
@@ -122,7 +122,7 @@ func TestCreateSAMLAppRequestToDomain(t *testing.T) {
func TestUpdateSAMLAppConfigRequestToDomain(t *testing.T) {
t.Parallel()
genMetaForValidRequest := samlMetadataGen(gofakeit.URL())
genMetaForValidRequest := samlMetadataGen(integration.URL())
tt := []struct {
testName string
@@ -139,7 +139,7 @@ func TestUpdateSAMLAppConfigRequestToDomain(t *testing.T) {
projectID: "proj-1",
req: &app.UpdateSAMLApplicationConfigurationRequest{
Metadata: &app.UpdateSAMLApplicationConfigurationRequest_MetadataXml{
MetadataXml: samlMetadataGen(gofakeit.URL()),
MetadataXml: samlMetadataGen(integration.URL()),
},
LoginVersion: &app.LoginVersion{
Version: &app.LoginVersion_LoginV2{
@@ -202,7 +202,7 @@ func TestUpdateSAMLAppConfigRequestToDomain(t *testing.T) {
func TestAppSAMLConfigToPb(t *testing.T) {
t.Parallel()
metadata := samlMetadataGen(gofakeit.URL())
metadata := samlMetadataGen(integration.URL())
tt := []struct {
name string