@Test
public void shouldThrowExceptionIfInvalidStoreProvided() throws IOException {

  GetFeatureStatisticsRequest request =
      GetFeatureStatisticsRequest.newBuilder()
          .setStartDate(Timestamp.newBuilder().setSeconds(0))
          .setEndDate(Timestamp.newBuilder().setSeconds(1))
          .setStore("redis")
          .build();
  when(storeRepository.findById("redis"))
      .thenReturn(
          Optional.of(
              Store.fromProto(
                  StoreProto.Store.newBuilder()
                      .setName("redis")
                      .setType(StoreType.REDIS)
                      .build())));
  expectedException.expect(IllegalArgumentException.class);
  expectedException.expectMessage(
      "Invalid store redis with type REDIS specified. Batch statistics are only supported for BigQuery stores");
  statsService.getFeatureStatistics(request);
}