|
| 1 | +package uptimerobot |
| 2 | + |
| 3 | +import ( |
| 4 | + "fmt" |
| 5 | + "testing" |
| 6 | + |
| 7 | + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" |
| 8 | +) |
| 9 | + |
| 10 | +func TestUptimeRobotDataSourceMonitor_basic(t *testing.T) { |
| 11 | + var friendlyName = "TF Test: monitor" |
| 12 | + resource.Test(t, resource.TestCase{ |
| 13 | + PreCheck: func() { testAccPreCheck(t) }, |
| 14 | + Providers: testAccProviders, |
| 15 | + Steps: []resource.TestStep{ |
| 16 | + { |
| 17 | + Config: fmt.Sprintf(` |
| 18 | + data "uptimerobot_monitor" "test" { |
| 19 | + friendly_name = "%s" |
| 20 | + } |
| 21 | + `, friendlyName), |
| 22 | + Check: resource.ComposeTestCheckFunc( |
| 23 | + resource.TestCheckResourceAttr("data.uptimerobot_monitor.test", "friendly_name", friendlyName), |
| 24 | + resource.TestCheckResourceAttrSet("data.uptimerobot_monitor.test", "id"), |
| 25 | + resource.TestCheckResourceAttrSet("data.uptimerobot_monitor.test", "url"), |
| 26 | + resource.TestCheckResourceAttrSet("data.uptimerobot_monitor.test", "type"), |
| 27 | + resource.TestCheckResourceAttrSet("data.uptimerobot_monitor.test", "status"), |
| 28 | + resource.TestCheckResourceAttrSet("data.uptimerobot_monitor.test", "interval"), |
| 29 | + resource.TestCheckResourceAttrSet("data.uptimerobot_monitor.test", "sub_type"), |
| 30 | + resource.TestCheckResourceAttrSet("data.uptimerobot_monitor.test", "port"), |
| 31 | + resource.TestCheckResourceAttrSet("data.uptimerobot_monitor.test", "keyword_type"), |
| 32 | + resource.TestCheckResourceAttrSet("data.uptimerobot_monitor.test", "keyword_value"), |
| 33 | + resource.TestCheckResourceAttrSet("data.uptimerobot_monitor.test", "http_username"), |
| 34 | + resource.TestCheckResourceAttrSet("data.uptimerobot_monitor.test", "http_password"), |
| 35 | + resource.TestCheckResourceAttrSet("data.uptimerobot_monitor.test", "http_auth_type"), |
| 36 | + resource.TestCheckResourceAttrSet("data.uptimerobot_monitor.test", "custom_http_headers"), |
| 37 | + resource.TestCheckResourceAttrSet("data.uptimerobot_monitor.test", "alert_contact"), |
| 38 | + ), |
| 39 | + }, |
| 40 | + }, |
| 41 | + }) |
| 42 | +} |
0 commit comments