Search in sources :

Example 1 with DataStoreCategory

use of com.amplifyframework.datastore.DataStoreCategory in project amplify-android by aws-amplify.

the class RxDataStoreBindingTest method createBindingInFrontOfMockPlugin.

/**
 * Creates a DataStoreCategory that has a mock plugin backing it.
 * Creates an Rx Binding around this category, for test.
 * @throws AmplifyException On failure to add plugin, init/config the category
 */
@Before
public void createBindingInFrontOfMockPlugin() throws AmplifyException {
    this.delegate = mock(DataStorePlugin.class);
    when(delegate.getPluginKey()).thenReturn(RandomString.string());
    final DataStoreCategory dataStoreCategory = new DataStoreCategory();
    dataStoreCategory.addPlugin(delegate);
    dataStoreCategory.configure(new DataStoreCategoryConfiguration(), mock(Context.class));
    dataStoreCategory.initialize(mock(Context.class));
    this.rxDataStore = new RxDataStoreBinding(dataStoreCategory);
}
Also used : DataStoreCategoryConfiguration(com.amplifyframework.datastore.DataStoreCategoryConfiguration) Context(android.content.Context) DataStorePlugin(com.amplifyframework.datastore.DataStorePlugin) DataStoreCategory(com.amplifyframework.datastore.DataStoreCategory) Before(org.junit.Before)

Aggregations

Context (android.content.Context)1 DataStoreCategory (com.amplifyframework.datastore.DataStoreCategory)1 DataStoreCategoryConfiguration (com.amplifyframework.datastore.DataStoreCategoryConfiguration)1 DataStorePlugin (com.amplifyframework.datastore.DataStorePlugin)1 Before (org.junit.Before)1