From 69665395575e9d111f0ffb8b633ba7a2765fa633 Mon Sep 17 00:00:00 2001 From: Tom Bamford Date: Tue, 21 Mar 2023 11:13:35 +0000 Subject: [PATCH] bugfix: tests for serviceprincipal owner removal --- .../service_principal_resource_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/services/serviceprincipals/service_principal_resource_test.go b/internal/services/serviceprincipals/service_principal_resource_test.go index a852da665e..49dcf6adae 100644 --- a/internal/services/serviceprincipals/service_principal_resource_test.go +++ b/internal/services/serviceprincipals/service_principal_resource_test.go @@ -235,7 +235,7 @@ func TestAccServicePrincipal_owners(t *testing.T) { }, data.ImportStep(), { - Config: r.basic(data), + Config: r.noOwners(data), Check: resource.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), check.That(data.ResourceName).Key("owners.#").HasValue("0"), @@ -534,19 +534,19 @@ resource "azuread_user" "testC" { `, data.RandomInteger, data.RandomPassword) } -func (ServicePrincipalResource) noOwners(data acceptance.TestData) string { +func (r ServicePrincipalResource) noOwners(data acceptance.TestData) string { return fmt.Sprintf(` -provider "azuread" {} +%[1]s resource "azuread_application" "test" { - display_name = "acctestServicePrincipal-%[1]d" + display_name = "acctestServicePrincipal-%[2]d" } resource "azuread_service_principal" "test" { application_id = azuread_application.test.application_id owners = [] } -`, data.RandomInteger) +`, r.templateThreeUsers(data), data.RandomInteger) } func (r ServicePrincipalResource) singleOwner(data acceptance.TestData) string {