github.com/mohanarpit/terraform@v0.6.16-0.20160909104007-291f29853544/builtin/providers/rabbitmq/import_vhost_test.go (about)

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