@Test public void testNotFoundById() throws TechnicalException { tagRepository.findById("test").test().assertEmpty(); }
@Override public Maybe<Tag> findById(String id, String organizationId) { return Observable.fromPublisher(tagsCollection.find(and(eq(FIELD_ORGANIZATION_ID, organizationId), eq(FIELD_ID, id))).first()).firstElement().map(this::convert); }
MongoTagRepository extends AbstractManagementMongoRepository implements TagRepository { @Override public Maybe<Tag> findById(String id, String organizationId) { return Observable.fromPublisher(tagsCollection.find(and(eq(FIELD_ORGANIZATION_ID, organizationId), eq(FIELD_ID, id))).first()).firstElement().map(this::convert); } }
MongoTagRepository extends AbstractManagementMongoRepository implements TagRepository { @Override public Maybe<Tag> findById(String id, String organizationId) { return Observable.fromPublisher(tagsCollection.find(and(eq(FIELD_ORGANIZATION_ID, organizationId), eq(FIELD_ID, id))).first()).firstElement().map(this::convert); }  }
MongoTagRepository extends AbstractManagementMongoRepository implements TagRepository { @Override public Maybe<Tag> findById(String id, String organizationId) { return Observable.fromPublisher(tagsCollection.find(and(eq(FIELD_ORGANIZATION_ID, organizationId), eq(FIELD_ID, id))).first()).firstElement().map(this::convert); }  @PostConstruct void init(); @Override Maybe<Tag> findById(String id, String organizationId); @Override Maybe<Tag> findById(String id); @Override Flowable<Tag> findAll(String organizationId); @Override Single<Tag> create(Tag item); @Override Single<Tag> update(Tag item); @Override Completable delete(String id); }
MongoTagRepository extends AbstractManagementMongoRepository implements TagRepository { @Override public Maybe<Tag> findById(String id, String organizationId) { return Observable.fromPublisher(tagsCollection.find(and(eq(FIELD_ORGANIZATION_ID, organizationId), eq(FIELD_ID, id))).first()).firstElement().map(this::convert); }  @PostConstruct void init(); @Override Maybe<Tag> findById(String id, String organizationId); @Override Maybe<Tag> findById(String id); @Override Flowable<Tag> findAll(String organizationId); @Override Single<Tag> create(Tag item); @Override Single<Tag> update(Tag item); @Override Completable delete(String id);  }