Skip to content

Commit 98efcc6

Browse files
@W-21933885: [MSDK Android] App Attestation Implementation (Clean Up NativeLoginManager Test Constants And Imports)
- Remove unused mockkStatic import - Rename URL_UNSAFE_APP_ATTESTATION to UNENCODED_APP_ATTESTATION for clarity - Remove URL_ENCODED_APP_ATTESTATION constant that is no longer needed - These changes reflect that attestation values are not URL-encoded in the production code
1 parent 3e822b6 commit 98efcc6

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

libs/test/SalesforceSDKTest/src/com/salesforce/androidsdk/auth/NativeLoginManagerTest.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import com.salesforce.androidsdk.security.BiometricAuthenticationManager.Compani
2222
import io.mockk.coEvery
2323
import io.mockk.every
2424
import io.mockk.mockk
25-
import io.mockk.mockkStatic
2625
import io.mockk.unmockkAll
2726
import io.mockk.verify
2827
import kotlinx.coroutines.ExperimentalCoroutinesApi
@@ -385,7 +384,7 @@ class NativeLoginManagerTest {
385384
@Test
386385
fun nativeLoginManager_login_urlEncodesAppAttestationValue() = runTest {
387386

388-
installAppAttestationClient(attestation = URL_UNSAFE_APP_ATTESTATION)
387+
installAppAttestationClient(attestation = UNENCODED_APP_ATTESTATION)
389388
val restClient = createRestClientStubbingFailedLoginResponse()
390389
mgr = createNativeLoginManagerForTest(restClient = restClient)
391390

@@ -394,7 +393,7 @@ class NativeLoginManagerTest {
394393

395394
verify(exactly = 1) {
396395
restClient.sendAsync(match {
397-
it.path == "$TEST_LOGIN_URL$OAUTH_AUTH_PATH?attestation=$URL_UNSAFE_APP_ATTESTATION"
396+
it.path == "$TEST_LOGIN_URL$OAUTH_AUTH_PATH?attestation=$UNENCODED_APP_ATTESTATION"
398397
}, any())
399398
}
400399
}
@@ -513,7 +512,6 @@ class NativeLoginManagerTest {
513512
const val TEST_PASSWORD = "test123456"
514513
const val TEST_CHALLENGE_VALUE = "__TEST_CHALLENGE_VALUE__"
515514
const val TEST_APP_ATTESTATION = "__TEST_APP_ATTESTATION__"
516-
const val URL_UNSAFE_APP_ATTESTATION = "foo bar+baz=qux/"
517-
const val URL_ENCODED_APP_ATTESTATION = "foo%20bar%2Bbaz%3Dqux%2F"
515+
const val UNENCODED_APP_ATTESTATION = "foo bar+baz=qux/"
518516
}
519517
}

0 commit comments

Comments
 (0)