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

     1  package rabbitmq
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/michaelklishin/rabbit-hole"
     7  
     8  	"github.com/hashicorp/terraform/helper/resource"
     9  )
    10  
    11  func TestAccQueue_importBasic(t *testing.T) {
    12  	resourceName := "rabbitmq_queue.test"
    13  	var queue rabbithole.QueueInfo
    14  
    15  	resource.Test(t, resource.TestCase{
    16  		PreCheck:     func() { testAccPreCheck(t) },
    17  		Providers:    testAccProviders,
    18  		CheckDestroy: testAccQueueCheckDestroy(&queue),
    19  		Steps: []resource.TestStep{
    20  			resource.TestStep{
    21  				Config: testAccQueueConfig_basic,
    22  				Check: testAccQueueCheck(
    23  					resourceName, &queue,
    24  				),
    25  			},
    26  
    27  			resource.TestStep{
    28  				ResourceName:      resourceName,
    29  				ImportState:       true,
    30  				ImportStateVerify: true,
    31  			},
    32  		},
    33  	})
    34  }