@Test public void testFindById() throws TechnicalException { Domain domain = new Domain(); domain.setName("testName"); Domain domainCreated = domainRepository.create(domain).blockingGet(); TestObserver<Domain> testObserver = domainRepository.findById(domainCreated.getId()).test(); testObserver.awaitTerminalEvent(); testObserver.assertComplete(); testObserver.assertNoErrors(); testObserver.assertValue(d -> d.getName().equals("testName")); }
@Override public Maybe<Domain> findById(String id) { return Observable.fromPublisher(domainsCollection.find(eq(FIELD_ID, id)).first()).firstElement().map(this::convert); }
MongoDomainRepository extends AbstractManagementMongoRepository implements DomainRepository { @Override public Maybe<Domain> findById(String id) { return Observable.fromPublisher(domainsCollection.find(eq(FIELD_ID, id)).first()).firstElement().map(this::convert); } }
MongoDomainRepository extends AbstractManagementMongoRepository implements DomainRepository { @Override public Maybe<Domain> findById(String id) { return Observable.fromPublisher(domainsCollection.find(eq(FIELD_ID, id)).first()).firstElement().map(this::convert); }  }
MongoDomainRepository extends AbstractManagementMongoRepository implements DomainRepository { @Override public Maybe<Domain> findById(String id) { return Observable.fromPublisher(domainsCollection.find(eq(FIELD_ID, id)).first()).firstElement().map(this::convert); }  @PostConstruct void init(); @Override Single<Set<Domain>> findAll(); @Override Maybe<Domain> findById(String id); @Override Single<Set<Domain>> findByIdIn(Collection<String> ids); @Override Flowable<Domain> findAllByEnvironment(String environmentId); @Override Maybe<Domain> findMaster(); @Override Single<Domain> create(Domain item); @Override Single<Domain> update(Domain item); @Override Completable delete(String id); }
MongoDomainRepository extends AbstractManagementMongoRepository implements DomainRepository { @Override public Maybe<Domain> findById(String id) { return Observable.fromPublisher(domainsCollection.find(eq(FIELD_ID, id)).first()).firstElement().map(this::convert); }  @PostConstruct void init(); @Override Single<Set<Domain>> findAll(); @Override Maybe<Domain> findById(String id); @Override Single<Set<Domain>> findByIdIn(Collection<String> ids); @Override Flowable<Domain> findAllByEnvironment(String environmentId); @Override Maybe<Domain> findMaster(); @Override Single<Domain> create(Domain item); @Override Single<Domain> update(Domain item); @Override Completable delete(String id);  }