Skip to content

Commit

Permalink
Address testResendCode comment and situation
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuki-YuXin committed Nov 21, 2024
1 parent 6a1710d commit 242b66c
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,18 @@ class SignUpEmailOTPTest : NativeAuthPublicClientApplicationAnotherAbstractTest(
config = getConfig(defaultConfigType)
application = setupPCA(config, defaultChallengeTypes)

runBlocking { // Running with runBlocking to avoid default 10 second execution timeout.
val user = tempEmailApi.generateRandomEmailAddress()
val signUpResult = application.signUp(user)
assertResult<SignUpResult.CodeRequired>(signUpResult)
val codeRequiredState = (signUpResult as SignUpResult.CodeRequired).nextState
val resendCodeResult = codeRequiredState.resendCode()
assertResult<SignUpResendCodeResult.Success>(resendCodeResult)
retryOperation {
runBlocking { // Running with runBlocking to avoid default 10 second execution timeout.
val user = tempEmailApi.generateRandomEmailAddress()
val signUpResult = application.signUp(user)
assertResult<SignUpResult.CodeRequired>(signUpResult)
val otp1 = tempEmailApi.retrieveCodeFromInbox(user)
val codeRequiredState = (signUpResult as SignUpResult.CodeRequired).nextState
val resendCodeResult = codeRequiredState.resendCode()
assertResult<SignUpResendCodeResult.Success>(resendCodeResult)
val otp2 = tempEmailApi.retrieveCodeFromInbox(user)
Assert.assertNotEquals(otp1, otp2)
}
}
}

Expand Down

0 comments on commit 242b66c

Please sign in to comment.