diff options
-rw-r--r-- | resource_statuscaketest.go | 7 | ||||
-rw-r--r-- | resource_statuscaketest_test.go | 21 |
2 files changed, 19 insertions, 9 deletions
diff --git a/resource_statuscaketest.go b/resource_statuscaketest.go index d403848..389a7d6 100644 --- a/resource_statuscaketest.go +++ b/resource_statuscaketest.go | |||
@@ -58,6 +58,10 @@ func resourceStatusCakeTest() *schema.Resource { | |||
58 | Type: schema.TypeInt, | 58 | Type: schema.TypeInt, |
59 | Computed: true, | 59 | Computed: true, |
60 | }, | 60 | }, |
61 | "contact_id": &schema.Schema{ | ||
62 | Type: schema.TypeInt, | ||
63 | Optional: true, | ||
64 | }, | ||
61 | }, | 65 | }, |
62 | } | 66 | } |
63 | } | 67 | } |
@@ -160,5 +164,8 @@ func getStatusCakeTestInput(d *schema.ResourceData) *statuscake.Test { | |||
160 | if v, ok := d.GetOk("timeout"); ok { | 164 | if v, ok := d.GetOk("timeout"); ok { |
161 | test.Timeout = v.(int) | 165 | test.Timeout = v.(int) |
162 | } | 166 | } |
167 | if v, ok := d.GetOk("contact_id"); ok { | ||
168 | test.ContactID = v.(int) | ||
169 | } | ||
163 | return test | 170 | return test |
164 | } | 171 | } |
diff --git a/resource_statuscaketest_test.go b/resource_statuscaketest_test.go index 4123ac6..236b790 100644 --- a/resource_statuscaketest_test.go +++ b/resource_statuscaketest_test.go | |||
@@ -63,6 +63,7 @@ func TestAccStatusCake_withUpdate(t *testing.T) { | |||
63 | testAccTestCheckExists("statuscake_test.google", &test), | 63 | testAccTestCheckExists("statuscake_test.google", &test), |
64 | resource.TestCheckResourceAttr("statuscake_test.google", "check_rate", "500"), | 64 | resource.TestCheckResourceAttr("statuscake_test.google", "check_rate", "500"), |
65 | resource.TestCheckResourceAttr("statuscake_test.google", "paused", "true"), | 65 | resource.TestCheckResourceAttr("statuscake_test.google", "paused", "true"), |
66 | resource.TestCheckResourceAttr("statuscake_test.google", "contact_id", "23456"), | ||
66 | ), | 67 | ), |
67 | }, | 68 | }, |
68 | }, | 69 | }, |
@@ -162,20 +163,22 @@ func testAccTestCheckDestroy(test *statuscake.Test) resource.TestCheckFunc { | |||
162 | 163 | ||
163 | const testAccTestConfig_basic = ` | 164 | const testAccTestConfig_basic = ` |
164 | resource "statuscake_test" "google" { | 165 | resource "statuscake_test" "google" { |
165 | website_name = "google.com" | 166 | website_name = "google.com" |
166 | website_url = "www.google.com" | 167 | website_url = "www.google.com" |
167 | test_type = "HTTP" | 168 | test_type = "HTTP" |
168 | check_rate = 300 | 169 | check_rate = 300 |
170 | contact_id = 12345 | ||
169 | } | 171 | } |
170 | ` | 172 | ` |
171 | 173 | ||
172 | const testAccTestConfig_update = ` | 174 | const testAccTestConfig_update = ` |
173 | resource "statuscake_test" "google" { | 175 | resource "statuscake_test" "google" { |
174 | website_name = "google.com" | 176 | website_name = "google.com" |
175 | website_url = "www.google.com" | 177 | website_url = "www.google.com" |
176 | test_type = "HTTP" | 178 | test_type = "HTTP" |
177 | check_rate = 500 | 179 | check_rate = 500 |
178 | paused = true | 180 | paused = true |
181 | contact_id = 23456 | ||
179 | } | 182 | } |
180 | ` | 183 | ` |
181 | 184 | ||