@Test public void testFindByDomain() throws TechnicalException { ExtensionGrant extensionGrant = new ExtensionGrant(); extensionGrant.setName("testName"); extensionGrant.setDomain("testDomain"); extensionGrantRepository.create(extensionGrant).blockingGet(); TestObserver<Set<ExtensionGrant>> testObserver = extensionGrantRepository.findByDomain("testDomain").test(); testObserver.awaitTerminalEvent(); testObserver.assertComplete(); testObserver.assertNoErrors(); testObserver.assertValue(extensionGrants -> extensionGrants.size() == 1); }
@Override public Single<Set<ExtensionGrant>> findByDomain(String domain) { return Observable.fromPublisher(extensionGrantsCollection.find(eq(FIELD_DOMAIN, domain))).map(this::convert).collect(HashSet::new, Set::add); }
MongoExtensionGrantRepository extends AbstractManagementMongoRepository implements ExtensionGrantRepository { @Override public Single<Set<ExtensionGrant>> findByDomain(String domain) { return Observable.fromPublisher(extensionGrantsCollection.find(eq(FIELD_DOMAIN, domain))).map(this::convert).collect(HashSet::new, Set::add); } }
MongoExtensionGrantRepository extends AbstractManagementMongoRepository implements ExtensionGrantRepository { @Override public Single<Set<ExtensionGrant>> findByDomain(String domain) { return Observable.fromPublisher(extensionGrantsCollection.find(eq(FIELD_DOMAIN, domain))).map(this::convert).collect(HashSet::new, Set::add); }  }
MongoExtensionGrantRepository extends AbstractManagementMongoRepository implements ExtensionGrantRepository { @Override public Single<Set<ExtensionGrant>> findByDomain(String domain) { return Observable.fromPublisher(extensionGrantsCollection.find(eq(FIELD_DOMAIN, domain))).map(this::convert).collect(HashSet::new, Set::add); }  @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<Set<ExtensionGrant>> findByDomain(String domain) { return Observable.fromPublisher(extensionGrantsCollection.find(eq(FIELD_DOMAIN, domain))).map(this::convert).collect(HashSet::new, Set::add); }  @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);  }