@Test public void testUpdate() { Entrypoint entrypoint = new Entrypoint(); entrypoint.setName("testName"); Entrypoint entrypointCreated = entrypointRepository.create(entrypoint).blockingGet(); Entrypoint updatedEntrypoint = new Entrypoint(); updatedEntrypoint.setId(entrypointCreated.getId()); updatedEntrypoint.setName("testUpdatedName"); TestObserver<Entrypoint> testObserver = entrypointRepository.update(updatedEntrypoint).test(); testObserver.awaitTerminalEvent(); testObserver.assertComplete(); testObserver.assertNoErrors(); testObserver.assertValue(t -> t.getName().equals(updatedEntrypoint.getName())); }
@Override public Single<Entrypoint> update(Entrypoint item) { EntrypointMongo entrypoint = convert(item); return Single.fromPublisher(collection.replaceOne(eq(FIELD_ID, entrypoint.getId()), entrypoint)).flatMap(updateResult -> findById(entrypoint.getId()).toSingle()); }
MongoEntrypointRepository extends AbstractManagementMongoRepository implements EntrypointRepository { @Override public Single<Entrypoint> update(Entrypoint item) { EntrypointMongo entrypoint = convert(item); return Single.fromPublisher(collection.replaceOne(eq(FIELD_ID, entrypoint.getId()), entrypoint)).flatMap(updateResult -> findById(entrypoint.getId()).toSingle()); } }
MongoEntrypointRepository extends AbstractManagementMongoRepository implements EntrypointRepository { @Override public Single<Entrypoint> update(Entrypoint item) { EntrypointMongo entrypoint = convert(item); return Single.fromPublisher(collection.replaceOne(eq(FIELD_ID, entrypoint.getId()), entrypoint)).flatMap(updateResult -> findById(entrypoint.getId()).toSingle()); }  }
MongoEntrypointRepository extends AbstractManagementMongoRepository implements EntrypointRepository { @Override public Single<Entrypoint> update(Entrypoint item) { EntrypointMongo entrypoint = convert(item); return Single.fromPublisher(collection.replaceOne(eq(FIELD_ID, entrypoint.getId()), entrypoint)).flatMap(updateResult -> findById(entrypoint.getId()).toSingle()); }  @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 Single<Entrypoint> update(Entrypoint item) { EntrypointMongo entrypoint = convert(item); return Single.fromPublisher(collection.replaceOne(eq(FIELD_ID, entrypoint.getId()), entrypoint)).flatMap(updateResult -> findById(entrypoint.getId()).toSingle()); }  @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);  }