github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/builtin/providers/rabbitmq/import_user_test.go (about)

     1  package rabbitmq
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/hashicorp/terraform/helper/resource"
     7  )
     8  
     9  func TestAccUser_importBasic(t *testing.T) {
    10  	resourceName := "rabbitmq_user.test"
    11  	var user string
    12  
    13  	resource.Test(t, resource.TestCase{
    14  		PreCheck:     func() { testAccPreCheck(t) },
    15  		Providers:    testAccProviders,
    16  		CheckDestroy: testAccUserCheckDestroy(user),
    17  		Steps: []resource.TestStep{
    18  			resource.TestStep{
    19  				Config: testAccUserConfig_basic,
    20  				Check: testAccUserCheck(
    21  					resourceName, &user,
    22  				),
    23  			},
    24  
    25  			resource.TestStep{
    26  				ResourceName:            resourceName,
    27  				ImportState:             true,
    28  				ImportStateVerify:       true,
    29  				ImportStateVerifyIgnore: []string{"password"},
    30  			},
    31  		},
    32  	})
    33  }