Skip to content

Commit d840069

Browse files
committed
add identity state check for readability
1 parent 00b76f4 commit d840069

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

helper/resource/importstate/import_block_with_resource_identity_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import (
1111

1212
"github.com/hashicorp/terraform-plugin-testing/internal/testing/testprovider"
1313
"github.com/hashicorp/terraform-plugin-testing/internal/testing/testsdk/providerserver"
14+
"github.com/hashicorp/terraform-plugin-testing/knownvalue"
15+
"github.com/hashicorp/terraform-plugin-testing/statecheck"
1416
"github.com/hashicorp/terraform-plugin-testing/tfversion"
1517

1618
r "github.com/hashicorp/terraform-plugin-testing/helper/resource"
@@ -68,6 +70,12 @@ func TestImportBlock_WithResourceIdentity_NullAttribute(t *testing.T) {
6870
location = "westeurope"
6971
name = "somevalue"
7072
}`,
73+
ConfigStateChecks: []statecheck.StateCheck{
74+
statecheck.ExpectIdentity("examplecloud_container.test", map[string]knownvalue.Check{
75+
"id": knownvalue.StringExact("westeurope/somevalue"),
76+
"value_we_dont_always_need": knownvalue.Null(), // This value will not be brought over to import config
77+
}),
78+
},
7179
},
7280
{
7381
ResourceName: "examplecloud_container.test",

0 commit comments

Comments
 (0)