Skip to content

Commit

Permalink
bugfix: tests for serviceprincipal owner removal
Browse files Browse the repository at this point in the history
  • Loading branch information
manicminer committed Mar 21, 2023
1 parent cb38817 commit 6966539
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 6966539

Please sign in to comment.