Skip to content

Commit 1298559

Browse files
committed
fixup! fixup! ImportPlanVerify
1 parent 8ce772e commit 1298559

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Copyright (c) HashiCorp, Inc.
2+
// SPDX-License-Identifier: MPL-2.0
3+
4+
package importstate_test
5+
6+
import (
7+
"testing"
8+
9+
"github.com/hashicorp/terraform-plugin-go/tfprotov6"
10+
11+
"github.com/hashicorp/terraform-plugin-testing/internal/testing/testprovider"
12+
"github.com/hashicorp/terraform-plugin-testing/internal/testing/testsdk/providerserver"
13+
"github.com/hashicorp/terraform-plugin-testing/tfversion"
14+
15+
r "github.com/hashicorp/terraform-plugin-testing/helper/resource"
16+
)
17+
18+
func Test_ImportBlock_VerifyPlan(t *testing.T) {
19+
t.Parallel()
20+
21+
r.UnitTest(t, r.TestCase{
22+
TerraformVersionChecks: []tfversion.TerraformVersionCheck{
23+
tfversion.SkipBelow(tfversion.Version1_5_0), // ImportBlockWithID requires Terraform 1.5.0 or later
24+
},
25+
ProtoV6ProviderFactories: map[string]func() (tfprotov6.ProviderServer, error){
26+
"examplecloud": providerserver.NewProviderServer(testprovider.Provider{
27+
Resources: map[string]testprovider.Resource{
28+
"examplecloud_container": examplecloudResource(),
29+
},
30+
}),
31+
},
32+
Steps: []r.TestStep{
33+
{
34+
Config: `
35+
resource "examplecloud_container" "test" {
36+
location = "westeurope"
37+
name = "somevalue"
38+
}`,
39+
},
40+
{
41+
ResourceName: "examplecloud_container.test",
42+
ImportState: true,
43+
ImportStateKind: r.ImportBlockWithID,
44+
ImportPlanVerify: true,
45+
},
46+
},
47+
})
48+
}

0 commit comments

Comments
 (0)