From 397e69ce750cda3df404757a768a1d3b37bd4edf Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Sat, 23 Mar 2024 07:32:19 +0100 Subject: [PATCH] mig.ProjectIDGlobal --- ...ource_alert_configuration_migration_test.go | 11 +++++------ .../resource_database_user_migration_test.go | 18 +++++++++--------- ...esource_network_container_migration_test.go | 6 +++--- ...federation_online_archive_migration_test.go | 2 +- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/internal/service/alertconfiguration/resource_alert_configuration_migration_test.go b/internal/service/alertconfiguration/resource_alert_configuration_migration_test.go index 150d49bee5..035f5e2139 100644 --- a/internal/service/alertconfiguration/resource_alert_configuration_migration_test.go +++ b/internal/service/alertconfiguration/resource_alert_configuration_migration_test.go @@ -4,13 +4,12 @@ import ( "testing" "github.com/hashicorp/terraform-plugin-testing/helper/resource" - "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/mig" ) func TestMigConfigRSAlertConfiguration_withNotificationsMetricThreshold(t *testing.T) { var ( - projectID = acc.ProjectIDExecution(t) + projectID = mig.ProjectIDGlobal(t) config = configBasicRS(projectID, true) ) @@ -34,7 +33,7 @@ func TestMigConfigRSAlertConfiguration_withNotificationsMetricThreshold(t *testi func TestMigConfigRSAlertConfiguration_withThreshold(t *testing.T) { var ( - projectID = acc.ProjectIDExecution(t) + projectID = mig.ProjectIDGlobal(t) config = configWithThresholdUpdated(projectID, true, 1) ) @@ -60,7 +59,7 @@ func TestMigConfigRSAlertConfiguration_withThreshold(t *testing.T) { func TestMigConfigRSAlertConfiguration_withEmptyOptionalBlocks(t *testing.T) { var ( - projectID = acc.ProjectIDExecution(t) + projectID = mig.ProjectIDGlobal(t) config = configWithEmptyOptionalBlocks(projectID) ) @@ -87,7 +86,7 @@ func TestMigConfigRSAlertConfiguration_withEmptyOptionalBlocks(t *testing.T) { func TestMigConfigRSAlertConfiguration_withMultipleMatchers(t *testing.T) { var ( - projectID = acc.ProjectIDExecution(t) + projectID = mig.ProjectIDGlobal(t) config = configWithMatchers(projectID, true, false, true, map[string]interface{}{ "fieldName": "TYPE_NAME", @@ -121,7 +120,7 @@ func TestMigConfigRSAlertConfiguration_withMultipleMatchers(t *testing.T) { func TestMigConfigRSAlertConfiguration_withEmptyOptionalAttributes(t *testing.T) { var ( - projectID = acc.ProjectIDExecution(t) + projectID = mig.ProjectIDGlobal(t) config = configWithEmptyOptionalAttributes(projectID) ) diff --git a/internal/service/databaseuser/resource_database_user_migration_test.go b/internal/service/databaseuser/resource_database_user_migration_test.go index 3f0519e4e2..b7f2c24a7d 100644 --- a/internal/service/databaseuser/resource_database_user_migration_test.go +++ b/internal/service/databaseuser/resource_database_user_migration_test.go @@ -13,7 +13,7 @@ import ( func TestMigConfigRSDatabaseUser_Basic(t *testing.T) { var ( - projectID = acc.ProjectIDExecution(t) + projectID = mig.ProjectIDGlobal(t) username = acc.RandomName() config = acc.ConfigDatabaseUserBasic(projectID, username, "atlasAdmin", "First Key", "First value") ) @@ -40,7 +40,7 @@ func TestMigConfigRSDatabaseUser_Basic(t *testing.T) { func TestMigConfigRSDatabaseUser_withX509TypeCustomer(t *testing.T) { var ( - projectID = acc.ProjectIDExecution(t) + projectID = mig.ProjectIDGlobal(t) username = acc.RandomLDAPName() x509Type = "CUSTOMER" config = acc.ConfigDatabaseUserWithX509Type(projectID, username, x509Type, "atlasAdmin", "First Key", "First value") @@ -66,7 +66,7 @@ func TestMigConfigRSDatabaseUser_withX509TypeCustomer(t *testing.T) { } func TestMigConfigRSDatabaseUser_withAWSIAMType(t *testing.T) { var ( - projectID = acc.ProjectIDExecution(t) + projectID = mig.ProjectIDGlobal(t) username = acc.RandomIAMUser() config = acc.ConfigDatabaseUserWithAWSIAMType(projectID, username, "atlasAdmin", "First Key", "First value") ) @@ -92,7 +92,7 @@ func TestMigConfigRSDatabaseUser_withAWSIAMType(t *testing.T) { func TestMigConfigRSDatabaseUser_withLabels(t *testing.T) { var ( - projectID = acc.ProjectIDExecution(t) + projectID = mig.ProjectIDGlobal(t) username = acc.RandomName() config = acc.ConfigDatabaseUserWithLabels(projectID, username, "atlasAdmin", []admin.ComponentLabel{ @@ -131,7 +131,7 @@ func TestMigConfigRSDatabaseUser_withLabels(t *testing.T) { func TestMigConfigRSDatabaseUser_withEmptyLabels(t *testing.T) { var ( - projectID = acc.ProjectIDExecution(t) + projectID = mig.ProjectIDGlobal(t) username = acc.RandomName() config = acc.ConfigDatabaseUserWithLabels(projectID, username, "atlasAdmin", nil) ) @@ -157,7 +157,7 @@ func TestMigConfigRSDatabaseUser_withEmptyLabels(t *testing.T) { func TestMigConfigRSDatabaseUser_withRoles(t *testing.T) { var ( - projectID = acc.ProjectIDExecution(t) + projectID = mig.ProjectIDGlobal(t) username = acc.RandomName() password = acc.RandomName() config = acc.ConfigDatabaseUserWithRoles(projectID, username, password, @@ -197,7 +197,7 @@ func TestMigConfigRSDatabaseUser_withRoles(t *testing.T) { func TestMigConfigRSDatabaseUser_withScopes(t *testing.T) { var ( - projectID = acc.ProjectIDExecution(t) + projectID = mig.ProjectIDGlobal(t) userScopeName = acc.RandomName() username = acc.RandomName() password = acc.RandomName() @@ -234,7 +234,7 @@ func TestMigConfigRSDatabaseUser_withScopes(t *testing.T) { func TestMigConfigRSDatabaseUser_withEmptyScopes(t *testing.T) { var ( - projectID = acc.ProjectIDExecution(t) + projectID = mig.ProjectIDGlobal(t) username = acc.RandomName() password = acc.RandomName() config = acc.ConfigDatabaseUserWithScopes(projectID, username, password, "atlasAdmin", nil) @@ -261,7 +261,7 @@ func TestMigConfigRSDatabaseUser_withEmptyScopes(t *testing.T) { func TestMigConfigRSDatabaseUser_withLDAPAuthType(t *testing.T) { var ( - projectID = acc.ProjectIDExecution(t) + projectID = mig.ProjectIDGlobal(t) username = acc.RandomLDAPName() config = acc.ConfigDatabaseUserWithLDAPAuthType(projectID, username, "atlasAdmin", "First Key", "First value") ) diff --git a/internal/service/networkcontainer/resource_network_container_migration_test.go b/internal/service/networkcontainer/resource_network_container_migration_test.go index fc02c83952..b7457f913b 100644 --- a/internal/service/networkcontainer/resource_network_container_migration_test.go +++ b/internal/service/networkcontainer/resource_network_container_migration_test.go @@ -13,7 +13,7 @@ import ( func TestMigNetworkContainer_basicAWS(t *testing.T) { var ( - projectID = acc.ProjectIDExecution(t) + projectID = acc.ProjectIDExecution(t) // No mig.ProjectIDGlobal because network container randInt = acctest.RandIntRange(0, 255) cidrBlock = fmt.Sprintf("10.8.%d.0/24", randInt) config = configBasic(projectID, cidrBlock, constant.AWS, "US_EAST_1") @@ -35,7 +35,7 @@ func TestMigNetworkContainer_basicAWS(t *testing.T) { func TestMigNetworkContainer_basicAzure(t *testing.T) { var ( - projectID = acc.ProjectIDExecution(t) + projectID = acc.ProjectIDExecution(t) // No mig.ProjectIDGlobal because network container randInt = acctest.RandIntRange(0, 255) cidrBlock = fmt.Sprintf("10.8.%d.0/24", randInt) config = configBasic(projectID, cidrBlock, constant.AZURE, "US_EAST_2") @@ -57,7 +57,7 @@ func TestMigNetworkContainer_basicAzure(t *testing.T) { func TestMigNetworkContainer_basicGCP(t *testing.T) { var ( - projectID = acc.ProjectIDExecution(t) + projectID = acc.ProjectIDExecution(t) // No mig.ProjectIDGlobal because network container randInt = acctest.RandIntRange(0, 255) gcpCidrBlock = fmt.Sprintf("10.%d.0.0/18", randInt) config = configBasic(projectID, gcpCidrBlock, constant.GCP, "") diff --git a/internal/service/privatelinkendpointservicedatafederationonlinearchive/resource_privatelink_endpoint_service_data_federation_online_archive_migration_test.go b/internal/service/privatelinkendpointservicedatafederationonlinearchive/resource_privatelink_endpoint_service_data_federation_online_archive_migration_test.go index 98484a9a0c..fa29e4b076 100644 --- a/internal/service/privatelinkendpointservicedatafederationonlinearchive/resource_privatelink_endpoint_service_data_federation_online_archive_migration_test.go +++ b/internal/service/privatelinkendpointservicedatafederationonlinearchive/resource_privatelink_endpoint_service_data_federation_online_archive_migration_test.go @@ -11,7 +11,7 @@ import ( func TestMigNetworkPrivatelinkEndpointServiceDataFederationOnlineArchive_basic(t *testing.T) { var ( - projectID = acc.ProjectIDExecution(t) + projectID = acc.ProjectIDExecution(t) // No mig.ProjectIDGlobal because private link endpoint endpointID = os.Getenv("MONGODB_ATLAS_PRIVATE_ENDPOINT_ID") config = resourceConfigBasic(projectID, endpointID, comment) )