Skip to content

Commit

Permalink
Update acceptance test configs to use Terraform 0.12 expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
manicminer committed Jun 16, 2020
1 parent 9e2bc41 commit e93cd9e
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 63 deletions.
8 changes: 4 additions & 4 deletions azuread/data_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func testAccDataSourceAzureADGroup_name(id int) string {
%s
data "azuread_group" "test" {
name = "${azuread_group.test.name}"
name = azuread_group.test.name
}
`, testAccAzureADGroup_basic(id))
}
Expand All @@ -109,7 +109,7 @@ func testAccDataSourceAzureADGroup_objectId(id int) string {
%s
data "azuread_group" "test" {
object_id = "${azuread_group.test.object_id}"
object_id = azuread_group.test.object_id
}
`, testAccAzureADGroup_basic(id))
}
Expand All @@ -119,7 +119,7 @@ func testAccDataSourceAzureADGroup_members(id int, password string) string {
%s
data "azuread_group" "test" {
object_id = "${azuread_group.test.object_id}"
object_id = azuread_group.test.object_id
}
`, testAccAzureADGroupWithThreeMembers(id, password))
}
Expand All @@ -129,7 +129,7 @@ func testAccDataSourceAzureADGroup_owners(id int, password string) string {
%s
data "azuread_group" "test" {
object_id = "${azuread_group.test.object_id}"
object_id = azuread_group.test.object_id
}
`, testAccAzureADGroupWithThreeOwners(id, password))
}
4 changes: 2 additions & 2 deletions azuread/data_groups_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func testAccAzureADGroupsDataSource_byDisplayNames(id int) string {
%s
data "azuread_groups" "test" {
names = ["${azuread_group.testA.name}", "${azuread_group.testB.name}"]
names = [azuread_group.testA.name, azuread_group.testB.name]
}
`, testAccAzureADGroup_multiple(id))
}
Expand All @@ -94,7 +94,7 @@ func testAccAzureADGroupsDataSource_byObjectIds(id int) string {
%s
data "azuread_groups" "test" {
object_ids = ["${azuread_group.testA.object_id}", "${azuread_group.testB.object_id}"]
object_ids = [azuread_group.testA.object_id, azuread_group.testB.object_id]
}
`, testAccAzureADGroup_multiple(id))
}
Expand Down
6 changes: 3 additions & 3 deletions azuread/data_service_principal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func testAccAzureADServicePrincipalDataSource_byApplicationId(id string) string
%s
data "azuread_service_principal" "test" {
application_id = "${azuread_service_principal.test.application_id}"
application_id = azuread_service_principal.test.application_id
}
`, template)
}
Expand All @@ -94,7 +94,7 @@ func testAccAzureADServicePrincipalDataSource_byDisplayName(id string) string {
%s
data "azuread_service_principal" "test" {
display_name = "${azuread_service_principal.test.display_name}"
display_name = azuread_service_principal.test.display_name
}
`, template)
}
Expand All @@ -105,7 +105,7 @@ func testAccAzureADServicePrincipalDataSource_byObjectId(id string) string {
%s
data "azuread_service_principal" "test" {
object_id = "${azuread_service_principal.test.object_id}"
object_id = azuread_service_principal.test.object_id
}
`, template)
}
6 changes: 3 additions & 3 deletions azuread/data_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func testAccAzureADUserDataSource_byUserPrincipalName(id int, password string) s
%s
data "azuread_user" "test" {
user_principal_name = "${azuread_user.test.user_principal_name}"
user_principal_name = azuread_user.test.user_principal_name
}
`, testAccADUser_basic(id, password))
}
Expand All @@ -91,7 +91,7 @@ func testAccAzureADUserDataSource_byObjectId(id int, password string) string {
%s
data "azuread_user" "test" {
object_id = "${azuread_user.test.object_id}"
object_id = azuread_user.test.object_id
}
`, testAccADUser_basic(id, password))
}
Expand All @@ -101,7 +101,7 @@ func testAccAzureADUserDataSource_byMailNickname(id int, password string) string
%s
data "azuread_user" "test" {
mail_nickname = "${azuread_user.test.mail_nickname}"
mail_nickname = azuread_user.test.mail_nickname
}
`, testAccADUser_basic(id, password))
}
6 changes: 3 additions & 3 deletions azuread/data_users_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func testAccAzureADUsersDataSource_byUserPrincipalNames(id int, password string)
%s
data "azuread_users" "test" {
user_principal_names = ["${azuread_user.testA.user_principal_name}", "${azuread_user.testB.user_principal_name}"]
user_principal_names = [azuread_user.testA.user_principal_name, azuread_user.testB.user_principal_name]
}
`, testAccADUser_threeUsersABC(id, password))
}
Expand All @@ -105,7 +105,7 @@ func testAccAzureADUsersDataSource_byObjectIds(id int, password string) string {
%s
data "azuread_users" "test" {
object_ids = ["${azuread_user.testA.object_id}", "${azuread_user.testB.object_id}"]
object_ids = [azuread_user.testA.object_id, azuread_user.testB.object_id]
}
`, testAccADUser_threeUsersABC(id, password))
}
Expand All @@ -115,7 +115,7 @@ func testAccAzureADUsersDataSource_byMailNicknames(id int, password string) stri
%s
data "azuread_users" "test" {
mail_nicknames = ["${azuread_user.testA.mail_nickname}", "${azuread_user.testB.mail_nickname}"]
mail_nicknames = [azuread_user.testA.mail_nickname, azuread_user.testB.mail_nickname]
}
`, testAccADUser_threeUsersABC(id, password))
}
Expand Down
16 changes: 8 additions & 8 deletions azuread/resource_application_certificate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func testAccADObjectCertificateApplication_basic(ri int, keyType, endDate, value
%s
resource "azuread_application_certificate" "test" {
application_object_id = "${azuread_application.test.id}"
application_object_id = azuread_application.test.id
type = "%s"
end_date = "%s"
value = <<EOT
Expand All @@ -251,7 +251,7 @@ func testAccADApplicationCertificate_complete(ri int, keyId, keyType, startDate,
%s
resource "azuread_application_certificate" "test" {
application_object_id = "${azuread_application.test.id}"
application_object_id = azuread_application.test.id
key_id = "%s"
type = "%s"
start_date = "%s"
Expand All @@ -268,7 +268,7 @@ func testAccADApplicationCertificate_relativeEndDate(ri int, keyType, value stri
%s
resource "azuread_application_certificate" "test" {
application_object_id = "${azuread_application.test.id}"
application_object_id = azuread_application.test.id
end_date_relative = "4320h"
type = "%s"
value = <<EOT
Expand All @@ -284,11 +284,11 @@ func testAccADApplicationCertificate_requiresImport(ri int, keyType, endDate, va
%s
resource "azuread_application_certificate" "import" {
application_object_id = "${azuread_application_certificate.test.application_object_id}"
key_id = "${azuread_application_certificate.test.key_id}"
type = "${azuread_application_certificate.test.type}"
end_date = "${azuread_application_certificate.test.end_date}"
value = "${azuread_application_certificate.test.value}"
application_object_id = azuread_application_certificate.test.application_object_id
key_id = azuread_application_certificate.test.key_id
type = azuread_application_certificate.test.type
end_date = azuread_application_certificate.test.end_date
value = azuread_application_certificate.test.value
}
`, template)
}
18 changes: 9 additions & 9 deletions azuread/resource_application_password_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func testAccADObjectPasswordApplication_basic(applicationId, value string) strin
%s
resource "azuread_application_password" "test" {
application_object_id = "${azuread_application.test.id}"
application_object_id = azuread_application.test.id
value = "%s"
end_date = "2099-01-01T01:02:03Z"
}
Expand All @@ -280,7 +280,7 @@ func testAccADObjectPasswordApplication_basicOld(applicationId, value string) st
%s
resource "azuread_application_password" "test" {
application_id = "${azuread_application.test.id}"
application_id = azuread_application.test.id
value = "%s"
end_date = "2099-01-01T01:02:03Z"
}
Expand All @@ -293,10 +293,10 @@ func testAccADApplicationPassword_requiresImport(applicationId, value string) st
%s
resource "azuread_application_password" "import" {
application_object_id = "${azuread_application_password.test.application_object_id}"
key_id = "${azuread_application_password.test.key_id}"
value = "${azuread_application_password.test.value}"
end_date = "${azuread_application_password.test.end_date}"
application_object_id = azuread_application_password.test.application_object_id
key_id = azuread_application_password.test.key_id
value = azuread_application_password.test.value
end_date = azuread_application_password.test.end_date
}
`, template)
}
Expand All @@ -306,7 +306,7 @@ func testAccADApplicationPassword_customKeyId(applicationId, keyId, value string
%s
resource "azuread_application_password" "test" {
application_object_id = "${azuread_application.test.id}"
application_object_id = azuread_application.test.id
key_id = "%s"
value = "%s"
end_date = "2099-01-01T01:02:03Z"
Expand All @@ -319,7 +319,7 @@ func testAccADApplicationPassword_description(applicationId, value string) strin
%s
resource "azuread_application_password" "test" {
application_object_id = "${azuread_application.test.id}"
application_object_id = azuread_application.test.id
description = "terraform"
value = "%s"
end_date = "2099-01-01T01:02:03Z"
Expand All @@ -332,7 +332,7 @@ func testAccADApplicationPassword_relativeEndDate(applicationId, value string) s
%s
resource "azuread_application_password" "test" {
application_object_id = "${azuread_application.test.id}"
application_object_id = azuread_application.test.id
value = "%s"
end_date_relative = "8760h"
}
Expand Down
22 changes: 11 additions & 11 deletions azuread/resource_group_member_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ resource "azuread_group" "test" {
}
resource "azuread_group_member" "testA" {
group_object_id = "${azuread_group.test.object_id}"
member_object_id = "${azuread_user.testA.object_id}"
group_object_id = azuread_group.test.object_id
member_object_id = azuread_user.testA.object_id
}
`, testAccADUser_threeUsersABC(id, password), id)
Expand All @@ -216,13 +216,13 @@ resource "azuread_group" "test" {
}
resource "azuread_group_member" "testA" {
group_object_id = "${azuread_group.test.object_id}"
member_object_id = "${azuread_user.testA.object_id}"
group_object_id = azuread_group.test.object_id
member_object_id = azuread_user.testA.object_id
}
resource "azuread_group_member" "testB" {
group_object_id = "${azuread_group.test.object_id}"
member_object_id = "${azuread_user.testB.object_id}"
group_object_id = azuread_group.test.object_id
member_object_id = azuread_user.testB.object_id
}
`, testAccADUser_threeUsersABC(id, password), id)
Expand All @@ -240,8 +240,8 @@ resource "azuread_group" "member" {
}
resource "azuread_group_member" "test" {
group_object_id = "${azuread_group.test.object_id}"
member_object_id = "${azuread_group.member.object_id}"
group_object_id = azuread_group.test.object_id
member_object_id = azuread_group.member.object_id
}
`, id)
Expand All @@ -255,16 +255,16 @@ resource "azuread_application" "test" {
}
resource "azuread_service_principal" "test" {
application_id = "${azuread_application.test.application_id}"
application_id = azuread_application.test.application_id
}
resource "azuread_group" "test" {
name = "acctestGroup-%[1]d"
}
resource "azuread_group_member" "test" {
group_object_id = "${azuread_group.test.object_id}"
member_object_id = "${azuread_service_principal.test.object_id}"
group_object_id = azuread_group.test.object_id
member_object_id = azuread_service_principal.test.object_id
}
`, id)
Expand Down
18 changes: 9 additions & 9 deletions azuread/resource_service_principal_certificate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ resource "azuread_application" "test" {
}
resource "azuread_service_principal" "test" {
application_id = "${azuread_application.test.application_id}"
application_id = azuread_application.test.application_id
}
`, ri)
}
Expand All @@ -240,7 +240,7 @@ func testAccADObjectCertificateServicePrincipal_basic(ri int, keyType, endDate,
%s
resource "azuread_service_principal_certificate" "test" {
service_principal_id = "${azuread_service_principal.test.id}"
service_principal_id = azuread_service_principal.test.id
type = "%s"
end_date = "%s"
value = <<EOT
Expand All @@ -255,7 +255,7 @@ func testAccADServicePrincipalCertificate_complete(ri int, keyId, keyType, start
%s
resource "azuread_service_principal_certificate" "test" {
service_principal_id = "${azuread_service_principal.test.id}"
service_principal_id = azuread_service_principal.test.id
key_id = "%s"
type = "%s"
start_date = "%s"
Expand All @@ -272,7 +272,7 @@ func testAccADServicePrincipalCertificate_relativeEndDate(ri int, keyType, value
%s
resource "azuread_service_principal_certificate" "test" {
service_principal_id = "${azuread_service_principal.test.id}"
service_principal_id = azuread_service_principal.test.id
end_date_relative = "4320h"
type = "%s"
value = <<EOT
Expand All @@ -288,11 +288,11 @@ func testAccADServicePrincipalCertificate_requiresImport(ri int, keyType, endDat
%s
resource "azuread_service_principal_certificate" "import" {
service_principal_id = "${azuread_service_principal_certificate.test.service_principal_id}"
key_id = "${azuread_service_principal_certificate.test.key_id}"
type = "${azuread_service_principal_certificate.test.type}"
end_date = "${azuread_service_principal_certificate.test.end_date}"
value = "${azuread_service_principal_certificate.test.value}"
service_principal_id = azuread_service_principal_certificate.test.service_principal_id
key_id = azuread_service_principal_certificate.test.key_id
type = azuread_service_principal_certificate.test.type
end_date = azuread_service_principal_certificate.test.end_date
value = azuread_service_principal_certificate.test.value
}
`, template)
}
Loading

0 comments on commit e93cd9e

Please sign in to comment.