github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/builtin/providers/opsgenie/import_opsgenie_user_test.go (about)

     1  package opsgenie
     2  
     3  import (
     4  	"testing"
     5  
     6  	"fmt"
     7  
     8  	"github.com/hashicorp/terraform/helper/acctest"
     9  	"github.com/hashicorp/terraform/helper/resource"
    10  )
    11  
    12  func TestAccOpsGenieUser_importBasic(t *testing.T) {
    13  	resourceName := "opsgenie_user.test"
    14  
    15  	ri := acctest.RandInt()
    16  	config := fmt.Sprintf(testAccOpsGenieUser_basic, ri)
    17  
    18  	resource.Test(t, resource.TestCase{
    19  		PreCheck:     func() { testAccPreCheck(t) },
    20  		Providers:    testAccProviders,
    21  		CheckDestroy: testCheckOpsGenieUserDestroy,
    22  		Steps: []resource.TestStep{
    23  			{
    24  				Config: config,
    25  			},
    26  
    27  			{
    28  				ResourceName:      resourceName,
    29  				ImportState:       true,
    30  				ImportStateVerify: true,
    31  			},
    32  		},
    33  	})
    34  }
    35  
    36  func TestAccOpsGenieUser_importComplete(t *testing.T) {
    37  	resourceName := "opsgenie_user.test"
    38  
    39  	ri := acctest.RandInt()
    40  	config := fmt.Sprintf(testAccOpsGenieUser_complete, ri)
    41  
    42  	resource.Test(t, resource.TestCase{
    43  		PreCheck:     func() { testAccPreCheck(t) },
    44  		Providers:    testAccProviders,
    45  		CheckDestroy: testCheckOpsGenieUserDestroy,
    46  		Steps: []resource.TestStep{
    47  			{
    48  				Config: config,
    49  			},
    50  
    51  			{
    52  				ResourceName:      resourceName,
    53  				ImportState:       true,
    54  				ImportStateVerify: true,
    55  			},
    56  		},
    57  	})
    58  }