@@ -1030,6 +1030,96 @@ func TestImportedResources(t *testing.T) {
10301030 }
10311031}
10321032
1033+ func TestMoveResourceStateRequest (t * testing.T ) {
1034+ t .Parallel ()
1035+
1036+ testCases := map [string ]struct {
1037+ in * tfprotov5.MoveResourceStateRequest
1038+ expected * tfprotov6.MoveResourceStateRequest
1039+ }{
1040+ "nil" : {
1041+ in : nil ,
1042+ expected : nil ,
1043+ },
1044+ "all-valid-fields" : {
1045+ in : & tfprotov5.MoveResourceStateRequest {
1046+ SourcePrivate : testBytes ,
1047+ SourceProviderAddress : "example.com/namespace/test" ,
1048+ SourceSchemaVersion : 1 ,
1049+ SourceState : & tfprotov5.RawState {
1050+ JSON : testBytes ,
1051+ },
1052+ SourceTypeName : "test_source" ,
1053+ TargetTypeName : "test_target" ,
1054+ },
1055+ expected : & tfprotov6.MoveResourceStateRequest {
1056+ SourcePrivate : testBytes ,
1057+ SourceProviderAddress : "example.com/namespace/test" ,
1058+ SourceSchemaVersion : 1 ,
1059+ SourceState : & tfprotov6.RawState {
1060+ JSON : testBytes ,
1061+ },
1062+ SourceTypeName : "test_source" ,
1063+ TargetTypeName : "test_target" ,
1064+ },
1065+ },
1066+ }
1067+
1068+ for name , testCase := range testCases {
1069+ name , testCase := name , testCase
1070+
1071+ t .Run (name , func (t * testing.T ) {
1072+ t .Parallel ()
1073+
1074+ got := tfprotov5tov6 .MoveResourceStateRequest (testCase .in )
1075+
1076+ if diff := cmp .Diff (got , testCase .expected ); diff != "" {
1077+ t .Errorf ("unexpected difference: %s" , diff )
1078+ }
1079+ })
1080+ }
1081+ }
1082+
1083+ func TestMoveResourceStateResponse (t * testing.T ) {
1084+ t .Parallel ()
1085+
1086+ testCases := map [string ]struct {
1087+ in * tfprotov5.MoveResourceStateResponse
1088+ expected * tfprotov6.MoveResourceStateResponse
1089+ }{
1090+ "nil" : {
1091+ in : nil ,
1092+ expected : nil ,
1093+ },
1094+ "all-valid-fields" : {
1095+ in : & tfprotov5.MoveResourceStateResponse {
1096+ Diagnostics : testTfprotov5Diagnostics ,
1097+ TargetPrivate : testBytes ,
1098+ TargetState : & testTfprotov5DynamicValue ,
1099+ },
1100+ expected : & tfprotov6.MoveResourceStateResponse {
1101+ Diagnostics : testTfprotov6Diagnostics ,
1102+ TargetState : & testTfprotov6DynamicValue ,
1103+ TargetPrivate : testBytes ,
1104+ },
1105+ },
1106+ }
1107+
1108+ for name , testCase := range testCases {
1109+ name , testCase := name , testCase
1110+
1111+ t .Run (name , func (t * testing.T ) {
1112+ t .Parallel ()
1113+
1114+ got := tfprotov5tov6 .MoveResourceStateResponse (testCase .in )
1115+
1116+ if diff := cmp .Diff (got , testCase .expected ); diff != "" {
1117+ t .Errorf ("unexpected difference: %s" , diff )
1118+ }
1119+ })
1120+ }
1121+ }
1122+
10331123func TestPlanResourceChangeRequest (t * testing.T ) {
10341124 t .Parallel ()
10351125
0 commit comments