aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--resource_statuscaketest.go7
-rw-r--r--resource_statuscaketest_test.go21
2 files changed, 19 insertions, 9 deletions
diff --git a/resource_statuscaketest.go b/resource_statuscaketest.go
index 7f5ff67..53b3059 100644
--- a/resource_statuscaketest.go
+++ b/resource_statuscaketest.go
@@ -53,6 +53,10 @@ func resourceStatusCakeTest() *schema.Resource {
53 Type: schema.TypeInt, 53 Type: schema.TypeInt,
54 Computed: true, 54 Computed: true,
55 }, 55 },
56 "contact_id": &schema.Schema{
57 Type: schema.TypeInt,
58 Optional: true,
59 },
56 }, 60 },
57 } 61 }
58} 62}
@@ -151,5 +155,8 @@ func getStatusCakeTestInput(d *schema.ResourceData) *statuscake.Test {
151 if v, ok := d.GetOk("timeout"); ok { 155 if v, ok := d.GetOk("timeout"); ok {
152 test.Timeout = v.(int) 156 test.Timeout = v.(int)
153 } 157 }
158 if v, ok := d.GetOk("contact_id"); ok {
159 test.ContactID = v.(int)
160 }
154 return test 161 return test
155} 162}
diff --git a/resource_statuscaketest_test.go b/resource_statuscaketest_test.go
index bbc6932..bec1a45 100644
--- a/resource_statuscaketest_test.go
+++ b/resource_statuscaketest_test.go
@@ -49,6 +49,7 @@ func TestAccStatusCake_withUpdate(t *testing.T) {
49 testAccTestCheckExists("statuscake_test.google", &test), 49 testAccTestCheckExists("statuscake_test.google", &test),
50 resource.TestCheckResourceAttr("statuscake_test.google", "check_rate", "500"), 50 resource.TestCheckResourceAttr("statuscake_test.google", "check_rate", "500"),
51 resource.TestCheckResourceAttr("statuscake_test.google", "paused", "true"), 51 resource.TestCheckResourceAttr("statuscake_test.google", "paused", "true"),
52 resource.TestCheckResourceAttr("statuscake_test.google", "contact_id", "23456"),
52 ), 53 ),
53 }, 54 },
54 }, 55 },
@@ -97,19 +98,21 @@ func testAccTestCheckDestroy(test *statuscake.Test) resource.TestCheckFunc {
97 98
98const testAccTestConfig_basic = ` 99const testAccTestConfig_basic = `
99resource "statuscake_test" "google" { 100resource "statuscake_test" "google" {
100 website_name = "google.com" 101 website_name = "google.com"
101 website_url = "www.google.com" 102 website_url = "www.google.com"
102 test_type = "HTTP" 103 test_type = "HTTP"
103 check_rate = 300 104 check_rate = 300
105 contact_id = 12345
104} 106}
105` 107`
106 108
107const testAccTestConfig_update = ` 109const testAccTestConfig_update = `
108resource "statuscake_test" "google" { 110resource "statuscake_test" "google" {
109 website_name = "google.com" 111 website_name = "google.com"
110 website_url = "www.google.com" 112 website_url = "www.google.com"
111 test_type = "HTTP" 113 test_type = "HTTP"
112 check_rate = 500 114 check_rate = 500
113 paused = true 115 paused = true
116 contact_id = 23456
114} 117}
115` 118`