use of com.microsoft.identity.common.adal.internal.cache.StorageHelper in project microsoft-authentication-library-common-for-android by AzureAD.
the class SharedPreferencesFileManagerTests method testGetSharedPreferencesNoStorageHelper.
@Test
public void testGetSharedPreferencesNoStorageHelper() throws Exception {
Field f = SharedPreferencesFileManager.class.getDeclaredField("mStorageHelper");
f.setAccessible(true);
IStorageHelper storageHelper = (IStorageHelper) f.get(mSharedPreferencesFileManager);
IStorageHelper newStorageHelper;
if (storageHelper == null) {
newStorageHelper = new StorageHelper(InstrumentationRegistry.getTargetContext());
} else {
newStorageHelper = null;
}
Assert.assertNotSame(mSharedPreferencesFileManager, SharedPreferencesFileManager.getSharedPreferences(InstrumentationRegistry.getTargetContext(), mSharedPreferencesFileManager.getSharedPreferencesFileName(), newStorageHelper));
Assert.assertSame(mSharedPreferencesFileManager, SharedPreferencesFileManager.getSharedPreferences(InstrumentationRegistry.getTargetContext(), mSharedPreferencesFileManager.getSharedPreferencesFileName(), storageHelper));
}
use of com.microsoft.identity.common.adal.internal.cache.StorageHelper in project microsoft-authentication-library-common-for-android by AzureAD.
the class BrokerOAuth2TokenCache method initializeFociCache.
private static MicrosoftFamilyOAuth2TokenCache initializeFociCache(@NonNull final Context context) {
final String methodName = ":initializeFociCache";
Logger.verbose(TAG + methodName, "Initializing foci cache");
final IStorageHelper storageHelper = new StorageHelper(context);
final ISharedPreferencesFileManager sharedPreferencesFileManager = SharedPreferencesFileManager.getSharedPreferences(context, BROKER_FOCI_ACCOUNT_CREDENTIAL_SHARED_PREFERENCES, storageHelper);
return getTokenCache(context, sharedPreferencesFileManager, true);
}
Aggregations