OpaMongoRepositoryFactoryBean extends MongoRepositoryFactoryBean<R, T, ID> { @Override protected RepositoryFactorySupport getFactoryInstance(MongoOperations operations) { return new OpaMongoRepositoryFactory<>(operations, mongoQueryService); } OpaMongoRepositoryFactoryBean(Class<? extends R> repositoryInterface);   }
@Test @SuppressWarnings("rawtypes") void shouldReturnInstanceOfOpaDataFilterMongoRepository() { OpaMongoRepositoryFactoryBean factoryBean = new OpaMongoRepositoryFactoryBean(MyMongoRepository.class); factoryBean.setMongoOperations(operations); factoryBean.setLazyInit(true); factoryBean.setCreateIndexesForQueryMethods(true); RepositoryFactorySupport object = factoryBean.getFactoryInstance(operations); assertThat(object instanceof OpaMongoRepositoryFactory, is(true)); }