@Test public void shouldPutObjectsWithTypeMappingWithTransactionAsCompletable() { final PutObjectsStub putStub = PutObjectsStub.newPutStubForMultipleObjectsWithTypeMappingWithTransaction(); final Completable completable = putStub .storIOSQLite .put() .objects(putStub.items) .useTransaction(true) .prepare() .asRxCompletable(); putStub.verifyBehaviorForMultipleObjects(completable); }
@Test public void shouldPutObjectsWithTypeMappingWithoutTransactionAsObservable() { final PutObjectsStub putStub = PutObjectsStub.newPutStubForMultipleObjectsWithTypeMappingWithoutTransaction(); final Observable<PutResults<TestItem>> observable = putStub .storIOSQLite .put() .objects(putStub.items) .useTransaction(false) .prepare() .asRxObservable(); putStub.verifyBehaviorForMultipleObjects(observable); }
@Test public void shouldPutObjectsWithTypeMappingWithTransactionAsSingle() { final PutObjectsStub putStub = PutObjectsStub.newPutStubForMultipleObjectsWithTypeMappingWithTransaction(); final Single<PutResults<TestItem>> single = putStub .storIOSQLite .put() .objects(putStub.items) .useTransaction(true) .prepare() .asRxSingle(); putStub.verifyBehaviorForMultipleObjects(single); }
@Test public void shouldPutObjectsWithTypeMappingWithTransactionBlocking() { final PutObjectsStub putStub = PutObjectsStub.newPutStubForMultipleObjectsWithTypeMappingWithTransaction(); final PutResults<TestItem> putResults = putStub .storIOSQLite .put() .objects(putStub.items) .useTransaction(true) .prepare() .executeAsBlocking(); putStub.verifyBehaviorForMultipleObjects(putResults); }
@Test public void putCollectionOfObjectsCompletableExecutesOnSpecifiedScheduler() { final PutObjectsStub putStub = PutObjectsStub.newPutStubForMultipleObjectsWithTypeMappingWithTransaction(); final SchedulerChecker schedulerChecker = SchedulerChecker.create(putStub.storIOSQLite); final PreparedPutCollectionOfObjects<TestItem> operation = putStub.storIOSQLite.put().objects(putStub.items).prepare(); schedulerChecker.checkAsCompletable(operation); }