From cbaf051af53b6e2a13e0c0f982b908158c2af10a Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Tue, 24 Jan 2017 12:09:29 +0000 Subject: [PATCH] provider/aws: Fix acceptance tests w/ missing values (#11377) --- .../resource_aws_api_gateway_integration_response_test.go | 4 ++-- .../aws/resource_aws_api_gateway_integration_test.go | 4 ++-- .../aws/resource_aws_api_gateway_rest_api_test.go | 4 ++-- .../providers/aws/resource_aws_autoscaling_group_test.go | 4 ++-- .../aws/resource_aws_codecommit_repository_test.go | 4 ++-- builtin/providers/aws/resource_aws_iam_access_key_test.go | 4 ++-- builtin/providers/aws/resource_aws_kinesis_stream_test.go | 4 ++-- .../providers/aws/resource_aws_lambda_function_test.go | 5 ++--- .../providers/aws/resource_aws_lightsail_key_pair_test.go | 8 ++++---- builtin/providers/aws/resource_aws_s3_bucket_test.go | 4 ++-- 10 files changed, 22 insertions(+), 23 deletions(-) diff --git a/builtin/providers/aws/resource_aws_api_gateway_integration_response_test.go b/builtin/providers/aws/resource_aws_api_gateway_integration_response_test.go index fb4f9141a..5eef59cd8 100644 --- a/builtin/providers/aws/resource_aws_api_gateway_integration_response_test.go +++ b/builtin/providers/aws/resource_aws_api_gateway_integration_response_test.go @@ -28,8 +28,8 @@ func TestAccAWSAPIGatewayIntegrationResponse_basic(t *testing.T) { "aws_api_gateway_integration_response.test", "response_templates.application/json", ""), resource.TestCheckResourceAttr( "aws_api_gateway_integration_response.test", "response_templates.application/xml", "#set($inputRoot = $input.path('$'))\n{ }"), - resource.TestCheckResourceAttr( - "aws_api_gateway_integration_response.test", "content_handling", ""), + resource.TestCheckNoResourceAttr( + "aws_api_gateway_integration_response.test", "content_handling"), ), }, diff --git a/builtin/providers/aws/resource_aws_api_gateway_integration_test.go b/builtin/providers/aws/resource_aws_api_gateway_integration_test.go index 8b8f7c979..153ed13b4 100644 --- a/builtin/providers/aws/resource_aws_api_gateway_integration_test.go +++ b/builtin/providers/aws/resource_aws_api_gateway_integration_test.go @@ -36,8 +36,8 @@ func TestAccAWSAPIGatewayIntegration_basic(t *testing.T) { "aws_api_gateway_integration.test", "request_templates.application/xml", "#set($inputRoot = $input.path('$'))\n{ }"), resource.TestCheckResourceAttr( "aws_api_gateway_integration.test", "passthrough_behavior", "WHEN_NO_MATCH"), - resource.TestCheckResourceAttr( - "aws_api_gateway_integration.test", "content_handling", ""), + resource.TestCheckNoResourceAttr( + "aws_api_gateway_integration.test", "content_handling"), ), }, diff --git a/builtin/providers/aws/resource_aws_api_gateway_rest_api_test.go b/builtin/providers/aws/resource_aws_api_gateway_rest_api_test.go index 455d07f3d..1052a60c0 100644 --- a/builtin/providers/aws/resource_aws_api_gateway_rest_api_test.go +++ b/builtin/providers/aws/resource_aws_api_gateway_rest_api_test.go @@ -29,8 +29,8 @@ func TestAccAWSAPIGatewayRestApi_basic(t *testing.T) { "aws_api_gateway_rest_api.test", "description", ""), resource.TestCheckResourceAttrSet( "aws_api_gateway_rest_api.test", "created_date"), - resource.TestCheckResourceAttr( - "aws_api_gateway_rest_api.test", "binary_media_types", ""), + resource.TestCheckNoResourceAttr( + "aws_api_gateway_rest_api.test", "binary_media_types"), ), }, diff --git a/builtin/providers/aws/resource_aws_autoscaling_group_test.go b/builtin/providers/aws/resource_aws_autoscaling_group_test.go index 0bf1c414c..6400dcb73 100644 --- a/builtin/providers/aws/resource_aws_autoscaling_group_test.go +++ b/builtin/providers/aws/resource_aws_autoscaling_group_test.go @@ -277,8 +277,8 @@ func TestAccAWSAutoScalingGroup_enablingMetrics(t *testing.T) { Config: testAccAWSAutoScalingGroupConfig(randName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSAutoScalingGroupExists("aws_autoscaling_group.bar", &group), - resource.TestCheckResourceAttr( - "aws_autoscaling_group.bar", "enabled_metrics.#", ""), + resource.TestCheckNoResourceAttr( + "aws_autoscaling_group.bar", "enabled_metrics"), ), }, diff --git a/builtin/providers/aws/resource_aws_codecommit_repository_test.go b/builtin/providers/aws/resource_aws_codecommit_repository_test.go index a46405bee..e14882660 100644 --- a/builtin/providers/aws/resource_aws_codecommit_repository_test.go +++ b/builtin/providers/aws/resource_aws_codecommit_repository_test.go @@ -86,8 +86,8 @@ func TestAccAWSCodeCommitRepository_create_and_update_default_branch(t *testing. Config: testAccCodeCommitRepository_basic(rInt), Check: resource.ComposeTestCheckFunc( testAccCheckCodeCommitRepositoryExists("aws_codecommit_repository.test"), - resource.TestCheckResourceAttr( - "aws_codecommit_repository.test", "default_branch", ""), + resource.TestCheckNoResourceAttr( + "aws_codecommit_repository.test", "default_branch"), ), }, resource.TestStep{ diff --git a/builtin/providers/aws/resource_aws_iam_access_key_test.go b/builtin/providers/aws/resource_aws_iam_access_key_test.go index 280b31e9f..4cf8a1dd7 100644 --- a/builtin/providers/aws/resource_aws_iam_access_key_test.go +++ b/builtin/providers/aws/resource_aws_iam_access_key_test.go @@ -51,8 +51,8 @@ func TestAccAWSAccessKey_encrypted(t *testing.T) { testAccCheckAWSAccessKeyExists("aws_iam_access_key.a_key", &conf), testAccCheckAWSAccessKeyAttributes(&conf), testDecryptSecretKeyAndTest("aws_iam_access_key.a_key", testPrivKey1), - resource.TestCheckResourceAttr( - "aws_iam_access_key.a_key", "secret", ""), + resource.TestCheckNoResourceAttr( + "aws_iam_access_key.a_key", "secret"), resource.TestCheckResourceAttrSet( "aws_iam_access_key.a_key", "encrypted_secret"), resource.TestCheckResourceAttrSet( diff --git a/builtin/providers/aws/resource_aws_kinesis_stream_test.go b/builtin/providers/aws/resource_aws_kinesis_stream_test.go index 974761182..8debb2336 100644 --- a/builtin/providers/aws/resource_aws_kinesis_stream_test.go +++ b/builtin/providers/aws/resource_aws_kinesis_stream_test.go @@ -134,8 +134,8 @@ func TestAccAWSKinesisStream_shardLevelMetrics(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckKinesisStreamExists("aws_kinesis_stream.test_stream", &stream), testAccCheckAWSKinesisStreamAttributes(&stream), - resource.TestCheckResourceAttr( - "aws_kinesis_stream.test_stream", "shard_level_metrics.#", ""), + resource.TestCheckNoResourceAttr( + "aws_kinesis_stream.test_stream", "shard_level_metrics"), ), }, diff --git a/builtin/providers/aws/resource_aws_lambda_function_test.go b/builtin/providers/aws/resource_aws_lambda_function_test.go index 4cc5d92d8..c111ff5d8 100644 --- a/builtin/providers/aws/resource_aws_lambda_function_test.go +++ b/builtin/providers/aws/resource_aws_lambda_function_test.go @@ -74,7 +74,7 @@ func TestAccAWSLambdaFunction_envVariables(t *testing.T) { testAccCheckAwsLambdaFunctionExists("aws_lambda_function.lambda_function_test", rName, &conf), testAccCheckAwsLambdaFunctionName(&conf, rName), testAccCheckAwsLambdaFunctionArnHasSuffix(&conf, ":"+rName), - resource.TestCheckResourceAttr("aws_lambda_function.lambda_function_test", "environment.#", "0"), + resource.TestCheckNoResourceAttr("aws_lambda_function.lambda_function_test", "environment"), ), }, { @@ -102,8 +102,7 @@ func TestAccAWSLambdaFunction_envVariables(t *testing.T) { testAccCheckAwsLambdaFunctionExists("aws_lambda_function.lambda_function_test", rName, &conf), testAccCheckAwsLambdaFunctionName(&conf, rName), testAccCheckAwsLambdaFunctionArnHasSuffix(&conf, ":"+rName), - resource.TestCheckResourceAttr("aws_lambda_function.lambda_function_test", "environment.0.variables.foo", ""), - resource.TestCheckResourceAttr("aws_lambda_function.lambda_function_test", "environment.0.variables.foo1", ""), + resource.TestCheckNoResourceAttr("aws_lambda_function.lambda_function_test", "environment"), ), }, }, diff --git a/builtin/providers/aws/resource_aws_lightsail_key_pair_test.go b/builtin/providers/aws/resource_aws_lightsail_key_pair_test.go index e2ff906e8..539e9c5ac 100644 --- a/builtin/providers/aws/resource_aws_lightsail_key_pair_test.go +++ b/builtin/providers/aws/resource_aws_lightsail_key_pair_test.go @@ -52,9 +52,9 @@ func TestAccAWSLightsailKeyPair_imported(t *testing.T) { resource.TestCheckResourceAttrSet("aws_lightsail_key_pair.lightsail_key_pair_test", "arn"), resource.TestCheckResourceAttrSet("aws_lightsail_key_pair.lightsail_key_pair_test", "fingerprint"), resource.TestCheckResourceAttrSet("aws_lightsail_key_pair.lightsail_key_pair_test", "public_key"), - resource.TestCheckResourceAttr("aws_lightsail_key_pair.lightsail_key_pair_test", "encrypted_fingerprint", ""), - resource.TestCheckResourceAttr("aws_lightsail_key_pair.lightsail_key_pair_test", "encrypted_private_key", ""), - resource.TestCheckResourceAttr("aws_lightsail_key_pair.lightsail_key_pair_test", "private_key", ""), + resource.TestCheckNoResourceAttr("aws_lightsail_key_pair.lightsail_key_pair_test", "encrypted_fingerprint"), + resource.TestCheckNoResourceAttr("aws_lightsail_key_pair.lightsail_key_pair_test", "encrypted_private_key"), + resource.TestCheckNoResourceAttr("aws_lightsail_key_pair.lightsail_key_pair_test", "private_key"), ), }, }, @@ -79,7 +79,7 @@ func TestAccAWSLightsailKeyPair_encrypted(t *testing.T) { resource.TestCheckResourceAttrSet("aws_lightsail_key_pair.lightsail_key_pair_test", "encrypted_fingerprint"), resource.TestCheckResourceAttrSet("aws_lightsail_key_pair.lightsail_key_pair_test", "encrypted_private_key"), resource.TestCheckResourceAttrSet("aws_lightsail_key_pair.lightsail_key_pair_test", "public_key"), - resource.TestCheckResourceAttr("aws_lightsail_key_pair.lightsail_key_pair_test", "private_key", ""), + resource.TestCheckNoResourceAttr("aws_lightsail_key_pair.lightsail_key_pair_test", "private_key"), ), }, }, diff --git a/builtin/providers/aws/resource_aws_s3_bucket_test.go b/builtin/providers/aws/resource_aws_s3_bucket_test.go index f4872e91a..7864a1686 100644 --- a/builtin/providers/aws/resource_aws_s3_bucket_test.go +++ b/builtin/providers/aws/resource_aws_s3_bucket_test.go @@ -42,8 +42,8 @@ func TestAccAWSS3Bucket_basic(t *testing.T) { "aws_s3_bucket.bucket", "hosted_zone_id", HostedZoneIDForRegion("us-west-2")), resource.TestCheckResourceAttr( "aws_s3_bucket.bucket", "region", "us-west-2"), - resource.TestCheckResourceAttr( - "aws_s3_bucket.bucket", "website_endpoint", ""), + resource.TestCheckNoResourceAttr( + "aws_s3_bucket.bucket", "website_endpoint"), resource.TestMatchResourceAttr( "aws_s3_bucket.bucket", "arn", arnRegexp), ),