@@ -8,12 +8,12 @@ import (
88 "fmt"
99 "testing"
1010
11+ "github.com/hashicorp/go-azure-helpers/lang/pointer"
1112 "github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-05-01/privateendpoints"
1213 "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance"
1314 "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check"
1415 "github.com/hashicorp/terraform-provider-azurerm/internal/clients"
1516 "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
16- "github.com/hashicorp/terraform-provider-azurerm/utils"
1717)
1818
1919type PrivateEndpointResource struct {}
@@ -69,18 +69,11 @@ func TestAccPrivateEndpoint_updateTag(t *testing.T) {
6969 })
7070}
7171
72- func TestAccPrivateEndpoint_updateNicName (t * testing.T ) {
72+ func TestAccPrivateEndpoint_withCustomNicName (t * testing.T ) {
7373 data := acceptance .BuildTestData (t , "azurerm_private_endpoint" , "test" )
7474 r := PrivateEndpointResource {}
7575
7676 data .ResourceTest (t , r , []acceptance.TestStep {
77- {
78- Config : r .basic (data ),
79- Check : acceptance .ComposeTestCheckFunc (
80- check .That (data .ResourceName ).ExistsInAzure (r ),
81- ),
82- },
83- data .ImportStep (),
8477 {
8578 Config : r .withCustomNicName (data ),
8679 Check : acceptance .ComposeTestCheckFunc (
@@ -89,13 +82,6 @@ func TestAccPrivateEndpoint_updateNicName(t *testing.T) {
8982 ),
9083 },
9184 data .ImportStep (),
92- {
93- Config : r .basic (data ),
94- Check : acceptance .ComposeTestCheckFunc (
95- check .That (data .ResourceName ).ExistsInAzure (r ),
96- ),
97- },
98- data .ImportStep (),
9985 })
10086}
10187
@@ -308,7 +294,7 @@ func (t PrivateEndpointResource) Exists(ctx context.Context, clients *clients.Cl
308294 return nil , fmt .Errorf ("reading Private Endpoint (%s): %+v" , id .String (), err )
309295 }
310296
311- return utils . Bool (resp .Model != nil ), nil
297+ return pointer . To (resp .Model != nil ), nil
312298}
313299
314300func TestAccPrivateEndpoint_multipleInstances (t * testing.T ) {
@@ -771,7 +757,7 @@ resource "azurerm_private_dns_zone" "sales" {
771757}
772758
773759resource "azurerm_private_endpoint" "test" {
774- name = "acceptance. privatelink. %d"
760+ name = "acctest- privatelink- %d"
775761 location = azurerm_resource_group.test.location
776762 resource_group_name = azurerm_resource_group.test.name
777763 subnet_id = azurerm_subnet.endpoint.id
0 commit comments