@Test void aggregateUnknownIndexExceptionUnrecoverable() { AggregateQuery aggregateQuery = mock(AggregateQuery.class); when(searchService.aggregate(repositoryEntityType, aggregateQuery)) .thenThrow(new UnknownIndexException("msg")); Exception exception = assertThrows( MolgenisDataException.class, () -> indexedRepositoryDecorator.aggregate(aggregateQuery)); assertThat(exception.getMessage()) .containsPattern( "Error executing query, index for entity type 'My entity type' with id 'entity' does not exist"); }
@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);  }