@Test public void testAsyncBucketError() { when(mockBucketFactory.getAsyncBucketInstance()).thenReturn(Single.error(new RuntimeException("test"))); BaseCouchbaseRepository<TestPojo> baseCouchbaseRepository = new BaseCouchbaseRepository<>(); baseCouchbaseRepository.couchbaseAsyncBucketFactory = mockBucketFactory; TestSubscriber<AsyncBucket> subscriber = new TestSubscriber<>(); baseCouchbaseRepository.asyncBucket() .subscribe(subscriber); subscriber.assertError(RuntimeException.class); }
@Override public Single<AsyncBucket> asyncBucket() { return couchbaseAsyncBucketFactory.getAsyncBucketInstance(); }
BaseCouchbaseRepository implements CouchbaseRepository<T> { @Override public Single<AsyncBucket> asyncBucket() { return couchbaseAsyncBucketFactory.getAsyncBucketInstance(); } }
BaseCouchbaseRepository implements CouchbaseRepository<T> { @Override public Single<AsyncBucket> asyncBucket() { return couchbaseAsyncBucketFactory.getAsyncBucketInstance(); } BaseCouchbaseRepository();  BaseCouchbaseRepository(ObjectMapper objectMapper); }
BaseCouchbaseRepository implements CouchbaseRepository<T> { @Override public Single<AsyncBucket> asyncBucket() { return couchbaseAsyncBucketFactory.getAsyncBucketInstance(); } BaseCouchbaseRepository();  BaseCouchbaseRepository(ObjectMapper objectMapper); @Override Single<AsyncBucket> asyncBucket(); @Override Single<T> convert(String json); }
BaseCouchbaseRepository implements CouchbaseRepository<T> { @Override public Single<AsyncBucket> asyncBucket() { return couchbaseAsyncBucketFactory.getAsyncBucketInstance(); } BaseCouchbaseRepository();  BaseCouchbaseRepository(ObjectMapper objectMapper); @Override Single<AsyncBucket> asyncBucket(); @Override Single<T> convert(String json);  }