Skip to content

Commit

Permalink
r/aws_route: Refactor acceptance tests in preparation for future fixe…
Browse files Browse the repository at this point in the history
…s/enhancements.
  • Loading branch information
ewbankkit committed Jan 5, 2021
1 parent 04e3b27 commit 84087ab
Show file tree
Hide file tree
Showing 2 changed files with 1,309 additions and 717 deletions.
5 changes: 0 additions & 5 deletions aws/data_source_aws_route_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"
"testing"

"github.com/aws/aws-sdk-go/service/ec2"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
)
Expand All @@ -28,7 +27,6 @@ func TestAccAWSRouteDataSource_basic(t *testing.T) {
}

func TestAccAWSRouteDataSource_TransitGatewayID(t *testing.T) {
var route ec2.Route
dataSourceName := "data.aws_route.test"
resourceName := "aws_route.test"

Expand All @@ -40,7 +38,6 @@ func TestAccAWSRouteDataSource_TransitGatewayID(t *testing.T) {
{
Config: testAccAWSRouteDataSourceConfigTransitGatewayID(),
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSRouteExists(resourceName, &route),
resource.TestCheckResourceAttrPair(resourceName, "destination_cidr_block", dataSourceName, "destination_cidr_block"),
resource.TestCheckResourceAttrPair(resourceName, "route_table_id", dataSourceName, "route_table_id"),
resource.TestCheckResourceAttrPair(resourceName, "transit_gateway_id", dataSourceName, "transit_gateway_id"),
Expand All @@ -51,7 +48,6 @@ func TestAccAWSRouteDataSource_TransitGatewayID(t *testing.T) {
}

func TestAccAWSRouteDataSource_LocalGatewayID(t *testing.T) {
var route ec2.Route
dataSourceName := "data.aws_route.by_local_gateway_id"
resourceName := "aws_route.test"

Expand All @@ -63,7 +59,6 @@ func TestAccAWSRouteDataSource_LocalGatewayID(t *testing.T) {
{
Config: testAccAWSRouteDataSourceConfigLocalGatewayID(),
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSRouteExists(resourceName, &route),
resource.TestCheckResourceAttrPair(resourceName, "destination_cidr_block", dataSourceName, "destination_cidr_block"),
resource.TestCheckResourceAttrPair(resourceName, "route_table_id", dataSourceName, "route_table_id"),
resource.TestCheckResourceAttrPair(resourceName, "local_gateway_id", dataSourceName, "local_gateway_id"),
Expand Down
Loading

0 comments on commit 84087ab

Please sign in to comment.