@@ -483,7 +483,7 @@ func TestGRPCProvider_ValidateListResourceConfig(t *testing.T) {
483
483
gomock .Any (),
484
484
).Return (& proto.ValidateListResourceConfig_Response {}, nil )
485
485
486
- cfg := hcl2shim .HCL2ValueFromConfigValue (map [string ]interface {}{ "config" : map [ string ] interface {}{ " filter_attr" : "value" , "nested_filter" : map [string ]interface {}{ "nested_attr" : "value" } }})
486
+ cfg := hcl2shim .HCL2ValueFromConfigValue (map [string ]any { " filter_attr" : "value" , "nested_filter" : map [string ]any { "nested_attr" : "value" }})
487
487
resp := p .ValidateListResourceConfig (providers.ValidateListResourceConfigRequest {
488
488
TypeName : "list" ,
489
489
Config : cfg ,
@@ -530,14 +530,10 @@ func TestGRPCProvider_ValidateListResourceConfig_OptionalCfg(t *testing.T) {
530
530
).Return (& proto.ValidateListResourceConfig_Response {}, nil )
531
531
532
532
converted := convert .ProtoToListSchema (sch .ListResourceSchemas ["list" ])
533
- cfg := hcl2shim .HCL2ValueFromConfigValue (map [string ]any {})
534
- coercedCfg , err := converted .Body .CoerceValue (cfg )
535
- if err != nil {
536
- t .Fatalf ("failed to coerce config: %v" , err )
537
- }
533
+ cfg := converted .Body .BlockTypes ["config" ].Block .EmptyValue ()
538
534
resp := p .ValidateListResourceConfig (providers.ValidateListResourceConfigRequest {
539
535
TypeName : "list" ,
540
- Config : coercedCfg ,
536
+ Config : cfg ,
541
537
})
542
538
checkDiags (t , resp .Diagnostics )
543
539
}
@@ -1702,11 +1698,9 @@ func TestGRPCProvider_ListResource(t *testing.T) {
1702
1698
1703
1699
// Create the request
1704
1700
configVal := cty .ObjectVal (map [string ]cty.Value {
1705
- "config" : cty .ObjectVal (map [string ]cty.Value {
1706
- "filter_attr" : cty .StringVal ("filter-value" ),
1707
- "nested_filter" : cty .ObjectVal (map [string ]cty.Value {
1708
- "nested_attr" : cty .StringVal ("value" ),
1709
- }),
1701
+ "filter_attr" : cty .StringVal ("filter-value" ),
1702
+ "nested_filter" : cty .ObjectVal (map [string ]cty.Value {
1703
+ "nested_attr" : cty .StringVal ("value" ),
1710
1704
}),
1711
1705
})
1712
1706
request := providers.ListResourceRequest {
@@ -1787,11 +1781,9 @@ func TestGRPCProvider_ListResource_Error(t *testing.T) {
1787
1781
).Return (nil , fmt .Errorf ("provider error" ))
1788
1782
1789
1783
configVal := cty .ObjectVal (map [string ]cty.Value {
1790
- "config" : cty .ObjectVal (map [string ]cty.Value {
1791
- "filter_attr" : cty .StringVal ("filter-value" ),
1792
- "nested_filter" : cty .ObjectVal (map [string ]cty.Value {
1793
- "nested_attr" : cty .StringVal ("value" ),
1794
- }),
1784
+ "filter_attr" : cty .StringVal ("filter-value" ),
1785
+ "nested_filter" : cty .ObjectVal (map [string ]cty.Value {
1786
+ "nested_attr" : cty .StringVal ("value" ),
1795
1787
}),
1796
1788
})
1797
1789
request := providers.ListResourceRequest {
@@ -1805,11 +1797,9 @@ func TestGRPCProvider_ListResource_Error(t *testing.T) {
1805
1797
1806
1798
func TestGRPCProvider_ListResource_Diagnostics (t * testing.T ) {
1807
1799
configVal := cty .ObjectVal (map [string ]cty.Value {
1808
- "config" : cty .ObjectVal (map [string ]cty.Value {
1809
- "filter_attr" : cty .StringVal ("filter-value" ),
1810
- "nested_filter" : cty .ObjectVal (map [string ]cty.Value {
1811
- "nested_attr" : cty .StringVal ("value" ),
1812
- }),
1800
+ "filter_attr" : cty .StringVal ("filter-value" ),
1801
+ "nested_filter" : cty .ObjectVal (map [string ]cty.Value {
1802
+ "nested_attr" : cty .StringVal ("value" ),
1813
1803
}),
1814
1804
})
1815
1805
request := providers.ListResourceRequest {
@@ -2071,11 +2061,9 @@ func TestGRPCProvider_ListResource_Limit(t *testing.T) {
2071
2061
2072
2062
// Create the request
2073
2063
configVal := cty .ObjectVal (map [string ]cty.Value {
2074
- "config" : cty .ObjectVal (map [string ]cty.Value {
2075
- "filter_attr" : cty .StringVal ("filter-value" ),
2076
- "nested_filter" : cty .ObjectVal (map [string ]cty.Value {
2077
- "nested_attr" : cty .StringVal ("value" ),
2078
- }),
2064
+ "filter_attr" : cty .StringVal ("filter-value" ),
2065
+ "nested_filter" : cty .ObjectVal (map [string ]cty.Value {
2066
+ "nested_attr" : cty .StringVal ("value" ),
2079
2067
}),
2080
2068
})
2081
2069
request := providers.ListResourceRequest {
0 commit comments