Skip to content

Commit

Permalink
Merge pull request #12733 from terraform-providers/t-clean-up-appauto…
Browse files Browse the repository at this point in the history
…scaling-arn-tests

service/appautoscaling: Update acceptance tests to use ARN testing check functions
  • Loading branch information
gdavison authored Apr 18, 2020
2 parents c3e1fbc + 11474e4 commit 2b78907
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions aws/resource_aws_appautoscaling_target_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package aws

import (
"fmt"
"regexp"
"testing"
"time"

Expand Down Expand Up @@ -149,8 +148,6 @@ func TestAccAWSAppautoScalingTarget_optionalRoleArn(t *testing.T) {
rInt := acctest.RandInt()
tableName := fmt.Sprintf("tf_acc_test_table_%d", rInt)

r, _ := regexp.Compile("arn:aws:iam::.*:role/aws-service-role/dynamodb.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_DynamoDBTable")

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Expand All @@ -160,7 +157,8 @@ func TestAccAWSAppautoScalingTarget_optionalRoleArn(t *testing.T) {
Config: testAccAWSAppautoscalingTarget_optionalRoleArn(tableName),
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSAppautoscalingTargetExists("aws_appautoscaling_target.read", &readTarget),
resource.TestMatchResourceAttr("aws_appautoscaling_target.read", "role_arn", r),
testAccCheckResourceAttrGlobalARN("aws_appautoscaling_target.read", "role_arn", "iam",
"role/aws-service-role/dynamodb.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_DynamoDBTable"),
),
},
},
Expand Down

0 comments on commit 2b78907

Please sign in to comment.