@Test void iterator() { when(delegateRepository.getEntityType()).thenReturn(entityType); QueryImpl<Entity> q = new QueryImpl<>(); Stream<Entity> entities = Stream.of(mock(Entity.class)); when(delegateRepository.findAll(q)).thenReturn(entities); when(entityManager.resolveReferences(entityType, entities, null)).thenReturn(entities); entityReferenceResolverDecorator.iterator(); verify(delegateRepository, times(1)).findAll(q); verify(entityManager).resolveReferences(entityType, entities, null); }
@Override public Iterator<Entity> iterator() { Stream<Entity> entities = delegate().findAll(new QueryImpl<>()); return resolveEntityReferences(entities).iterator(); }
EntityReferenceResolverDecorator extends AbstractRepositoryDecorator<Entity> { @Override public Iterator<Entity> iterator() { Stream<Entity> entities = delegate().findAll(new QueryImpl<>()); return resolveEntityReferences(entities).iterator(); } }
EntityReferenceResolverDecorator extends AbstractRepositoryDecorator<Entity> { @Override public Iterator<Entity> iterator() { Stream<Entity> entities = delegate().findAll(new QueryImpl<>()); return resolveEntityReferences(entities).iterator(); } EntityReferenceResolverDecorator(
      Repository<Entity> delegateRepository, EntityManager entityManager); }
EntityReferenceResolverDecorator extends AbstractRepositoryDecorator<Entity> { @Override public Iterator<Entity> iterator() { Stream<Entity> entities = delegate().findAll(new QueryImpl<>()); return resolveEntityReferences(entities).iterator(); } EntityReferenceResolverDecorator(
      Repository<Entity> delegateRepository, EntityManager entityManager); @Override Stream<Entity> findAll(Query<Entity> q); @Override Entity findOne(Query<Entity> q); @Override Iterator<Entity> iterator(); @Override void forEachBatched(Fetch fetch, Consumer<List<Entity>> consumer, int batchSize); @Override Entity findOneById(Object id); @Override Entity findOneById(Object id, Fetch fetch); @Override Stream<Entity> findAll(Stream<Object> ids); @Override Stream<Entity> findAll(Stream<Object> ids, Fetch fetch); }
EntityReferenceResolverDecorator extends AbstractRepositoryDecorator<Entity> { @Override public Iterator<Entity> iterator() { Stream<Entity> entities = delegate().findAll(new QueryImpl<>()); return resolveEntityReferences(entities).iterator(); } EntityReferenceResolverDecorator(
      Repository<Entity> delegateRepository, EntityManager entityManager); @Override Stream<Entity> findAll(Query<Entity> q); @Override Entity findOne(Query<Entity> q); @Override Iterator<Entity> iterator(); @Override void forEachBatched(Fetch fetch, Consumer<List<Entity>> consumer, int batchSize); @Override Entity findOneById(Object id); @Override Entity findOneById(Object id, Fetch fetch); @Override Stream<Entity> findAll(Stream<Object> ids); @Override Stream<Entity> findAll(Stream<Object> ids, Fetch fetch);  }