diff options
author | Alexandre Garand <alexandre.garand@fretlink.com> | 2019-07-08 16:56:30 +0200 |
---|---|---|
committer | Alexandre Garand <alexandre.garand@fretlink.com> | 2019-07-08 16:56:30 +0200 |
commit | 70ac6365eecfb6a88f56a46b9b7d685e6726e43c (patch) | |
tree | 4b6428992c72eb51c5bf51198f59e8ae2190ae54 /mailgun/resource_mailgun_route_test.go | |
parent | 7cbb92efb5e84de877976830ee04798c1cc808b8 (diff) | |
download | terraform-provider-mailgun-70ac6365eecfb6a88f56a46b9b7d685e6726e43c.tar.gz terraform-provider-mailgun-70ac6365eecfb6a88f56a46b9b7d685e6726e43c.tar.zst terraform-provider-mailgun-70ac6365eecfb6a88f56a46b9b7d685e6726e43c.zip |
add test for importation and fix importation for domain
Diffstat (limited to 'mailgun/resource_mailgun_route_test.go')
-rw-r--r-- | mailgun/resource_mailgun_route_test.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/mailgun/resource_mailgun_route_test.go b/mailgun/resource_mailgun_route_test.go index 2d7b221..02d552a 100644 --- a/mailgun/resource_mailgun_route_test.go +++ b/mailgun/resource_mailgun_route_test.go | |||
@@ -57,6 +57,29 @@ func TestAccMailgunRoute_withUpdate(t *testing.T) { | |||
57 | }) | 57 | }) |
58 | } | 58 | } |
59 | 59 | ||
60 | func TestRoute_importBasic(t *testing.T) { | ||
61 | var route mailgun.Route | ||
62 | |||
63 | resource.Test(t, resource.TestCase{ | ||
64 | PreCheck: func() { testAccPreCheck(t) }, | ||
65 | Providers: testAccProviders, | ||
66 | CheckDestroy: testAccRouteCheckDestroy(&route), | ||
67 | Steps: []resource.TestStep{ | ||
68 | { | ||
69 | Config: testAccRouteConfig_basic, | ||
70 | Check: resource.ComposeTestCheckFunc( | ||
71 | testAccRouteCheckExists("mailgun_route.exemple",&route), | ||
72 | ), | ||
73 | }, | ||
74 | { | ||
75 | ResourceName: "mailgun_route.exemple", | ||
76 | ImportState: true, | ||
77 | ImportStateVerify: true, | ||
78 | }, | ||
79 | }, | ||
80 | }) | ||
81 | } | ||
82 | |||
60 | func testAccRouteCheckExists(rn string, route *mailgun.Route) resource.TestCheckFunc { | 83 | func testAccRouteCheckExists(rn string, route *mailgun.Route) resource.TestCheckFunc { |
61 | return func(s *terraform.State) error { | 84 | return func(s *terraform.State) error { |
62 | rs, ok := s.RootModule().Resources[rn] | 85 | rs, ok := s.RootModule().Resources[rn] |