2017-07-28 17:49:02 +00:00
|
|
|
package google
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2017-08-01 18:14:13 +00:00
|
|
|
"github.com/hashicorp/terraform/helper/acctest"
|
2017-07-28 17:49:02 +00:00
|
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestAccComputeProjectMetadataItem_importBasic(t *testing.T) {
|
2017-10-10 23:28:00 +00:00
|
|
|
t.Parallel()
|
|
|
|
|
2017-08-01 18:14:13 +00:00
|
|
|
key := "myKey" + acctest.RandString(10)
|
|
|
|
|
2017-07-28 17:49:02 +00:00
|
|
|
resource.Test(t, resource.TestCase{
|
|
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
|
|
Providers: testAccProviders,
|
|
|
|
CheckDestroy: testAccCheckProjectMetadataItemDestroy,
|
|
|
|
Steps: []resource.TestStep{
|
|
|
|
{
|
2017-08-08 20:05:13 +00:00
|
|
|
Config: testAccProjectMetadataItem_basicWithResourceName("foobar", key, "myValue"),
|
2017-07-28 17:49:02 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ResourceName: "google_compute_project_metadata_item.foobar",
|
|
|
|
ImportState: true,
|
|
|
|
ImportStateVerify: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|