Skip to content

Commit

Permalink
test(cognito-userpool): fix tests to account for new changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ekristen committed Dec 26, 2024
1 parent 593b1c6 commit 1e64bc0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions resources/cognito-userpool_mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"testing"

"github.com/golang/mock/gomock"
"github.com/gotidy/ptr"
"github.com/stretchr/testify/assert"

"github.com/aws/aws-sdk-go/aws"
Expand Down Expand Up @@ -85,9 +86,24 @@ func Test_Mock_CognitoUserPool_Remove_DeletionProtection(t *testing.T) {

mockSvc := mock_cognitoidentityprovideriface.NewMockCognitoIdentityProviderAPI(ctrl)

mockSvc.EXPECT().DescribeUserPool(&cognitoidentityprovider.DescribeUserPoolInput{
UserPoolId: aws.String("test-pool-id"),
}).Return(&cognitoidentityprovider.DescribeUserPoolOutput{
UserPool: &cognitoidentityprovider.UserPoolType{
UserAttributeUpdateSettings: &cognitoidentityprovider.UserAttributeUpdateSettingsType{
AttributesRequireVerificationBeforeUpdate: []*string{ptr.String("email")},
},
AutoVerifiedAttributes: []*string{ptr.String("email")},
},
}, nil)

mockSvc.EXPECT().UpdateUserPool(&cognitoidentityprovider.UpdateUserPoolInput{
UserPoolId: aws.String("test-pool-id"),
DeletionProtection: aws.String("INACTIVE"),
UserAttributeUpdateSettings: &cognitoidentityprovider.UserAttributeUpdateSettingsType{
AttributesRequireVerificationBeforeUpdate: []*string{ptr.String("email")},
},
AutoVerifiedAttributes: []*string{ptr.String("email")},
}).Return(&cognitoidentityprovider.UpdateUserPoolOutput{}, nil)

mockSvc.EXPECT().DeleteUserPool(&cognitoidentityprovider.DeleteUserPoolInput{
Expand Down

0 comments on commit 1e64bc0

Please sign in to comment.