@Test public void testDelete() throws TechnicalException { Event event = new Event(); event.setType(Type.DOMAIN); Event eventCreated = eventRepository.create(event).blockingGet(); TestObserver<Event> testObserver = eventRepository.findById(eventCreated.getId()).test(); testObserver.awaitTerminalEvent(); testObserver.assertComplete(); testObserver.assertNoErrors(); testObserver.assertValue(e -> e.getType().equals(Type.DOMAIN)); TestObserver testObserver1 = eventRepository.delete(eventCreated.getId()).test(); testObserver1.awaitTerminalEvent(); eventRepository.findById(eventCreated.getId()).test().assertEmpty(); }
@Override public Completable delete(String id) { return Completable.fromPublisher(eventsCollection.deleteOne(eq(FIELD_ID, id))); }
MongoEventRepository extends AbstractManagementMongoRepository implements EventRepository { @Override public Completable delete(String id) { return Completable.fromPublisher(eventsCollection.deleteOne(eq(FIELD_ID, id))); } }
MongoEventRepository extends AbstractManagementMongoRepository implements EventRepository { @Override public Completable delete(String id) { return Completable.fromPublisher(eventsCollection.deleteOne(eq(FIELD_ID, id))); }  }
MongoEventRepository extends AbstractManagementMongoRepository implements EventRepository { @Override public Completable delete(String id) { return Completable.fromPublisher(eventsCollection.deleteOne(eq(FIELD_ID, id))); }  @PostConstruct void init(); @Override Single<List<Event>> findByTimeFrame(long from, long to); @Override Maybe<Event> findById(String id); @Override Single<Event> create(Event item); @Override Single<Event> update(Event item); @Override Completable delete(String id); }
MongoEventRepository extends AbstractManagementMongoRepository implements EventRepository { @Override public Completable delete(String id) { return Completable.fromPublisher(eventsCollection.deleteOne(eq(FIELD_ID, id))); }  @PostConstruct void init(); @Override Single<List<Event>> findByTimeFrame(long from, long to); @Override Maybe<Event> findById(String id); @Override Single<Event> create(Event item); @Override Single<Event> update(Event item); @Override Completable delete(String id);  }