Skip to content

Commit ae4d682

Browse files
committed
chore: Fix an integration test edge case while testing MFA/OTP codes
1 parent 08da562 commit ae4d682

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

aws-auth-cognito/src/androidTest/java/com/amplifyframework/auth/cognito/AWSCognitoAuthPluginEmailMFATests.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ class AWSCognitoAuthPluginEmailMFATests {
7575
{ println("====== Subscription Established ======") },
7676
{
7777
println("====== Received some MFA Info ======")
78-
mfaCode = it.data.code
79-
latch?.countDown()
78+
if (it.data.username == userName) {
79+
mfaCode = it.data.code
80+
latch?.countDown()
81+
}
8082
},
8183
{ println("====== Subscription Failed $it ======") },
8284
{ }

aws-auth-cognito/src/androidTest/java/com/amplifyframework/auth/cognito/AWSCognitoAuthPluginUserAuthTests.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ class AWSCognitoAuthPluginUserAuthTests {
8989
{ println("====== Subscription Established ======") },
9090
{
9191
println("====== Received some MFA Info ======")
92-
otpCode = it.data.code
93-
latch?.countDown()
92+
if (it.data.username == userName) {
93+
otpCode = it.data.code
94+
latch?.countDown()
95+
}
9496
},
9597
{ println("====== Subscription Failed $it ======") },
9698
{ }

0 commit comments

Comments
 (0)