@Test public void testFindById() throws TechnicalException { PermissionTicket permissionTicket = new PermissionTicket().setPermissionRequest(Arrays.asList(permission)); PermissionTicket ptCreated = repository.create(permissionTicket).blockingGet(); TestObserver<PermissionTicket> testObserver = repository.findById(ptCreated.getId()).test(); testObserver.awaitTerminalEvent(); testObserver.assertComplete(); testObserver.assertNoErrors(); testObserver.assertValue(this::isValid); }
@Override public Maybe<PermissionTicket> findById(String id) { return Observable.fromPublisher(permissionTicketCollection.find(eq(FIELD_ID, id)).first()).firstElement().map(this::convert); }
MongoPermissionTicketRepository extends AbstractManagementMongoRepository implements PermissionTicketRepository { @Override public Maybe<PermissionTicket> findById(String id) { return Observable.fromPublisher(permissionTicketCollection.find(eq(FIELD_ID, id)).first()).firstElement().map(this::convert); } }
MongoPermissionTicketRepository extends AbstractManagementMongoRepository implements PermissionTicketRepository { @Override public Maybe<PermissionTicket> findById(String id) { return Observable.fromPublisher(permissionTicketCollection.find(eq(FIELD_ID, id)).first()).firstElement().map(this::convert); }  }
MongoPermissionTicketRepository extends AbstractManagementMongoRepository implements PermissionTicketRepository { @Override public Maybe<PermissionTicket> findById(String id) { return Observable.fromPublisher(permissionTicketCollection.find(eq(FIELD_ID, id)).first()).firstElement().map(this::convert); }  @PostConstruct void init(); @Override Maybe<PermissionTicket> findById(String id); @Override Single<PermissionTicket> create(PermissionTicket ticket); @Override Single<PermissionTicket> update(PermissionTicket ticket); @Override Completable delete(String id); }
MongoPermissionTicketRepository extends AbstractManagementMongoRepository implements PermissionTicketRepository { @Override public Maybe<PermissionTicket> findById(String id) { return Observable.fromPublisher(permissionTicketCollection.find(eq(FIELD_ID, id)).first()).firstElement().map(this::convert); }  @PostConstruct void init(); @Override Maybe<PermissionTicket> findById(String id); @Override Single<PermissionTicket> create(PermissionTicket ticket); @Override Single<PermissionTicket> update(PermissionTicket ticket); @Override Completable delete(String id); static final String COLLECTION_NAME; }