use of com.amplifyframework.storage.s3.UserCredentials.IdentityIdSource in project amplify-android by aws-amplify.
the class AWSS3StorageListAccessLevelTest method setUpOnce.
/**
* Upload the required resources in cloud prior to running the tests.
* @throws Exception from failure to sign in with Cognito User Pools
*/
@BeforeClass
public static void setUpOnce() throws Exception {
Context context = getApplicationContext();
// Init auth stuff
mobileClient = SynchronousMobileClient.instance();
mobileClient.initialize();
IdentityIdSource identityIdSource = MobileClientIdentityIdSource.create(mobileClient);
UserCredentials credentials = UserCredentials.create(context, identityIdSource);
Iterator<Credential> users = credentials.iterator();
userOne = users.next();
userTwo = users.next();
// Get a handle to storage
StorageCategory asyncDelegate = TestStorageCategory.create(context, R.raw.amplifyconfiguration);
storage = SynchronousStorage.delegatingTo(asyncDelegate);
// Upload test file in S3 ahead of time
uploadTestFiles();
}
use of com.amplifyframework.storage.s3.UserCredentials.IdentityIdSource in project amplify-android by aws-amplify.
the class AWSS3StorageDownloadAccessLevelTest method setUpOnce.
/**
* Upload the required resources in cloud prior to running the tests.
* @throws Exception from failure to sign in with Cognito User Pools
*/
@BeforeClass
public static void setUpOnce() throws Exception {
Context context = getApplicationContext();
mobileClient = SynchronousMobileClient.instance();
mobileClient.initialize();
IdentityIdSource identityIdSource = MobileClientIdentityIdSource.create(mobileClient);
UserCredentials userCredentials = UserCredentials.create(context, identityIdSource);
Iterator<Credential> users = userCredentials.iterator();
userOne = users.next();
userTwo = users.next();
StorageCategory asyncDelegate = TestStorageCategory.create(context, R.raw.amplifyconfiguration);
storage = SynchronousStorage.delegatingTo(asyncDelegate);
// Upload test file in S3 ahead of time
uploadTestFile();
}
use of com.amplifyframework.storage.s3.UserCredentials.IdentityIdSource in project amplify-android by aws-amplify.
the class AWSS3StorageUploadAccessLevelTest method setUpOnce.
/**
* Obtain the user IDs prior to running the tests.
* @throws MobileClientException On failure to initialize mobile client
*/
@BeforeClass
public static void setUpOnce() throws MobileClientException {
Context context = getApplicationContext();
// Initialize identity. Bundle username, password, Identity Id up into a UserCredentials.
mobileClient = SynchronousMobileClient.instance();
mobileClient.initialize();
IdentityIdSource identityIdSource = MobileClientIdentityIdSource.create(mobileClient);
UserCredentials userCredentials = UserCredentials.create(context, identityIdSource);
Iterator<Credential> iterator = userCredentials.iterator();
userOne = iterator.next();
userTwo = iterator.next();
// Setup storage.
StorageCategory asyncDelegate = TestStorageCategory.create(context, R.raw.amplifyconfiguration);
storage = SynchronousStorage.delegatingTo(asyncDelegate);
}
Aggregations