@Test void aggregate() { when(indexedRepositoryDecorator.getName()).thenReturn("entity"); Attribute xAttr = when(mock(Attribute.class).getName()).thenReturn("xAttr").getMock(); Attribute yAttr = when(mock(Attribute.class).getName()).thenReturn("yAttr").getMock(); Attribute distinctAttr = when(mock(Attribute.class).getName()).thenReturn("distinctAttr").getMock(); @SuppressWarnings("unchecked") Query<Entity> q = mock(Query.class); AggregateQuery aggregateQuery = new AggregateQueryImpl().attrX(xAttr).attrY(yAttr).attrDistinct(distinctAttr).query(q); indexedRepositoryDecorator.aggregate(aggregateQuery); verify(searchService).aggregate(repositoryEntityType, aggregateQuery); }
@Override public AggregateResult aggregate(AggregateQuery aggregateQuery) { return tryTwice(() -> searchService.aggregate(getEntityType(), aggregateQuery)); }
IndexedRepositoryDecorator extends AbstractRepositoryDecorator<Entity> { @Override public AggregateResult aggregate(AggregateQuery aggregateQuery) { return tryTwice(() -> searchService.aggregate(getEntityType(), aggregateQuery)); } }
IndexedRepositoryDecorator extends AbstractRepositoryDecorator<Entity> { @Override public AggregateResult aggregate(AggregateQuery aggregateQuery) { return tryTwice(() -> searchService.aggregate(getEntityType(), aggregateQuery)); } IndexedRepositoryDecorator(
      Repository<Entity> delegateRepository,
      SearchService searchService,
      IndexJobScheduler indexJobScheduler); }
IndexedRepositoryDecorator extends AbstractRepositoryDecorator<Entity> { @Override public AggregateResult aggregate(AggregateQuery aggregateQuery) { return tryTwice(() -> searchService.aggregate(getEntityType(), aggregateQuery)); } IndexedRepositoryDecorator(
      Repository<Entity> delegateRepository,
      SearchService searchService,
      IndexJobScheduler indexJobScheduler); @Override Entity findOne(Query<Entity> q); @Override Stream<Entity> findAll(Query<Entity> q); @Override Set<RepositoryCapability> getCapabilities(); @Override Set<Operator> getQueryOperators(); @Override long count(Query<Entity> q); @Override AggregateResult aggregate(AggregateQuery aggregateQuery); }
IndexedRepositoryDecorator extends AbstractRepositoryDecorator<Entity> { @Override public AggregateResult aggregate(AggregateQuery aggregateQuery) { return tryTwice(() -> searchService.aggregate(getEntityType(), aggregateQuery)); } IndexedRepositoryDecorator(
      Repository<Entity> delegateRepository,
      SearchService searchService,
      IndexJobScheduler indexJobScheduler); @Override Entity findOne(Query<Entity> q); @Override Stream<Entity> findAll(Query<Entity> q); @Override Set<RepositoryCapability> getCapabilities(); @Override Set<Operator> getQueryOperators(); @Override long count(Query<Entity> q); @Override AggregateResult aggregate(AggregateQuery aggregateQuery);  }