@@ -483,7 +483,7 @@ func TestGRPCProvider_ValidateListResourceConfig(t *testing.T) {
483483 gomock .Any (),
484484 ).Return (& proto.ValidateListResourceConfig_Response {}, nil )
485485
486- cfg := hcl2shim .HCL2ValueFromConfigValue (map [string ]interface {}{"config" : map [string ]interface {}{"filter_attr" : "value" }})
486+ cfg := hcl2shim .HCL2ValueFromConfigValue (map [string ]interface {}{"config" : map [string ]interface {}{"filter_attr" : "value" , "nested_filter" : map [ string ] interface {}{ "nested_attr" : "value" } }})
487487 resp := p .ValidateListResourceConfig (providers.ValidateListResourceConfigRequest {
488488 TypeName : "list" ,
489489 Config : cfg ,
@@ -495,8 +495,12 @@ func TestGRPCProvider_ValidateListResourceConfig_OptionalCfg(t *testing.T) {
495495 ctrl := gomock .NewController (t )
496496 client := mockproto .NewMockProviderClient (ctrl )
497497 sch := providerProtoSchema ()
498+
499+ // mock the schema in a way that makes the config attributes optional
498500 sch .ListResourceSchemas ["list" ].Block .Attributes [0 ].Optional = true
499501 sch .ListResourceSchemas ["list" ].Block .Attributes [0 ].Required = false
502+ sch .ListResourceSchemas ["list" ].Block .BlockTypes [0 ].MinItems = 0
503+ sch .ListResourceSchemas ["list" ].Block .BlockTypes [0 ].MaxItems = 0
500504 // we always need a GetSchema method
501505 client .EXPECT ().GetSchema (
502506 gomock .Any (),
@@ -1689,6 +1693,9 @@ func TestGRPCProvider_ListResource(t *testing.T) {
16891693 configVal := cty .ObjectVal (map [string ]cty.Value {
16901694 "config" : cty .ObjectVal (map [string ]cty.Value {
16911695 "filter_attr" : cty .StringVal ("filter-value" ),
1696+ "nested_filter" : cty .ObjectVal (map [string ]cty.Value {
1697+ "nested_attr" : cty .StringVal ("value" ),
1698+ }),
16921699 }),
16931700 })
16941701 request := providers.ListResourceRequest {
@@ -2055,6 +2062,9 @@ func TestGRPCProvider_ListResource_Limit(t *testing.T) {
20552062 configVal := cty .ObjectVal (map [string ]cty.Value {
20562063 "config" : cty .ObjectVal (map [string ]cty.Value {
20572064 "filter_attr" : cty .StringVal ("filter-value" ),
2065+ "nested_filter" : cty .ObjectVal (map [string ]cty.Value {
2066+ "nested_attr" : cty .StringVal ("value" ),
2067+ }),
20582068 }),
20592069 })
20602070 request := providers.ListResourceRequest {
0 commit comments