use of com.amplifyframework.storage.StorageCategory in project amplify-android by aws-amplify.
the class RxStorageBindingTest method createBindingInFrontOfMockPlugin.
/**
* Creates a StorageCategory backed by a mock plugin. Uses this category
* as a backing for an Rx Binding, under test.
* @throws AmplifyException On failure to add plugin or config/init the storage category
*/
@Before
public void createBindingInFrontOfMockPlugin() throws AmplifyException {
delegate = mock(StoragePlugin.class);
when(delegate.getPluginKey()).thenReturn(RandomString.string());
final StorageCategory storageCategory = new StorageCategory();
storageCategory.addPlugin(delegate);
storageCategory.configure(new StorageCategoryConfiguration(), mock(Context.class));
storageCategory.initialize(mock(Context.class));
rxStorage = new RxStorageBinding(storageCategory);
}
Aggregations