@Test public void testUpdate() throws TechnicalException { ExtensionGrant extensionGrant = new ExtensionGrant(); extensionGrant.setName("testName"); ExtensionGrant extensionGrantCreated = extensionGrantRepository.create(extensionGrant).blockingGet(); ExtensionGrant updatedExtension = new ExtensionGrant(); updatedExtension.setId(extensionGrantCreated.getId()); updatedExtension.setName("testUpdatedName"); TestObserver<ExtensionGrant> testObserver = extensionGrantRepository.update(updatedExtension).test(); testObserver.awaitTerminalEvent(); testObserver.assertComplete(); testObserver.assertNoErrors(); testObserver.assertValue(e -> e.getName().equals(updatedExtension.getName())); }
@Override public Single<ExtensionGrant> update(ExtensionGrant item) { ExtensionGrantMongo extensionGrant = convert(item); return Single.fromPublisher(extensionGrantsCollection.replaceOne(eq(FIELD_ID, extensionGrant.getId()), extensionGrant)).flatMap(updateResult -> findById(extensionGrant.getId()).toSingle()); }
MongoExtensionGrantRepository extends AbstractManagementMongoRepository implements ExtensionGrantRepository { @Override public Single<ExtensionGrant> update(ExtensionGrant item) { ExtensionGrantMongo extensionGrant = convert(item); return Single.fromPublisher(extensionGrantsCollection.replaceOne(eq(FIELD_ID, extensionGrant.getId()), extensionGrant)).flatMap(updateResult -> findById(extensionGrant.getId()).toSingle()); } }
MongoExtensionGrantRepository extends AbstractManagementMongoRepository implements ExtensionGrantRepository { @Override public Single<ExtensionGrant> update(ExtensionGrant item) { ExtensionGrantMongo extensionGrant = convert(item); return Single.fromPublisher(extensionGrantsCollection.replaceOne(eq(FIELD_ID, extensionGrant.getId()), extensionGrant)).flatMap(updateResult -> findById(extensionGrant.getId()).toSingle()); }  }
MongoExtensionGrantRepository extends AbstractManagementMongoRepository implements ExtensionGrantRepository { @Override public Single<ExtensionGrant> update(ExtensionGrant item) { ExtensionGrantMongo extensionGrant = convert(item); return Single.fromPublisher(extensionGrantsCollection.replaceOne(eq(FIELD_ID, extensionGrant.getId()), extensionGrant)).flatMap(updateResult -> findById(extensionGrant.getId()).toSingle()); }  @PostConstruct void init(); @Override Single<Set<ExtensionGrant>> findByDomain(String domain); @Override Maybe<ExtensionGrant> findByDomainAndName(String domain, String name); @Override Maybe<ExtensionGrant> findById(String tokenGranterId); @Override Single<ExtensionGrant> create(ExtensionGrant item); @Override Single<ExtensionGrant> update(ExtensionGrant item); @Override Completable delete(String id); }
MongoExtensionGrantRepository extends AbstractManagementMongoRepository implements ExtensionGrantRepository { @Override public Single<ExtensionGrant> update(ExtensionGrant item) { ExtensionGrantMongo extensionGrant = convert(item); return Single.fromPublisher(extensionGrantsCollection.replaceOne(eq(FIELD_ID, extensionGrant.getId()), extensionGrant)).flatMap(updateResult -> findById(extensionGrant.getId()).toSingle()); }  @PostConstruct void init(); @Override Single<Set<ExtensionGrant>> findByDomain(String domain); @Override Maybe<ExtensionGrant> findByDomainAndName(String domain, String name); @Override Maybe<ExtensionGrant> findById(String tokenGranterId); @Override Single<ExtensionGrant> create(ExtensionGrant item); @Override Single<ExtensionGrant> update(ExtensionGrant item); @Override Completable delete(String id);  }