@Test public void testConvert() { TestRepository testRepository = new TestRepository(mockBucketFactory); TestSubscriber<TestPojo> subscriber = new TestSubscriber<>(); testRepository.convert("{\"key\":\"value\"}") .subscribe(subscriber); subscriber.assertCompleted(); subscriber.assertNoErrors(); subscriber.assertValueCount(1); TestPojo testPojo = subscriber.getOnNextEvents().get(0); assertThat(testPojo.key).isEqualTo("value"); }
@Override public Single<T> convert(String json) { try { return Single.just(objectMapper.readValue(json, getGenericClass())); } catch (IOException e) { return Single.error(e); } }
BaseCouchbaseRepository implements CouchbaseRepository<T> { @Override public Single<T> convert(String json) { try { return Single.just(objectMapper.readValue(json, getGenericClass())); } catch (IOException e) { return Single.error(e); } } }
BaseCouchbaseRepository implements CouchbaseRepository<T> { @Override public Single<T> convert(String json) { try { return Single.just(objectMapper.readValue(json, getGenericClass())); } catch (IOException e) { return Single.error(e); } } BaseCouchbaseRepository();  BaseCouchbaseRepository(ObjectMapper objectMapper); }
BaseCouchbaseRepository implements CouchbaseRepository<T> { @Override public Single<T> convert(String json) { try { return Single.just(objectMapper.readValue(json, getGenericClass())); } catch (IOException e) { return Single.error(e); } } BaseCouchbaseRepository();  BaseCouchbaseRepository(ObjectMapper objectMapper); @Override Single<AsyncBucket> asyncBucket(); @Override Single<T> convert(String json); }
BaseCouchbaseRepository implements CouchbaseRepository<T> { @Override public Single<T> convert(String json) { try { return Single.just(objectMapper.readValue(json, getGenericClass())); } catch (IOException e) { return Single.error(e); } } BaseCouchbaseRepository();  BaseCouchbaseRepository(ObjectMapper objectMapper); @Override Single<AsyncBucket> asyncBucket(); @Override Single<T> convert(String json);  }