diff --git a/internal/framework/flex/int_test.go b/internal/framework/flex/int_test.go index d91ab87541c..8f700842499 100644 --- a/internal/framework/flex/int_test.go +++ b/internal/framework/flex/int_test.go @@ -161,6 +161,42 @@ func TestInt32ToFramework(t *testing.T) { } } +func TestInt32ToFrameworkLegacy(t *testing.T) { + t.Parallel() + + type testCase struct { + input *int32 + expected types.Int64 + } + tests := map[string]testCase{ + "valid int64": { + input: aws.Int32(42), + expected: types.Int64Value(42), + }, + "zero int64": { + input: aws.Int32(0), + expected: types.Int64Value(0), + }, + "nil int64": { + input: nil, + expected: types.Int64Value(0), + }, + } + + for name, test := range tests { + name, test := name, test + t.Run(name, func(t *testing.T) { + t.Parallel() + + got := flex.Int32ToFrameworkLegacy(context.Background(), test.input) + + if diff := cmp.Diff(got, test.expected); diff != "" { + t.Errorf("unexpected diff (+wanted, -got): %s", diff) + } + }) + } +} + func TestInt32FromFramework(t *testing.T) { t.Parallel()