Skip to content

Commit

Permalink
CDPCP-13398 - add skip check for extra fields on credential due to th…
Browse files Browse the repository at this point in the history
…eir current absence on the public API
  • Loading branch information
gregito committed Nov 22, 2024
1 parent c7153f4 commit b6bc5ca
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions resources/environments/resource_aws_credential_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,19 @@ 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)
}),
),
},
// 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
},
Expand Down Expand Up @@ -91,16 +94,19 @@ 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)
}),
),
},
// 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
},
Expand Down

0 comments on commit b6bc5ca

Please sign in to comment.