Skip to content

Commit dfa917b

Browse files
author
vagrant
committed
enable contact-group id in statuscake test
1 parent 55ba6eb commit dfa917b

2 files changed

Lines changed: 19 additions & 9 deletions

File tree

builtin/providers/statuscake/resource_statuscaketest.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ func resourceStatusCakeTest() *schema.Resource {
5353
Type: schema.TypeInt,
5454
Computed: true,
5555
},
56+
"contact_id": &schema.Schema{
57+
Type: schema.TypeInt,
58+
Optional: true,
59+
},
5660
},
5761
}
5862
}
@@ -151,5 +155,8 @@ func getStatusCakeTestInput(d *schema.ResourceData) *statuscake.Test {
151155
if v, ok := d.GetOk("timeout"); ok {
152156
test.Timeout = v.(int)
153157
}
158+
if v, ok := d.GetOk("contact_id"); ok {
159+
test.ContactID = v.(int)
160+
}
154161
return test
155162
}

builtin/providers/statuscake/resource_statuscaketest_test.go

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ func TestAccStatusCake_withUpdate(t *testing.T) {
4949
testAccTestCheckExists("statuscake_test.google", &test),
5050
resource.TestCheckResourceAttr("statuscake_test.google", "check_rate", "500"),
5151
resource.TestCheckResourceAttr("statuscake_test.google", "paused", "true"),
52+
resource.TestCheckResourceAttr("statuscake_test.google", "contact_id", "23456"),
5253
),
5354
},
5455
},
@@ -97,19 +98,21 @@ func testAccTestCheckDestroy(test *statuscake.Test) resource.TestCheckFunc {
9798

9899
const testAccTestConfig_basic = `
99100
resource "statuscake_test" "google" {
100-
website_name = "google.com"
101-
website_url = "www.google.com"
102-
test_type = "HTTP"
103-
check_rate = 300
101+
website_name = "google.com"
102+
website_url = "www.google.com"
103+
test_type = "HTTP"
104+
check_rate = 300
105+
contact_id = 12345
104106
}
105107
`
106108

107109
const testAccTestConfig_update = `
108110
resource "statuscake_test" "google" {
109-
website_name = "google.com"
110-
website_url = "www.google.com"
111-
test_type = "HTTP"
112-
check_rate = 500
113-
paused = true
111+
website_name = "google.com"
112+
website_url = "www.google.com"
113+
test_type = "HTTP"
114+
check_rate = 500
115+
paused = true
116+
contact_id = 23456
114117
}
115118
`

0 commit comments

Comments
 (0)