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);
}
Aggregations