Skip to content

Commit

Permalink
Merge pull request #10433 from terraform-providers/rfd-at002-dynamodb
Browse files Browse the repository at this point in the history
Acceptance test import refactor for dynamodb resources
  • Loading branch information
bflad authored Oct 10, 2019
2 parents 3bd0318 + 3239296 commit 8f487f2
Show file tree
Hide file tree
Showing 2 changed files with 161 additions and 133 deletions.
32 changes: 10 additions & 22 deletions aws/resource_aws_dynamodb_global_table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ func TestAccAWSDynamoDbGlobalTable_basic(t *testing.T) {
regexp.MustCompile("^arn:aws:dynamodb::[0-9]{12}:global-table/[a-z0-9-]+$")),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}
Expand All @@ -67,6 +72,11 @@ func TestAccAWSDynamoDbGlobalTable_multipleRegions(t *testing.T) {
regexp.MustCompile("^arn:aws:dynamodb::[0-9]{12}:global-table/[a-z0-9-]+$")),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
{
Config: testAccDynamoDbGlobalTableConfig_multipleRegions2(tableName),
Check: resource.ComposeTestCheckFunc(
Expand All @@ -89,28 +99,6 @@ func TestAccAWSDynamoDbGlobalTable_multipleRegions(t *testing.T) {
})
}

func TestAccAWSDynamoDbGlobalTable_import(t *testing.T) {
resourceName := "aws_dynamodb_global_table.test"
tableName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(5))

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDynamodbGlobalTable(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckSesTemplateDestroy,
Steps: []resource.TestStep{
{
Config: testAccDynamoDbGlobalTableConfig_basic(tableName),
},

{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func testAccCheckAwsDynamoDbGlobalTableDestroy(s *terraform.State) error {
conn := testAccProvider.Meta().(*AWSClient).dynamodbconn

Expand Down
Loading

0 comments on commit 8f487f2

Please sign in to comment.