Skip to content

Commit

Permalink
fix folder iam binding test (#2556)
Browse files Browse the repository at this point in the history
  • Loading branch information
modular-magician authored and danawillow committed Dec 3, 2018
1 parent a7aa9bc commit bf0606c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
26 changes: 13 additions & 13 deletions google/resource_google_folder_iam_binding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestAccFolderIamBinding_basic(t *testing.T) {
{
Config: testAccFolderAssociateBindingBasic(org, fname),
Check: resource.ComposeTestCheckFunc(
testAccCheckGoogleFolderIamBindingExists("google_folder_iam_binding.acceptance", &cloudresourcemanager.Binding{
testAccCheckGoogleFolderIamBindingExists(&cloudresourcemanager.Binding{
Role: "roles/compute.instanceAdmin",
Members: []string{"user:[email protected]"},
}, org, fname),
Expand Down Expand Up @@ -63,7 +63,7 @@ func TestAccFolderIamBinding_multiple(t *testing.T) {
{
Config: testAccFolderAssociateBindingBasic(org, fname),
Check: resource.ComposeTestCheckFunc(
testAccCheckGoogleFolderIamBindingExists("google_folder_iam_binding.acceptance", &cloudresourcemanager.Binding{
testAccCheckGoogleFolderIamBindingExists(&cloudresourcemanager.Binding{
Role: "roles/compute.instanceAdmin",
Members: []string{"user:[email protected]"},
}, org, fname),
Expand All @@ -73,11 +73,11 @@ func TestAccFolderIamBinding_multiple(t *testing.T) {
{
Config: testAccFolderAssociateBindingMultiple(org, fname),
Check: resource.ComposeTestCheckFunc(
testAccCheckGoogleFolderIamBindingExists("google_folder_iam_binding.multiple", &cloudresourcemanager.Binding{
testAccCheckGoogleFolderIamBindingExists(&cloudresourcemanager.Binding{
Role: "roles/viewer",
Members: []string{"user:[email protected]"},
}, org, fname),
testAccCheckGoogleFolderIamBindingExists("google_folder_iam_binding.multiple", &cloudresourcemanager.Binding{
testAccCheckGoogleFolderIamBindingExists(&cloudresourcemanager.Binding{
Role: "roles/compute.instanceAdmin",
Members: []string{"user:[email protected]"},
}, org, fname),
Expand Down Expand Up @@ -108,11 +108,11 @@ func TestAccFolderIamBinding_multipleAtOnce(t *testing.T) {
{
Config: testAccFolderAssociateBindingMultiple(org, fname),
Check: resource.ComposeTestCheckFunc(
testAccCheckGoogleFolderIamBindingExists("google_folder_iam_binding.acceptance", &cloudresourcemanager.Binding{
testAccCheckGoogleFolderIamBindingExists(&cloudresourcemanager.Binding{
Role: "roles/compute.instanceAdmin",
Members: []string{"user:[email protected]"},
}, org, fname),
testAccCheckGoogleFolderIamBindingExists("google_folder_iam_binding.multiple", &cloudresourcemanager.Binding{
testAccCheckGoogleFolderIamBindingExists(&cloudresourcemanager.Binding{
Role: "roles/compute.instanceAdmin",
Members: []string{"user:[email protected]"},
}, org, fname),
Expand Down Expand Up @@ -143,7 +143,7 @@ func TestAccFolderIamBinding_update(t *testing.T) {
{
Config: testAccFolderAssociateBindingBasic(org, fname),
Check: resource.ComposeTestCheckFunc(
testAccCheckGoogleFolderIamBindingExists("google_folder_iam_binding.acceptance", &cloudresourcemanager.Binding{
testAccCheckGoogleFolderIamBindingExists(&cloudresourcemanager.Binding{
Role: "roles/compute.instanceAdmin",
Members: []string{"user:[email protected]"},
}, org, fname),
Expand All @@ -153,7 +153,7 @@ func TestAccFolderIamBinding_update(t *testing.T) {
{
Config: testAccFolderAssociateBindingUpdated(org, fname),
Check: resource.ComposeTestCheckFunc(
testAccCheckGoogleFolderIamBindingExists("google_folder_iam_binding.updated", &cloudresourcemanager.Binding{
testAccCheckGoogleFolderIamBindingExists(&cloudresourcemanager.Binding{
Role: "roles/compute.instanceAdmin",
Members: []string{"user:[email protected]", "user:[email protected]"},
}, org, fname),
Expand All @@ -163,7 +163,7 @@ func TestAccFolderIamBinding_update(t *testing.T) {
{
Config: testAccFolderAssociateBindingDropMemberFromBasic(org, fname),
Check: resource.ComposeTestCheckFunc(
testAccCheckGoogleFolderIamBindingExists("google_folder_iam_binding.dropped", &cloudresourcemanager.Binding{
testAccCheckGoogleFolderIamBindingExists(&cloudresourcemanager.Binding{
Role: "roles/compute.instanceAdmin",
Members: []string{"user:[email protected]"},
}, org, fname),
Expand Down Expand Up @@ -194,11 +194,11 @@ func TestAccFolderIamBinding_remove(t *testing.T) {
{
Config: testAccFolderAssociateBindingMultiple(org, fname),
Check: resource.ComposeTestCheckFunc(
testAccCheckGoogleFolderIamBindingExists("google_folder_iam_binding.multiple", &cloudresourcemanager.Binding{
testAccCheckGoogleFolderIamBindingExists(&cloudresourcemanager.Binding{
Role: "roles/viewer",
Members: []string{"user:[email protected]"},
}, org, fname),
testAccCheckGoogleFolderIamBindingExists("google_folder_iam_binding.acceptance", &cloudresourcemanager.Binding{
testAccCheckGoogleFolderIamBindingExists(&cloudresourcemanager.Binding{
Role: "roles/compute.instanceAdmin",
Members: []string{"user:[email protected]"},
}, org, fname),
Expand All @@ -215,7 +215,7 @@ func TestAccFolderIamBinding_remove(t *testing.T) {
})
}

func testAccCheckGoogleFolderIamBindingExists(key string, expected *cloudresourcemanager.Binding, org, fname string) resource.TestCheckFunc {
func testAccCheckGoogleFolderIamBindingExists(expected *cloudresourcemanager.Binding, org, fname string) resource.TestCheckFunc {
return func(s *terraform.State) error {
config := testAccProvider.Meta().(*Config)
folderPolicy, err := getFolderIamPolicyByParentAndDisplayName("organizations/"+org, fname, config)
Expand Down Expand Up @@ -314,7 +314,7 @@ resource "google_folder" "acceptance" {
display_name = "%s"
}
resource "google_folder_iam_binding" "dropped" {
resource "google_folder_iam_binding" "acceptance" {
folder = "${google_folder.acceptance.name}"
members = ["user:[email protected]"]
role = "roles/compute.instanceAdmin"
Expand Down
8 changes: 4 additions & 4 deletions google/resource_google_folder_iam_member_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestAccFolderIamMember_basic(t *testing.T) {
{
Config: testAccFolderAssociateMemberBasic(org, fname),
Check: resource.ComposeTestCheckFunc(
testAccCheckGoogleFolderIamBindingExists("google_folder_iam_member.acceptance", &cloudresourcemanager.Binding{
testAccCheckGoogleFolderIamBindingExists(&cloudresourcemanager.Binding{
Role: "roles/compute.instanceAdmin",
Members: []string{"user:[email protected]"},
}, org, fname),
Expand Down Expand Up @@ -61,7 +61,7 @@ func TestAccFolderIamMember_multiple(t *testing.T) {
{
Config: testAccFolderAssociateMemberBasic(org, fname),
Check: resource.ComposeTestCheckFunc(
testAccCheckGoogleFolderIamBindingExists("google_folder_iam_member.acceptance", &cloudresourcemanager.Binding{
testAccCheckGoogleFolderIamBindingExists(&cloudresourcemanager.Binding{
Role: "roles/compute.instanceAdmin",
Members: []string{"user:[email protected]"},
}, org, fname),
Expand All @@ -71,7 +71,7 @@ func TestAccFolderIamMember_multiple(t *testing.T) {
{
Config: testAccFolderAssociateMemberMultiple(org, fname),
Check: resource.ComposeTestCheckFunc(
testAccCheckGoogleFolderIamBindingExists("google_folder_iam_member.multiple", &cloudresourcemanager.Binding{
testAccCheckGoogleFolderIamBindingExists(&cloudresourcemanager.Binding{
Role: "roles/compute.instanceAdmin",
Members: []string{"user:[email protected]", "user:[email protected]"},
}, org, fname),
Expand Down Expand Up @@ -102,7 +102,7 @@ func TestAccFolderIamMember_remove(t *testing.T) {
{
Config: testAccFolderAssociateMemberMultiple(org, fname),
Check: resource.ComposeTestCheckFunc(
testAccCheckGoogleFolderIamBindingExists("google_folder_iam_member.acceptance", &cloudresourcemanager.Binding{
testAccCheckGoogleFolderIamBindingExists(&cloudresourcemanager.Binding{
Role: "roles/compute.instanceAdmin",
Members: []string{"user:[email protected]", "user:[email protected]"},
}, org, fname),
Expand Down

0 comments on commit bf0606c

Please sign in to comment.