aboutsummaryrefslogtreecommitdiffhomepage
path: root/statuscake/resource_statuscaketest_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'statuscake/resource_statuscaketest_test.go')
-rw-r--r--statuscake/resource_statuscaketest_test.go35
1 files changed, 7 insertions, 28 deletions
diff --git a/statuscake/resource_statuscaketest_test.go b/statuscake/resource_statuscaketest_test.go
index b727e92..da3a349 100644
--- a/statuscake/resource_statuscaketest_test.go
+++ b/statuscake/resource_statuscaketest_test.go
@@ -19,7 +19,7 @@ func TestAccStatusCake_basic(t *testing.T) {
19 CheckDestroy: testAccTestCheckDestroy(&test), 19 CheckDestroy: testAccTestCheckDestroy(&test),
20 Steps: []resource.TestStep{ 20 Steps: []resource.TestStep{
21 { 21 {
22 Config: testAccTestConfig_basic, 22 Config: fmt.Sprintf(testAccTestConfig_basic, testContactGroupId),
23 Check: resource.ComposeTestCheckFunc( 23 Check: resource.ComposeTestCheckFunc(
24 testAccTestCheckExists("statuscake_test.google", &test), 24 testAccTestCheckExists("statuscake_test.google", &test),
25 testAccTestCheckAttributes("statuscake_test.google", &test), 25 testAccTestCheckAttributes("statuscake_test.google", &test),
@@ -38,7 +38,7 @@ func TestAccStatusCake_tcp(t *testing.T) {
38 CheckDestroy: testAccTestCheckDestroy(&test), 38 CheckDestroy: testAccTestCheckDestroy(&test),
39 Steps: []resource.TestStep{ 39 Steps: []resource.TestStep{
40 { 40 {
41 Config: testAccTestConfig_tcp, 41 Config: fmt.Sprintf(testAccTestConfig_tcp, testContactGroupId),
42 Check: resource.ComposeTestCheckFunc( 42 Check: resource.ComposeTestCheckFunc(
43 testAccTestCheckExists("statuscake_test.google", &test), 43 testAccTestCheckExists("statuscake_test.google", &test),
44 testAccTestCheckAttributes("statuscake_test.google", &test), 44 testAccTestCheckAttributes("statuscake_test.google", &test),
@@ -57,7 +57,7 @@ func TestAccStatusCake_withUpdate(t *testing.T) {
57 CheckDestroy: testAccTestCheckDestroy(&test), 57 CheckDestroy: testAccTestCheckDestroy(&test),
58 Steps: []resource.TestStep{ 58 Steps: []resource.TestStep{
59 { 59 {
60 Config: testAccTestConfig_basic, 60 Config: fmt.Sprintf(testAccTestConfig_basic, testContactGroupId),
61 Check: resource.ComposeTestCheckFunc( 61 Check: resource.ComposeTestCheckFunc(
62 testAccTestCheckExists("statuscake_test.google", &test), 62 testAccTestCheckExists("statuscake_test.google", &test),
63 ), 63 ),
@@ -76,12 +76,9 @@ func TestAccStatusCake_withUpdate(t *testing.T) {
76 resource.TestCheckResourceAttr("statuscake_test.google", "trigger_rate", "20"), 76 resource.TestCheckResourceAttr("statuscake_test.google", "trigger_rate", "20"),
77 resource.TestCheckResourceAttr("statuscake_test.google", "custom_header", "{ \"Content-Type\": \"application/x-www-form-urlencoded\" }"), 77 resource.TestCheckResourceAttr("statuscake_test.google", "custom_header", "{ \"Content-Type\": \"application/x-www-form-urlencoded\" }"),
78 resource.TestCheckResourceAttr("statuscake_test.google", "user_agent", "string9988"), 78 resource.TestCheckResourceAttr("statuscake_test.google", "user_agent", "string9988"),
79 resource.TestCheckResourceAttr("statuscake_test.google", "status", "string22117"), 79 resource.TestCheckResourceAttr("statuscake_test.google", "status", "Up"),
80 resource.TestCheckResourceAttr("statuscake_test.google", "uptime", "3498.27"), 80 resource.TestCheckResourceAttr("statuscake_test.google", "uptime", "0"),
81 resource.TestCheckResourceAttr("statuscake_test.google", "node_locations.#", "3"), 81 resource.TestCheckResourceAttr("statuscake_test.google", "node_locations.#", "3"),
82 resource.TestCheckResourceAttr("statuscake_test.google", "node_locations.0", "string16045"),
83 resource.TestCheckResourceAttr("statuscake_test.google", "node_locations.1", "string19741"),
84 resource.TestCheckResourceAttr("statuscake_test.google", "node_locations.2", "string12122"),
85 resource.TestCheckResourceAttr("statuscake_test.google", "ping_url", "string8410"), 82 resource.TestCheckResourceAttr("statuscake_test.google", "ping_url", "string8410"),
86 resource.TestCheckResourceAttr("statuscake_test.google", "basic_user", "string27052"), 83 resource.TestCheckResourceAttr("statuscake_test.google", "basic_user", "string27052"),
87 resource.TestCheckResourceAttr("statuscake_test.google", "basic_pass", "string5659"), 84 resource.TestCheckResourceAttr("statuscake_test.google", "basic_pass", "string5659"),
@@ -169,8 +166,6 @@ func testAccTestCheckAttributes(rn string, test *statuscake.Test) resource.TestC
169 err = check(key, value, strconv.Itoa(test.TriggerRate)) 166 err = check(key, value, strconv.Itoa(test.TriggerRate))
170 case "custom_header": 167 case "custom_header":
171 err = check(key, value, test.CustomHeader) 168 err = check(key, value, test.CustomHeader)
172 case "user_agent":
173 err = check(key, value, test.UserAgent)
174 case "node_locations": 169 case "node_locations":
175 for _, tv := range test.NodeLocations { 170 for _, tv := range test.NodeLocations {
176 err = check(key, value, tv) 171 err = check(key, value, tv)
@@ -178,30 +173,14 @@ func testAccTestCheckAttributes(rn string, test *statuscake.Test) resource.TestC
178 return err 173 return err
179 } 174 }
180 } 175 }
181 case "ping_url":
182 err = check(key, value, test.PingURL)
183 case "basic_user":
184 err = check(key, value, test.BasicUser)
185 case "basic_pass":
186 err = check(key, value, test.BasicPass)
187 case "public": 176 case "public":
188 err = check(key, value, strconv.Itoa(test.Public)) 177 err = check(key, value, strconv.Itoa(test.Public))
189 case "logo_image": 178 case "logo_image":
190 err = check(key, value, test.LogoImage) 179 err = check(key, value, test.LogoImage)
191 case "branding":
192 err = check(key, value, strconv.Itoa(test.Branding))
193 case "website_host":
194 err = check(key, value, test.WebsiteHost)
195 case "virus":
196 err = check(key, value, strconv.Itoa(test.Virus))
197 case "find_string": 180 case "find_string":
198 err = check(key, value, test.FindString) 181 err = check(key, value, test.FindString)
199 case "do_not_find": 182 case "do_not_find":
200 err = check(key, value, strconv.FormatBool(test.DoNotFind)) 183 err = check(key, value, strconv.FormatBool(test.DoNotFind))
201 case "real_browser":
202 err = check(key, value, strconv.Itoa(test.RealBrowser))
203 case "test_tags":
204 err = check(key, value, test.TestTags)
205 case "status_codes": 184 case "status_codes":
206 err = check(key, value, test.StatusCodes) 185 err = check(key, value, test.StatusCodes)
207 case "use_jar": 186 case "use_jar":
@@ -240,7 +219,7 @@ resource "statuscake_test" "google" {
240 test_type = "HTTP" 219 test_type = "HTTP"
241 check_rate = 300 220 check_rate = 300
242 timeout = 10 221 timeout = 10
243 contact_id = 43402 222 contact_id = %d
244 confirmations = 1 223 confirmations = 1
245 trigger_rate = 10 224 trigger_rate = 10
246} 225}
@@ -284,7 +263,7 @@ resource "statuscake_test" "google" {
284 test_type = "TCP" 263 test_type = "TCP"
285 check_rate = 300 264 check_rate = 300
286 timeout = 10 265 timeout = 10
287 contact_id = 43402 266 contact_id = %d
288 confirmations = 1 267 confirmations = 1
289 port = 80 268 port = 80
290} 269}