@Test public void testFindById() throws TechnicalException { Certificate certificate = new Certificate(); certificate.setName("testName"); Certificate certificateCreated = certificateRepository.create(certificate).blockingGet(); TestObserver<Certificate> testObserver = certificateRepository.findById(certificateCreated.getId()).test(); testObserver.awaitTerminalEvent(); testObserver.assertComplete(); testObserver.assertNoErrors(); testObserver.assertValue(d -> d.getName().equals("testName")); }
@Override public Maybe<Certificate> findById(String certificateId) { return Observable.fromPublisher(certificatesCollection.find(eq(FIELD_ID, certificateId)).first()).firstElement().map(this::convert); }
MongoCertificateRepository extends AbstractManagementMongoRepository implements CertificateRepository { @Override public Maybe<Certificate> findById(String certificateId) { return Observable.fromPublisher(certificatesCollection.find(eq(FIELD_ID, certificateId)).first()).firstElement().map(this::convert); } }
MongoCertificateRepository extends AbstractManagementMongoRepository implements CertificateRepository { @Override public Maybe<Certificate> findById(String certificateId) { return Observable.fromPublisher(certificatesCollection.find(eq(FIELD_ID, certificateId)).first()).firstElement().map(this::convert); }  }
MongoCertificateRepository extends AbstractManagementMongoRepository implements CertificateRepository { @Override public Maybe<Certificate> findById(String certificateId) { return Observable.fromPublisher(certificatesCollection.find(eq(FIELD_ID, certificateId)).first()).firstElement().map(this::convert); }  @PostConstruct void init(); @Override Single<Set<Certificate>> findByDomain(String domain); @Override Single<Set<Certificate>> findAll(); @Override Maybe<Certificate> findById(String certificateId); @Override Single<Certificate> create(Certificate item); @Override Single<Certificate> update(Certificate item); @Override Completable delete(String id); }
MongoCertificateRepository extends AbstractManagementMongoRepository implements CertificateRepository { @Override public Maybe<Certificate> findById(String certificateId) { return Observable.fromPublisher(certificatesCollection.find(eq(FIELD_ID, certificateId)).first()).firstElement().map(this::convert); }  @PostConstruct void init(); @Override Single<Set<Certificate>> findByDomain(String domain); @Override Single<Set<Certificate>> findAll(); @Override Maybe<Certificate> findById(String certificateId); @Override Single<Certificate> create(Certificate item); @Override Single<Certificate> update(Certificate item); @Override Completable delete(String id);  }