2016-10-18 14:54:33 +02:00
|
|
|
package pagerduty
|
|
|
|
|
|
|
|
import (
|
2017-05-11 16:14:30 +02:00
|
|
|
"fmt"
|
2016-10-18 14:54:33 +02:00
|
|
|
"testing"
|
|
|
|
|
2017-05-11 16:14:30 +02:00
|
|
|
"github.com/hashicorp/terraform/helper/acctest"
|
2016-10-18 14:54:33 +02:00
|
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestAccPagerDutySchedule_import(t *testing.T) {
|
2017-05-11 16:14:30 +02:00
|
|
|
username := fmt.Sprintf("tf-%s", acctest.RandString(5))
|
|
|
|
email := fmt.Sprintf("%s@foo.com", username)
|
|
|
|
schedule := fmt.Sprintf("tf-%s", acctest.RandString(5))
|
2016-10-18 14:54:33 +02:00
|
|
|
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
|
|
Providers: testAccProviders,
|
|
|
|
CheckDestroy: testAccCheckPagerDutyUserDestroy,
|
|
|
|
Steps: []resource.TestStep{
|
2017-05-11 16:14:30 +02:00
|
|
|
{
|
|
|
|
Config: testAccCheckPagerDutyScheduleConfig(username, email, schedule),
|
2016-10-18 14:54:33 +02:00
|
|
|
},
|
|
|
|
|
2017-05-11 16:14:30 +02:00
|
|
|
{
|
|
|
|
ResourceName: "pagerduty_schedule.foo",
|
2016-10-18 14:54:33 +02:00
|
|
|
ImportState: true,
|
|
|
|
ImportStateVerify: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|