diff options
author | Mat Schaffer <mat@schaffer.me> | 2019-06-13 14:59:37 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-13 14:59:37 +0900 |
commit | ccbb72b7349103fd7e39a47a2ec5312bcc00017f (patch) | |
tree | 624507dffe7152bd846495fcd08be7f7cee4dab2 /statuscake/resource_statuscaketest_test.go | |
parent | 3cd2d4f34aefe6090b287b2b4c26049819414e46 (diff) | |
parent | 23a4886b56d32dce724d4e6cac2cd0be4fca7743 (diff) | |
download | terraform-provider-statuscake-ccbb72b7349103fd7e39a47a2ec5312bcc00017f.tar.gz terraform-provider-statuscake-ccbb72b7349103fd7e39a47a2ec5312bcc00017f.tar.zst terraform-provider-statuscake-ccbb72b7349103fd7e39a47a2ec5312bcc00017f.zip |
Merge pull request #34 from jcalonso/fix/contact-group-backwards-compatible
Add support back for contact_id and mark it as deprecated
Diffstat (limited to 'statuscake/resource_statuscaketest_test.go')
-rw-r--r-- | statuscake/resource_statuscaketest_test.go | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/statuscake/resource_statuscaketest_test.go b/statuscake/resource_statuscaketest_test.go index 0ea1e2b..bd609d8 100644 --- a/statuscake/resource_statuscaketest_test.go +++ b/statuscake/resource_statuscaketest_test.go | |||
@@ -30,6 +30,25 @@ func TestAccStatusCake_basic(t *testing.T) { | |||
30 | }) | 30 | }) |
31 | } | 31 | } |
32 | 32 | ||
33 | func TestAccStatusCake_basic_deprecated_contact_ID(t *testing.T) { | ||
34 | var test statuscake.Test | ||
35 | |||
36 | resource.Test(t, resource.TestCase{ | ||
37 | PreCheck: func() { testAccPreCheck(t) }, | ||
38 | Providers: testAccProviders, | ||
39 | CheckDestroy: testAccTestCheckDestroy(&test), | ||
40 | Steps: []resource.TestStep{ | ||
41 | { | ||
42 | Config: interpolateTerraformTemplate(testAccTestConfig_deprecated), | ||
43 | Check: resource.ComposeTestCheckFunc( | ||
44 | testAccTestCheckExists("statuscake_test.google", &test), | ||
45 | testAccTestCheckAttributes("statuscake_test.google", &test), | ||
46 | ), | ||
47 | }, | ||
48 | }, | ||
49 | }) | ||
50 | } | ||
51 | |||
33 | func TestAccStatusCake_tcp(t *testing.T) { | 52 | func TestAccStatusCake_tcp(t *testing.T) { |
34 | var test statuscake.Test | 53 | var test statuscake.Test |
35 | 54 | ||
@@ -239,7 +258,18 @@ resource "statuscake_test" "google" { | |||
239 | trigger_rate = 10 | 258 | trigger_rate = 10 |
240 | } | 259 | } |
241 | ` | 260 | ` |
242 | 261 | const testAccTestConfig_deprecated = ` | |
262 | resource "statuscake_test" "google" { | ||
263 | website_name = "google.com" | ||
264 | website_url = "www.google.com" | ||
265 | test_type = "HTTP" | ||
266 | check_rate = 300 | ||
267 | timeout = 10 | ||
268 | contact_id = %s | ||
269 | confirmations = 1 | ||
270 | trigger_rate = 10 | ||
271 | } | ||
272 | ` | ||
243 | const testAccTestConfig_update = ` | 273 | const testAccTestConfig_update = ` |
244 | resource "statuscake_test" "google" { | 274 | resource "statuscake_test" "google" { |
245 | website_name = "google.com" | 275 | website_name = "google.com" |