use of com.microsoft.identity.common.internal.dto.RefreshTokenRecord in project microsoft-authentication-library-common-for-android by AzureAD.
the class CacheKeyValueDelegateTest method refreshTokenCreateCacheKeyComplete.
// End Accounts
// RefreshTokens
@Test
public void refreshTokenCreateCacheKeyComplete() {
final RefreshTokenRecord refreshToken = new RefreshTokenRecord();
refreshToken.setHomeAccountId(HOME_ACCOUNT_ID);
refreshToken.setEnvironment(ENVIRONMENT);
refreshToken.setCredentialType(CredentialType.RefreshToken.name());
refreshToken.setClientId(CLIENT_ID);
refreshToken.setTarget(TARGET);
final String expectedKey = // just for formatting
"" + HOME_ACCOUNT_ID + CACHE_VALUE_SEPARATOR + ENVIRONMENT + CACHE_VALUE_SEPARATOR + CREDENTIAL_TYPE_REFRESH_TOKEN + CACHE_VALUE_SEPARATOR + CLIENT_ID + CACHE_VALUE_SEPARATOR + CACHE_VALUE_SEPARATOR + TARGET;
assertEquals(expectedKey, mDelegate.generateCacheKey(refreshToken));
}
use of com.microsoft.identity.common.internal.dto.RefreshTokenRecord in project microsoft-authentication-library-common-for-android by AzureAD.
the class CacheKeyValueDelegateTest method refreshTokenCreateCacheKeyNoHomeAccountIdNoTarget.
@Test
public void refreshTokenCreateCacheKeyNoHomeAccountIdNoTarget() {
final RefreshTokenRecord refreshToken = new RefreshTokenRecord();
refreshToken.setEnvironment(ENVIRONMENT);
refreshToken.setCredentialType(CredentialType.RefreshToken.name());
refreshToken.setClientId(CLIENT_ID);
final String expectedKey = // just for formatting
"" + CACHE_VALUE_SEPARATOR + ENVIRONMENT + CACHE_VALUE_SEPARATOR + CREDENTIAL_TYPE_REFRESH_TOKEN + CACHE_VALUE_SEPARATOR + CLIENT_ID + CACHE_VALUE_SEPARATOR + CACHE_VALUE_SEPARATOR;
assertEquals(expectedKey, mDelegate.generateCacheKey(refreshToken));
}
use of com.microsoft.identity.common.internal.dto.RefreshTokenRecord in project microsoft-authentication-library-common-for-android by AzureAD.
the class CacheKeyValueDelegateTest method refreshTokenCreateCacheKeyCompleteWithFoci.
@Test
public void refreshTokenCreateCacheKeyCompleteWithFoci() {
final RefreshTokenRecord refreshToken = new RefreshTokenRecord();
refreshToken.setHomeAccountId(HOME_ACCOUNT_ID);
refreshToken.setEnvironment(ENVIRONMENT);
refreshToken.setCredentialType(CredentialType.RefreshToken.name());
refreshToken.setClientId(CLIENT_ID);
refreshToken.setFamilyId("1");
refreshToken.setTarget(TARGET);
final String expectedKey = // just for formatting
"" + HOME_ACCOUNT_ID + CACHE_VALUE_SEPARATOR + ENVIRONMENT + CACHE_VALUE_SEPARATOR + CREDENTIAL_TYPE_REFRESH_TOKEN + CACHE_VALUE_SEPARATOR + "1" + CACHE_VALUE_SEPARATOR + CACHE_VALUE_SEPARATOR + TARGET;
assertEquals(expectedKey, mDelegate.generateCacheKey(refreshToken));
}
Aggregations