From 95cfcc1e2e9455dbdd6c8cae368a89db337128d8 Mon Sep 17 00:00:00 2001 From: magodo Date: Mon, 23 Dec 2024 17:23:54 +1100 Subject: [PATCH] Test: Add `features {}` to the provider block --- .../role_management_policy_data_source_test.go | 16 ++++++++++++---- .../role_management_policy_resource_test.go | 16 ++++++++++++---- .../storage/storage_blob_resource_test.go | 17 +++++++++++++---- 3 files changed, 37 insertions(+), 12 deletions(-) diff --git a/internal/services/authorization/role_management_policy_data_source_test.go b/internal/services/authorization/role_management_policy_data_source_test.go index 394780897d4b..d125a6a21f74 100644 --- a/internal/services/authorization/role_management_policy_data_source_test.go +++ b/internal/services/authorization/role_management_policy_data_source_test.go @@ -71,7 +71,9 @@ func TestAccRoleManagementPolicyDataSource_resource(t *testing.T) { func (RoleManagementPolicyDataSource) managementGroup(data acceptance.TestData) string { return fmt.Sprintf(` -provider "azurerm" {} +provider "azurerm" { + features {} +} data "azurerm_client_config" "current" { } @@ -94,7 +96,9 @@ data "azurerm_role_management_policy" "test" { func (RoleManagementPolicyDataSource) resourceGroup(data acceptance.TestData) string { return fmt.Sprintf(` -provider "azurerm" {} +provider "azurerm" { + features {} +} resource "azurerm_resource_group" "test" { name = "acctestRG-%[1]s" @@ -115,7 +119,9 @@ data "azurerm_role_management_policy" "test" { func (RoleManagementPolicyDataSource) subscription(data acceptance.TestData) string { return ` -provider "azurerm" {} +provider "azurerm" { + features {} +} data "azurerm_subscription" "test" {} @@ -133,7 +139,9 @@ data "azurerm_role_management_policy" "test" { func (RoleManagementPolicyDataSource) resource(data acceptance.TestData) string { return fmt.Sprintf(` -provider "azurerm" {} +provider "azurerm" { + features {} +} resource "azurerm_resource_group" "test" { name = "acctestRG-%[1]s" diff --git a/internal/services/authorization/role_management_policy_resource_test.go b/internal/services/authorization/role_management_policy_resource_test.go index e2b61de94acf..10188e1ed0ba 100644 --- a/internal/services/authorization/role_management_policy_resource_test.go +++ b/internal/services/authorization/role_management_policy_resource_test.go @@ -181,7 +181,9 @@ func (RoleManagementPolicyResource) Exists(ctx context.Context, clients *clients func (RoleManagementPolicyResource) managementGroup(data acceptance.TestData) string { return fmt.Sprintf(` -provider "azurerm" {} +provider "azurerm" { + features {} +} provider "azuread" {} @@ -245,7 +247,9 @@ resource "azurerm_role_management_policy" "test" { func (RoleManagementPolicyResource) resourceGroupTemplate(data acceptance.TestData) string { return fmt.Sprintf(` -provider "azurerm" {} +provider "azurerm" { + features {} +} resource "azurerm_resource_group" "test" { name = "acctestRG-%[1]s" @@ -345,7 +349,9 @@ resource "azurerm_role_management_policy" "test" { func (RoleManagementPolicyResource) subscriptionTemplate(data acceptance.TestData) string { return ` -provider "azurerm" {} +provider "azurerm" { + features {} +} data "azurerm_subscription" "test" {} @@ -484,7 +490,9 @@ resource "azurerm_role_management_policy" "test" { func (RoleManagementPolicyResource) resourceTemplate(data acceptance.TestData) string { return fmt.Sprintf(` -provider "azurerm" {} +provider "azurerm" { + features {} +} resource "azurerm_resource_group" "test" { name = "acctestRG-%[1]s" diff --git a/internal/services/storage/storage_blob_resource_test.go b/internal/services/storage/storage_blob_resource_test.go index 8bcbf129196b..9ddf77c4c33f 100644 --- a/internal/services/storage/storage_blob_resource_test.go +++ b/internal/services/storage/storage_blob_resource_test.go @@ -657,7 +657,9 @@ func (r StorageBlobResource) blobMatchesContent(kind blobs.BlobType, expectedCon func (r StorageBlobResource) appendEmpty(data acceptance.TestData) string { template := r.template(data, "private") return fmt.Sprintf(` -provider "azurerm" {} +provider "azurerm" { + features {} +} %s @@ -673,7 +675,9 @@ resource "azurerm_storage_blob" "test" { func (r StorageBlobResource) appendEmptyMetaData(data acceptance.TestData) string { template := r.template(data, "private") return fmt.Sprintf(` -provider "azurerm" {} +provider "azurerm" { + features {} +} %s @@ -693,7 +697,9 @@ resource "azurerm_storage_blob" "test" { func (r StorageBlobResource) blockEmpty(data acceptance.TestData) string { template := r.template(data, "private") return fmt.Sprintf(` -provider "azurerm" {} +provider "azurerm" { + features {} +} %s @@ -710,6 +716,7 @@ func (r StorageBlobResource) blockEmptyAzureADAuth(data acceptance.TestData) str template := r.template(data, "private") return fmt.Sprintf(` provider "azurerm" { + features {} storage_use_azuread = true } @@ -1407,7 +1414,9 @@ resource "azurerm_storage_container" "test" { func (r StorageBlobResource) archive(data acceptance.TestData) string { template := r.template(data, "private") return fmt.Sprintf(` -provider "azurerm" {} +provider "azurerm" { + features {} +} %s