@Test public void testFindById() throws TechnicalException { ExtensionGrant extensionGrant = new ExtensionGrant(); extensionGrant.setName("testName"); ExtensionGrant extensionGrantCreated = extensionGrantRepository.create(extensionGrant).blockingGet(); TestObserver<ExtensionGrant> testObserver = extensionGrantRepository.findById(extensionGrantCreated.getId()).test(); testObserver.awaitTerminalEvent(); testObserver.assertComplete(); testObserver.assertNoErrors(); testObserver.assertValue(e -> e.getName().equals("testName")); }
@Override public Maybe<ExtensionGrant> findById(String tokenGranterId) { return Observable.fromPublisher(extensionGrantsCollection.find(eq(FIELD_ID, tokenGranterId)).first()).firstElement().map(this::convert); }
MongoExtensionGrantRepository extends AbstractManagementMongoRepository implements ExtensionGrantRepository { @Override public Maybe<ExtensionGrant> findById(String tokenGranterId) { return Observable.fromPublisher(extensionGrantsCollection.find(eq(FIELD_ID, tokenGranterId)).first()).firstElement().map(this::convert); } }
MongoExtensionGrantRepository extends AbstractManagementMongoRepository implements ExtensionGrantRepository { @Override public Maybe<ExtensionGrant> findById(String tokenGranterId) { return Observable.fromPublisher(extensionGrantsCollection.find(eq(FIELD_ID, tokenGranterId)).first()).firstElement().map(this::convert); }  }
MongoExtensionGrantRepository extends AbstractManagementMongoRepository implements ExtensionGrantRepository { @Override public Maybe<ExtensionGrant> findById(String tokenGranterId) { return Observable.fromPublisher(extensionGrantsCollection.find(eq(FIELD_ID, tokenGranterId)).first()).firstElement().map(this::convert); }  @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 Maybe<ExtensionGrant> findById(String tokenGranterId) { return Observable.fromPublisher(extensionGrantsCollection.find(eq(FIELD_ID, tokenGranterId)).first()).firstElement().map(this::convert); }  @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);  }