diff options
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] |