diff options
author | alexandreFre <51956137+alexandreFre@users.noreply.github.com> | 2019-07-09 10:32:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-09 10:32:31 +0200 |
commit | dbbb014f494c502d8ac26437acd02412ee275b5a (patch) | |
tree | 57d42534000bfd9b7f1f73a3af62343d4a3a94a3 /mailgun/resource_mailgun_route_test.go | |
parent | 1b47892a9bef231b3e54c40345ae23a4b3b701e0 (diff) | |
parent | b8802d62b2dcaad11d846bde7306b74f49263e5e (diff) | |
download | terraform-provider-mailgun-dbbb014f494c502d8ac26437acd02412ee275b5a.tar.gz terraform-provider-mailgun-dbbb014f494c502d8ac26437acd02412ee275b5a.tar.zst terraform-provider-mailgun-dbbb014f494c502d8ac26437acd02412ee275b5a.zip |
Merge pull request #14 from alexandreFre/add_import_test
Add test for importation
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] |