Skip to content

Commit

Permalink
azuread_directory_role_eligibility_schedule_request: remove test with…
Browse files Browse the repository at this point in the history
… custom role, the API does not support it (neither v1.0 nor beta)
  • Loading branch information
manicminer committed Sep 25, 2024
1 parent f929c90 commit 3deb4a5
Showing 1 changed file with 0 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,6 @@ func TestAccRoleEligibilityScheduleRequest_builtin(t *testing.T) {
})
}

func TestAccRoleEligibilityScheduleRequest_custom(t *testing.T) {
data := acceptance.BuildTestData(t, "azuread_directory_role_eligibility_schedule_request", "test")
r := RoleEligibilityScheduleRequestResource{}

data.ResourceTestIgnoreDangling(t, r, []acceptance.TestStep{
{
Config: r.custom(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
})
}

func (r RoleEligibilityScheduleRequestResource) Exists(ctx context.Context, clients *clients.Client, state *terraform.InstanceState) (*bool, error) {
client := clients.DirectoryRoles.DirectoryRoleEligibilityScheduleRequestClient
id := stable.NewRoleManagementDirectoryRoleEligibilityScheduleRequestID(state.ID)
Expand Down Expand Up @@ -89,36 +75,3 @@ resource "azuread_directory_role_eligibility_schedule_request" "test" {
}
`, data.RandomInteger, data.RandomPassword)
}

func (r RoleEligibilityScheduleRequestResource) custom(data acceptance.TestData) string {
return fmt.Sprintf(`
provider "azuread" {}
data "azuread_domains" "test" {
only_initial = true
}
resource "azuread_user" "test" {
user_principal_name = "acctestManager.%[1]d@${data.azuread_domains.test.domains.0.domain_name}"
display_name = "acctestManager-%[1]d"
password = "%[2]s"
}
resource "azuread_custom_directory_role" "test" {
display_name = "acctestCustomRole-%[1]d"
enabled = true
version = "1.0"
permissions {
allowed_resource_actions = ["microsoft.directory/applications/standard/read"]
}
}
resource "azuread_directory_role_eligibility_schedule_request" "test" {
role_definition_id = azuread_custom_directory_role.test.object_id
principal_id = azuread_user.test.object_id
directory_scope_id = "/"
justification = "abc"
}
`, data.RandomInteger, data.RandomPassword)
}

0 comments on commit 3deb4a5

Please sign in to comment.