From 485344737d5139ffa07f29b0689c84004783f5ec Mon Sep 17 00:00:00 2001 From: David Szabo <38033309+daszabo@users.noreply.github.com> Date: Wed, 5 Jun 2024 18:21:01 +0200 Subject: [PATCH] CDPCP-11067 Fix acc test errors (#133) --- resources/datalake/resource_aws_datalake_test.go | 2 +- resources/environments/resource_aws_credential_test.go | 4 ++-- resources/iam/resource_machine_user_group_assignment_test.go | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/resources/datalake/resource_aws_datalake_test.go b/resources/datalake/resource_aws_datalake_test.go index e918011b..901af483 100644 --- a/resources/datalake/resource_aws_datalake_test.go +++ b/resources/datalake/resource_aws_datalake_test.go @@ -226,7 +226,7 @@ func testAccCheckAwsDataLakeDestroy(s *terraform.State) error { }) _, err := cdpClient.Datalake.Operations.DescribeDatalake(params) if err != nil { - if dlErr, ok := err.(*operations.DescribeDatabaseServerDefault); ok { + if dlErr, ok := err.(*operations.DescribeDatalakeDefault); ok { if cdp.IsDatalakeError(dlErr.GetPayload(), "NOT_FOUND", "") { return nil } diff --git a/resources/environments/resource_aws_credential_test.go b/resources/environments/resource_aws_credential_test.go index 26d00673..9975e43c 100644 --- a/resources/environments/resource_aws_credential_test.go +++ b/resources/environments/resource_aws_credential_test.go @@ -110,7 +110,7 @@ func testAccAwsCredentialConfig(rName string, roleArn string) string { return fmt.Sprintf(` resource "cdp_environments_aws_credential" "test" { credential_name = %[1]q - role_arn = %[2]s + role_arn = %[2]q } `, rName, roleArn) } @@ -119,7 +119,7 @@ func testAccAwsCredentialConfigWithDescription(rName string, roleArn string, des return fmt.Sprintf(` resource "cdp_environments_aws_credential" "test" { credential_name = %[1]q - role_arn = %[2]s + role_arn = %[2]q description = %[3]q } `, rName, roleArn, description) diff --git a/resources/iam/resource_machine_user_group_assignment_test.go b/resources/iam/resource_machine_user_group_assignment_test.go index 7bd0560c..f36e7e31 100644 --- a/resources/iam/resource_machine_user_group_assignment_test.go +++ b/resources/iam/resource_machine_user_group_assignment_test.go @@ -40,7 +40,8 @@ func TestAccIamMachineUserGroupAssignment_basic(t *testing.T) { testAccIamMachineUserConfig(rName), testAccIamMachineUserGroupAssignmentConfig(rName, grName)), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "machine_user", rName), + resource.TestCheckResourceAttr(resourceName, "group", grName), resource.TestCheckResourceAttr(resourceName, "id", rName+"_"+grName), testAccCheckIamMachineUserGroupAssignmentExists(rName, grName, &credential), ),