Commit 261f874
committed
@W-21933885: [MSDK Android] App Attestation Implementation (Fix IDPAuthCodeHelperTest Attestation Tests Missing OAuth2 Mock)
Fixed two tests that were timing out with UncompletedCoroutinesError:
- idpAuthCodeHelper_getAuthorizationPathForSP_whenAttestationClientReturnsAttestation_includesAttestationInQuery
- idpAuthCodeHelper_getAuthorizationPathForSP_whenCreateAppAttestationReturnsNull_excludesAttestationFromQuery
Root cause: Both tests were calling the real OAuth2.getAuthorizationUrl() static
method instead of a mock, causing the test coroutine to hang and timeout after 1 minute.
Resolution: Added stubOAuthAuthorizationUrl() calls in both tests to properly mock
OAuth2.getAuthorizationUrl() before calling getAuthorizationPathForSP(). The first
test now returns a URI with attestation parameter, the second returns a URI without.
This follows the same pattern used in other tests in this file that mock the OAuth2
static method before invoking code that depends on it.1 parent 8a60818 commit 261f874
1 file changed
Lines changed: 13 additions & 1 deletion
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
| |||
105 | 107 | | |
106 | 108 | | |
107 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
108 | 115 | | |
109 | 116 | | |
110 | 117 | | |
| |||
126 | 133 | | |
127 | 134 | | |
128 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
129 | 141 | | |
130 | 142 | | |
131 | 143 | | |
| |||
0 commit comments