Skip to content

Commit

Permalink
Add a variable detectorResourceName
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke authored and kzonov committed Aug 11, 2020
1 parent 87638fe commit e313e2b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions aws/resource_aws_guardduty_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

func testAccAwsGuardDutyFilter_basic(t *testing.T) {
resourceName := "aws_guardduty_filter.test"
detectorResourceName := "aws_guardduty_detector.test"

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand All @@ -22,7 +23,7 @@ func testAccAwsGuardDutyFilter_basic(t *testing.T) {
Config: testAccGuardDutyFilterConfig_full(),
Check: resource.ComposeTestCheckFunc(
testAccCheckAwsGuardDutyFilterExists(resourceName),
resource.TestCheckResourceAttrPair(resourceName, "detector_id", "aws_guardduty_detector.test", "id"),
resource.TestCheckResourceAttrPair(resourceName, "detector_id", detectorResourceName, "id"),
resource.TestCheckResourceAttr(resourceName, "name", "test-filter"),
resource.TestCheckResourceAttr(resourceName, "action", "ARCHIVE"),
resource.TestCheckResourceAttr(resourceName, "rank", "1"),
Expand All @@ -33,7 +34,7 @@ func testAccAwsGuardDutyFilter_basic(t *testing.T) {
Config: testAccGuardDutyFilterConfigNoop_full(),
Check: resource.ComposeTestCheckFunc(
testAccCheckAwsGuardDutyFilterExists(resourceName),
resource.TestCheckResourceAttrPair(resourceName, "detector_id", "aws_guardduty_detector.test", "id"),
resource.TestCheckResourceAttrPair(resourceName, "detector_id", detectorResourceName, "id"),
resource.TestCheckResourceAttr(resourceName, "name", "test-filter"),
resource.TestCheckResourceAttr(resourceName, "action", "NOOP"),
resource.TestCheckResourceAttr(resourceName, "rank", "1"),
Expand Down

0 comments on commit e313e2b

Please sign in to comment.