@Test public void testFindById() { Entrypoint entrypoint = new Entrypoint(); entrypoint.setName("testName"); Entrypoint entrypointCreated = entrypointRepository.create(entrypoint).blockingGet(); TestObserver<Entrypoint> testObserver = entrypointRepository.findById(entrypointCreated.getId()).test(); testObserver.awaitTerminalEvent(); testObserver.assertComplete(); testObserver.assertNoErrors(); testObserver.assertValue(d -> d.getName().equals("testName")); }
@Override public Maybe<Entrypoint> findById(String id, String organizationId) { return Observable.fromPublisher(collection.find(and(eq(FIELD_ORGANIZATION_ID, organizationId), eq(FIELD_ID, id))).first()).firstElement().map(this::convert); }
MongoEntrypointRepository extends AbstractManagementMongoRepository implements EntrypointRepository { @Override public Maybe<Entrypoint> findById(String id, String organizationId) { return Observable.fromPublisher(collection.find(and(eq(FIELD_ORGANIZATION_ID, organizationId), eq(FIELD_ID, id))).first()).firstElement().map(this::convert); } }
MongoEntrypointRepository extends AbstractManagementMongoRepository implements EntrypointRepository { @Override public Maybe<Entrypoint> findById(String id, String organizationId) { return Observable.fromPublisher(collection.find(and(eq(FIELD_ORGANIZATION_ID, organizationId), eq(FIELD_ID, id))).first()).firstElement().map(this::convert); }  }
MongoEntrypointRepository extends AbstractManagementMongoRepository implements EntrypointRepository { @Override public Maybe<Entrypoint> findById(String id, String organizationId) { return Observable.fromPublisher(collection.find(and(eq(FIELD_ORGANIZATION_ID, organizationId), eq(FIELD_ID, id))).first()).firstElement().map(this::convert); }  @PostConstruct void init(); @Override Maybe<Entrypoint> findById(String id, String organizationId); @Override Maybe<Entrypoint> findById(String id); @Override Flowable<Entrypoint> findAll(String organizationId); @Override Single<Entrypoint> create(Entrypoint item); @Override Single<Entrypoint> update(Entrypoint item); @Override Completable delete(String id); }
MongoEntrypointRepository extends AbstractManagementMongoRepository implements EntrypointRepository { @Override public Maybe<Entrypoint> findById(String id, String organizationId) { return Observable.fromPublisher(collection.find(and(eq(FIELD_ORGANIZATION_ID, organizationId), eq(FIELD_ID, id))).first()).firstElement().map(this::convert); }  @PostConstruct void init(); @Override Maybe<Entrypoint> findById(String id, String organizationId); @Override Maybe<Entrypoint> findById(String id); @Override Flowable<Entrypoint> findAll(String organizationId); @Override Single<Entrypoint> create(Entrypoint item); @Override Single<Entrypoint> update(Entrypoint item); @Override Completable delete(String id);  }