@@ -3479,6 +3479,80 @@ func TestInvokeActionServerStream(t *testing.T) {
34793479 }
34803480}
34813481
3482+ func TestGenerateResourceConfigRequest (t * testing.T ) {
3483+ t .Parallel ()
3484+
3485+ testCases := map [string ]struct {
3486+ in * tfprotov5.GenerateResourceConfigRequest
3487+ expected * tfprotov6.GenerateResourceConfigRequest
3488+ }{
3489+ "nil" : {
3490+ in : nil ,
3491+ expected : nil ,
3492+ },
3493+ "all-valid-fields" : {
3494+ in : & tfprotov5.GenerateResourceConfigRequest {
3495+ TypeName : "test_resource" ,
3496+ State : & testTfprotov5DynamicValue ,
3497+ },
3498+ expected : & tfprotov6.GenerateResourceConfigRequest {
3499+ TypeName : "test_resource" ,
3500+ State : & testTfprotov6DynamicValue ,
3501+ },
3502+ },
3503+ }
3504+
3505+ for name , testCase := range testCases {
3506+
3507+ t .Run (name , func (t * testing.T ) {
3508+ t .Parallel ()
3509+
3510+ got := tfprotov5tov6 .GenerateResourceConfigRequest (testCase .in )
3511+
3512+ if diff := cmp .Diff (got , testCase .expected ); diff != "" {
3513+ t .Errorf ("unexpected difference: %s" , diff )
3514+ }
3515+ })
3516+ }
3517+ }
3518+
3519+ func TestGenerateResourceConfigResponse (t * testing.T ) {
3520+ t .Parallel ()
3521+
3522+ testCases := map [string ]struct {
3523+ in * tfprotov5.GenerateResourceConfigResponse
3524+ expected * tfprotov6.GenerateResourceConfigResponse
3525+ }{
3526+ "nil" : {
3527+ in : nil ,
3528+ expected : nil ,
3529+ },
3530+ "all-valid-fields" : {
3531+ in : & tfprotov5.GenerateResourceConfigResponse {
3532+ Config : & testTfprotov5DynamicValue ,
3533+ Diagnostics : testTfprotov5Diagnostics ,
3534+ },
3535+ expected : & tfprotov6.GenerateResourceConfigResponse {
3536+ Config : & testTfprotov6DynamicValue ,
3537+ Diagnostics : testTfprotov6Diagnostics ,
3538+ },
3539+ },
3540+ }
3541+
3542+ for name , testCase := range testCases {
3543+
3544+ t .Run (name , func (t * testing.T ) {
3545+ t .Parallel ()
3546+
3547+ got := tfprotov5tov6 .GenerateResourceConfigResponse (testCase .in )
3548+
3549+ if diff := cmp .Diff (got , testCase .expected ); diff != "" {
3550+ t .Errorf ("unexpected difference: %s" , diff )
3551+ }
3552+ })
3553+ }
3554+ }
3555+
34823556func pointer [T any ](value T ) * T {
34833557 return & value
34843558}
0 commit comments