diff --git a/internal/acceptance/testcase.go b/internal/acceptance/testcase.go index 5e8d8c86dd6d..06d6154f8af7 100644 --- a/internal/acceptance/testcase.go +++ b/internal/acceptance/testcase.go @@ -13,10 +13,11 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/provider" ) -// lintignore:AT001 func (td TestData) DataSourceTest(t *testing.T, steps []TestStep) { // DataSources don't need a check destroy - however since this is a wrapper function // and not matching the ignore pattern `XXX_data_source_test.go`, this needs to be explicitly opted out + + // lintignore:AT001 testCase := resource.TestCase{ PreCheck: func() { PreCheck(t) }, Steps: steps, @@ -24,10 +25,11 @@ func (td TestData) DataSourceTest(t *testing.T, steps []TestStep) { td.runAcceptanceTest(t, testCase) } -// lintignore:AT001 func (td TestData) DataSourceTestInSequence(t *testing.T, steps []TestStep) { // DataSources don't need a check destroy - however since this is a wrapper function // and not matching the ignore pattern `XXX_data_source_test.go`, this needs to be explicitly opted out + + // lintignore:AT001 testCase := resource.TestCase{ PreCheck: func() { PreCheck(t) }, Steps: steps, @@ -36,7 +38,6 @@ func (td TestData) DataSourceTestInSequence(t *testing.T, steps []TestStep) { td.runAcceptanceSequentialTest(t, testCase) } -// lintignore:AT001 func (td TestData) ResourceTest(t *testing.T, testResource types.TestResource, steps []TestStep) { testCase := resource.TestCase{ PreCheck: func() { PreCheck(t) }, @@ -54,8 +55,8 @@ func (td TestData) ResourceTest(t *testing.T, testResource types.TestResource, s // ResourceTestIgnoreCheckDestroyed skips the check to confirm the resource test has been destroyed. // This is done because certain resources can't actually be deleted. -// lintignore:AT001 func (td TestData) ResourceTestSkipCheckDestroyed(t *testing.T, steps []TestStep) { + // lintignore:AT001 testCase := resource.TestCase{ PreCheck: func() { PreCheck(t) }, Steps: steps, @@ -63,8 +64,8 @@ func (td TestData) ResourceTestSkipCheckDestroyed(t *testing.T, steps []TestStep td.runAcceptanceTest(t, testCase) } -// lintignore:AT001 func (td TestData) ResourceSequentialTestSkipCheckDestroyed(t *testing.T, steps []TestStep) { + // lintignore:AT001 testCase := resource.TestCase{ PreCheck: func() { PreCheck(t) }, Steps: steps, diff --git a/internal/services/datalake/data_lake_analytics_account_resource.go b/internal/services/datalake/data_lake_analytics_account_resource.go index 63060a5e79e8..702781a49e37 100644 --- a/internal/services/datalake/data_lake_analytics_account_resource.go +++ b/internal/services/datalake/data_lake_analytics_account_resource.go @@ -191,7 +191,11 @@ func resourceArmDateLakeAnalyticsAccountRead(d *pluginsdk.ResourceData, meta int } if properties := model.Properties; properties != nil { - d.Set("tier", properties.CurrentTier) + tier := "" + if properties.CurrentTier != nil { + tier = string(*properties.CurrentTier) + } + d.Set("tier", tier) d.Set("default_store_account_name", properties.DefaultDataLakeStoreAccount) } diff --git a/internal/services/datalake/data_lake_store_data_source.go b/internal/services/datalake/data_lake_store_data_source.go index ed9f11df2d2c..a4702f5c04cf 100644 --- a/internal/services/datalake/data_lake_store_data_source.go +++ b/internal/services/datalake/data_lake_store_data_source.go @@ -88,11 +88,29 @@ func dataSourceArmDateLakeStoreAccountRead(d *pluginsdk.ResourceData, meta inter } if properties := model.Properties; properties != nil { - d.Set("tier", properties.CurrentTier) + tier := "" + if properties.CurrentTier != nil { + tier = string(*properties.CurrentTier) + } + d.Set("tier", tier) + + encryptionState := "" + if properties.EncryptionState != nil { + encryptionState = string(*properties.EncryptionState) + } + d.Set("encryption_state", encryptionState) - d.Set("encryption_state", properties.EncryptionState) - d.Set("firewall_allow_azure_ips", properties.FirewallAllowAzureIps) - d.Set("firewall_state", properties.FirewallState) + firewallState := "" + if properties.FirewallState != nil { + firewallState = string(*properties.FirewallState) + } + d.Set("firewall_state", firewallState) + + firewallAllowAzureIps := "" + if properties.FirewallAllowAzureIps != nil { + firewallAllowAzureIps = string(*properties.FirewallAllowAzureIps) + } + d.Set("firewall_allow_azure_ips", firewallAllowAzureIps) if config := properties.EncryptionConfig; config != nil { d.Set("encryption_type", string(config.Type))