Skip to content

Commit 507f0c9

Browse files
committed
Fixed the failing test
1 parent c8eb947 commit 507f0c9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

auth0/src/test/java/com/auth0/android/provider/WebAuthProviderTest.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2901,19 +2901,21 @@ public class WebAuthProviderTest {
29012901
intentCaptor.firstValue.getParcelableExtra<Uri>(AuthenticationActivity.EXTRA_AUTHORIZE_URI)
29022902
assertThat(firstUri, `is`(notNullValue()))
29032903
assertThat(firstUri, UriMatchers.hasParamWithName("dpop_jkt"))
2904+
assertThat(firstUri?.getQueryParameter("scope"), `is`("openid profile"))
29042905

2905-
// Reset the manager instance to simulate a fresh login flow
2906+
// Reset the manager instance and captor for the second call
29062907
WebAuthProvider.resetManagerInstance()
29072908

2908-
// Second login WITHOUT DPoP - should not have dpop_jkt
29092909
login(account)
29102910
.withScope("openid email")
29112911
.start(activity, callback)
29122912

2913+
// Verify second startActivity call
29132914
verify(activity, times(2)).startActivity(intentCaptor.capture())
29142915
val secondUri =
2915-
intentCaptor.allValues[1].getParcelableExtra<Uri>(AuthenticationActivity.EXTRA_AUTHORIZE_URI)
2916+
intentCaptor.lastValue.getParcelableExtra<Uri>(AuthenticationActivity.EXTRA_AUTHORIZE_URI)
29162917
assertThat(secondUri, `is`(notNullValue()))
2918+
assertThat(secondUri?.getQueryParameter("scope"), `is`("openid email"))
29172919
assertThat(secondUri, not(UriMatchers.hasParamWithName("dpop_jkt")))
29182920
}
29192921

0 commit comments

Comments
 (0)