aboutsummaryrefslogtreecommitdiffhomepage
path: root/resource_statuscaketest.go
diff options
context:
space:
mode:
authorstack72 <public@paulstack.co.uk>2015-10-08 15:36:11 +0100
committerstack72 <public@paulstack.co.uk>2015-11-27 15:03:13 +0000
commit4eeeab6482a659f2a3c4077a38bb3c83967666ac (patch)
treec95f8cce5f85acca80faac104130dd3e55dc83f8 /resource_statuscaketest.go
parent32574941630dadbe86b887c174e1b7bcfd9580c1 (diff)
downloadterraform-provider-statuscake-4eeeab6482a659f2a3c4077a38bb3c83967666ac.tar.gz
terraform-provider-statuscake-4eeeab6482a659f2a3c4077a38bb3c83967666ac.tar.zst
terraform-provider-statuscake-4eeeab6482a659f2a3c4077a38bb3c83967666ac.zip
Added some acceptance tests for the statuscake provider
Diffstat (limited to 'resource_statuscaketest.go')
-rw-r--r--resource_statuscaketest.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/resource_statuscaketest.go b/resource_statuscaketest.go
index 17488a5..7f5ff67 100644
--- a/resource_statuscaketest.go
+++ b/resource_statuscaketest.go
@@ -6,7 +6,7 @@ import (
6 6
7 "log" 7 "log"
8 8
9 wtf "github.com/DreamItGetIT/statuscake" 9 "github.com/DreamItGetIT/statuscake"
10 "github.com/hashicorp/terraform/helper/schema" 10 "github.com/hashicorp/terraform/helper/schema"
11) 11)
12 12
@@ -58,9 +58,9 @@ func resourceStatusCakeTest() *schema.Resource {
58} 58}
59 59
60func CreateTest(d *schema.ResourceData, meta interface{}) error { 60func CreateTest(d *schema.ResourceData, meta interface{}) error {
61 client := meta.(*wtf.Client) 61 client := meta.(*statuscake.Client)
62 62
63 newTest := &wtf.Test{ 63 newTest := &statuscake.Test{
64 WebsiteName: d.Get("website_name").(string), 64 WebsiteName: d.Get("website_name").(string),
65 WebsiteURL: d.Get("website_url").(string), 65 WebsiteURL: d.Get("website_url").(string),
66 TestType: d.Get("test_type").(string), 66 TestType: d.Get("test_type").(string),
@@ -81,7 +81,7 @@ func CreateTest(d *schema.ResourceData, meta interface{}) error {
81} 81}
82 82
83func UpdateTest(d *schema.ResourceData, meta interface{}) error { 83func UpdateTest(d *schema.ResourceData, meta interface{}) error {
84 client := meta.(*wtf.Client) 84 client := meta.(*statuscake.Client)
85 85
86 params := getStatusCakeTestInput(d) 86 params := getStatusCakeTestInput(d)
87 87
@@ -94,7 +94,7 @@ func UpdateTest(d *schema.ResourceData, meta interface{}) error {
94} 94}
95 95
96func DeleteTest(d *schema.ResourceData, meta interface{}) error { 96func DeleteTest(d *schema.ResourceData, meta interface{}) error {
97 client := meta.(*wtf.Client) 97 client := meta.(*statuscake.Client)
98 98
99 testId, parseErr := strconv.Atoi(d.Id()) 99 testId, parseErr := strconv.Atoi(d.Id())
100 if parseErr != nil { 100 if parseErr != nil {
@@ -110,7 +110,7 @@ func DeleteTest(d *schema.ResourceData, meta interface{}) error {
110} 110}
111 111
112func ReadTest(d *schema.ResourceData, meta interface{}) error { 112func ReadTest(d *schema.ResourceData, meta interface{}) error {
113 client := meta.(*wtf.Client) 113 client := meta.(*statuscake.Client)
114 114
115 testId, parseErr := strconv.Atoi(d.Id()) 115 testId, parseErr := strconv.Atoi(d.Id())
116 if parseErr != nil { 116 if parseErr != nil {
@@ -125,12 +125,12 @@ func ReadTest(d *schema.ResourceData, meta interface{}) error {
125 return nil 125 return nil
126} 126}
127 127
128func getStatusCakeTestInput(d *schema.ResourceData) *wtf.Test { 128func getStatusCakeTestInput(d *schema.ResourceData) *statuscake.Test {
129 testId, parseErr := strconv.Atoi(d.Id()) 129 testId, parseErr := strconv.Atoi(d.Id())
130 if parseErr != nil { 130 if parseErr != nil {
131 log.Printf("[DEBUG] Error Parsing StatusCake TestID: %s", d.Id()) 131 log.Printf("[DEBUG] Error Parsing StatusCake TestID: %s", d.Id())
132 } 132 }
133 test := &wtf.Test{ 133 test := &statuscake.Test{
134 TestID: testId, 134 TestID: testId,
135 } 135 }
136 if v, ok := d.GetOk("website_name"); ok { 136 if v, ok := d.GetOk("website_name"); ok {