From d53e6e28ee30cbab45814d9e6037742d9a03270f Mon Sep 17 00:00:00 2001 From: Chris Marchesi Date: Sat, 28 Nov 2015 12:59:27 -0800 Subject: [PATCH] Update event source mapping test coverage --- ...ce_aws_lambda_event_source_mapping_test.go | 118 +++++++++++++++++- 1 file changed, 114 insertions(+), 4 deletions(-) diff --git a/builtin/providers/aws/resource_aws_lambda_event_source_mapping_test.go b/builtin/providers/aws/resource_aws_lambda_event_source_mapping_test.go index 15ca56ac79f4..59fe5b56e6d0 100644 --- a/builtin/providers/aws/resource_aws_lambda_event_source_mapping_test.go +++ b/builtin/providers/aws/resource_aws_lambda_event_source_mapping_test.go @@ -2,6 +2,8 @@ package aws import ( "fmt" + "regexp" + "strconv" "testing" "github.com/aws/aws-sdk-go/aws" @@ -25,6 +27,23 @@ func TestAccAWSLambdaEventSourceMapping_basic(t *testing.T) { testAccCheckAWSLambdaEventSourceMappingAttributes(&conf), ), }, + resource.TestStep{ + Config: testAccAWSLambdaEventSourceMappingConfigUpdate, + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsLambdaEventSourceMappingExists("aws_lambda_event_source_mapping.lambda_event_source_mapping_test", &conf), + resource.TestCheckResourceAttr("aws_lambda_event_source_mapping.lambda_event_source_mapping_test", + "batch_size", + strconv.Itoa(200)), + resource.TestCheckResourceAttr("aws_lambda_event_source_mapping.lambda_event_source_mapping_test", + "enabled", + strconv.FormatBool(false)), + resource.TestMatchResourceAttr( + "aws_lambda_event_source_mapping.lambda_event_source_mapping_test", + "function_arn", + regexp.MustCompile("example_lambda_name_update$"), + ), + ), + }, }, }) } @@ -94,7 +113,7 @@ func testAccCheckAWSLambdaEventSourceMappingAttributes(mapping *lambda.EventSour const testAccAWSLambdaEventSourceMappingConfig = ` resource "aws_iam_role" "iam_for_lambda" { name = "iam_for_lambda" - assume_role_policy = <