From b6bc5ca841317434eeb0f05962b22404720928ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9sz=C3=A1ros=20Gergely?= Date: Fri, 22 Nov 2024 08:51:16 +0100 Subject: [PATCH] CDPCP-13398 - add skip check for extra fields on credential due to their current absence on the public API --- .../resource_aws_credential_test.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/resources/environments/resource_aws_credential_test.go b/resources/environments/resource_aws_credential_test.go index ccd557e0..367793d9 100644 --- a/resources/environments/resource_aws_credential_test.go +++ b/resources/environments/resource_aws_credential_test.go @@ -50,6 +50,8 @@ func TestAccAwsCredential_basic(t *testing.T) { resource.TestCheckResourceAttrWith(resourceName, "crn", cdpacctest.CheckCrn), testAccCheckAwsCredentialExists(resourceName, &credential), testAccCheckAwsCredentialValues(&credential, rName, ""), + resource.TestCheckResourceAttr(resourceName, "skip_org_policy_decisions", "false"), + resource.TestCheckResourceAttr(resourceName, "verify_permissions", "false"), resource.TestCheckResourceAttrWith(resourceName, "role_arn", func(value string) error { return utils.CheckStringEquals("AwsCredentialProperties.RoleArn", credential.AwsCredentialProperties.RoleArn, value) }), @@ -57,9 +59,10 @@ func TestAccAwsCredential_basic(t *testing.T) { }, // ImportState testing { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, + ImportState: true, + ImportStateVerify: true, + ResourceName: resourceName, + ImportStateVerifyIgnore: []string{"skip_org_policy_decisions", "verify_permissions"}, // this ignore has to be taken out once the CB-27933 got finished }, // Delete testing automatically occurs in TestCase }, @@ -91,6 +94,8 @@ func TestAccAwsCredential_withDescription(t *testing.T) { resource.TestCheckResourceAttrWith(resourceName, "crn", cdpacctest.CheckCrn), testAccCheckAwsCredentialExists(resourceName, &credential), testAccCheckAwsCredentialValues(&credential, rName, rName), + resource.TestCheckResourceAttr(resourceName, "skip_org_policy_decisions", "false"), + resource.TestCheckResourceAttr(resourceName, "verify_permissions", "false"), resource.TestCheckResourceAttrWith(resourceName, "role_arn", func(value string) error { return utils.CheckStringEquals("AwsCredentialProperties.RoleArn", credential.AwsCredentialProperties.RoleArn, value) }), @@ -98,9 +103,10 @@ func TestAccAwsCredential_withDescription(t *testing.T) { }, // ImportState testing { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, + ImportState: true, + ImportStateVerify: true, + ResourceName: resourceName, + ImportStateVerifyIgnore: []string{"skip_org_policy_decisions", "verify_permissions"}, // this ignore has to be taken out once the CB-27933 got finished }, // Delete testing automatically occurs in TestCase },