github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/builtin/providers/pagerduty/import_pagerduty_service_test.go (about) 1 package pagerduty 2 3 import ( 4 "testing" 5 6 "github.com/hashicorp/terraform/helper/resource" 7 ) 8 9 func TestAccPagerDutyService_import(t *testing.T) { 10 resourceName := "pagerduty_service.foo" 11 12 resource.Test(t, resource.TestCase{ 13 PreCheck: func() { testAccPreCheck(t) }, 14 Providers: testAccProviders, 15 CheckDestroy: testAccCheckPagerDutyServiceDestroy, 16 Steps: []resource.TestStep{ 17 resource.TestStep{ 18 Config: testAccCheckPagerDutyServiceConfig, 19 }, 20 21 resource.TestStep{ 22 ResourceName: resourceName, 23 ImportState: true, 24 ImportStateVerify: true, 25 }, 26 }, 27 }) 28 } 29 30 func TestAccPagerDutyServiceWithIncidentUrgency_import(t *testing.T) { 31 resourceName := "pagerduty_service.foo" 32 33 resource.Test(t, resource.TestCase{ 34 PreCheck: func() { testAccPreCheck(t) }, 35 Providers: testAccProviders, 36 CheckDestroy: testAccCheckPagerDutyServiceDestroy, 37 Steps: []resource.TestStep{ 38 resource.TestStep{ 39 Config: testAccCheckPagerDutyServiceWithIncidentUrgencyRulesConfig, 40 }, 41 42 resource.TestStep{ 43 ResourceName: resourceName, 44 ImportState: true, 45 ImportStateVerify: true, 46 }, 47 }, 48 }) 49 }