From b5d5a4f6e03b3cf0fc5f8ccb690f434aa17c68c4 Mon Sep 17 00:00:00 2001 From: Rita Zerrizuela Date: Tue, 18 Apr 2023 07:45:21 -0300 Subject: [PATCH] Fix android unit tests on `main` (#250) --- .../auth0/auth0_flutter/AuthenticationExceptionExtensions.kt | 3 --- .../auth0_flutter/AuthenticationExceptionExtensionsTest.kt | 4 +++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/auth0_flutter/android/src/main/kotlin/com/auth0/auth0_flutter/AuthenticationExceptionExtensions.kt b/auth0_flutter/android/src/main/kotlin/com/auth0/auth0_flutter/AuthenticationExceptionExtensions.kt index e8435cf0..7af5e1b8 100644 --- a/auth0_flutter/android/src/main/kotlin/com/auth0/auth0_flutter/AuthenticationExceptionExtensions.kt +++ b/auth0_flutter/android/src/main/kotlin/com/auth0/auth0_flutter/AuthenticationExceptionExtensions.kt @@ -31,6 +31,3 @@ fun AuthenticationException.toMap(): Map { if (exception.getValue("mfa_token") != null) { put("mfa_token", exception.getValue("mfa_token")!!) } } } - -val AuthenticationException.isTooManyAttempts: Boolean - get() = "too_many_attempts" == this.getCode() diff --git a/auth0_flutter/android/src/test/kotlin/com/auth0/auth0_flutter/AuthenticationExceptionExtensionsTest.kt b/auth0_flutter/android/src/test/kotlin/com/auth0/auth0_flutter/AuthenticationExceptionExtensionsTest.kt index 87e5770c..d58cb76f 100644 --- a/auth0_flutter/android/src/test/kotlin/com/auth0/auth0_flutter/AuthenticationExceptionExtensionsTest.kt +++ b/auth0_flutter/android/src/test/kotlin/com/auth0/auth0_flutter/AuthenticationExceptionExtensionsTest.kt @@ -94,7 +94,9 @@ class AuthenticationExceptionExtensionsTest { ) }, "isTooManyAttempts" to { exception: AuthenticationException -> - doReturn("too_many_attempts").`when`(exception).getCode() + `when`(exception.isTooManyAttempts).thenReturn( + true + ) }, "isVerificationRequired" to { exception: AuthenticationException -> `when`(exception.isVerificationRequired).thenReturn(