Skip to content

Commit 453d731

Browse files
committed
ImportBlockWithResourceIdentity
1 parent 90dee19 commit 453d731

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

helper/resource/importstate/examplecloud_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,18 @@ func examplecloudResource() testprovider.Resource {
7575
},
7676
),
7777
},
78+
IdentitySchemaResponse: &resource.IdentitySchemaResponse{
79+
Schema: &tfprotov6.ResourceIdentitySchema{
80+
Version: 1,
81+
IdentityAttributes: []*tfprotov6.ResourceIdentitySchemaAttribute{
82+
{
83+
Name: "id",
84+
Type: tftypes.String,
85+
RequiredForImport: true,
86+
},
87+
},
88+
},
89+
},
7890
ImportStateResponse: &resource.ImportStateResponse{
7991
State: tftypes.NewValue(
8092
tftypes.Object{

helper/resource/importstate/resource_identity_test.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"testing"
88

99
"github.com/hashicorp/terraform-plugin-go/tfprotov6"
10-
"github.com/hashicorp/terraform-plugin-go/tftypes"
1110

1211
"github.com/hashicorp/terraform-plugin-testing/internal/testing/testprovider"
1312
"github.com/hashicorp/terraform-plugin-testing/internal/testing/testsdk/providerserver"
@@ -28,18 +27,6 @@ func Test_ResourceIdentity(t *testing.T) {
2827
Resources: map[string]testprovider.Resource{
2928
"examplecloud_container": examplecloudResource(),
3029
},
31-
ResourceIdentitySchemas: map[string]*tfprotov6.ResourceIdentitySchema{
32-
"examplecloud_container": {
33-
Version: 1,
34-
IdentityAttributes: []*tfprotov6.ResourceIdentitySchemaAttribute{
35-
{
36-
Name: "id",
37-
Type: tftypes.String,
38-
RequiredForImport: true,
39-
},
40-
},
41-
},
42-
},
4330
}),
4431
},
4532
Steps: []r.TestStep{

0 commit comments

Comments
 (0)