terraform-provider-google/google/import_pubsub_topic_test.go
Joe Selman 8ab9d96d25 Revert "Add t.Parallel to all acceptance tests (#558)"
This reverts commit 42de44592f. It appears
there might be thread-safety issues as panics have started occuring when
parallism is ramped up. Reverting for now while investigating.
2017-10-10 17:55:34 -07:00

36 lines
866 B
Go

package google
import (
"fmt"
"testing"
"github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource"
)
func TestAccPubsubTopic_import(t *testing.T) {
topicName := fmt.Sprintf("tf-test-topic-%d", acctest.RandInt())
conf := fmt.Sprintf(`
resource "google_pubsub_topic" "tf-test" {
name = "%s"
}`, topicName)
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckPubsubTopicDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: conf,
},
resource.TestStep{
ResourceName: "google_pubsub_topic.tf-test",
ImportStateId: topicName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"force_destroy"},
},
},
})
}