ElasticsearchNativeServiceImpl implements ElasticsearchService { @Override public List<IndicatorJson> findIndicatorsByRicAndDateGreaterThan(String ric, Long date) { return queryElasticsearch(indexForIndicators, typeForIndicators, IndicatorJson.class, matchQuery("ric", ric), rangeQuery("date").from(date)); }  @PostConstruct void init(); @Override String indexTick(TickJson tick); @Override String indexTicks(List<TickJson> ticks); @Override String indexIndicator(IndicatorJson indicator); @Override String indexIndicators(List<IndicatorJson> indicators); @Override String indexStrategy(StrategyJson strategy); @Override String indexStrategies(List<StrategyJson> strategies); @Override String findTicks(); @Override List<TickJson> findTicksByRic(String ric); @Override List<IndicatorJson> findIndicatorsByRic(String ric); @Override List<TickJson> findTicksByRicAndDateGreaterThan(String ric, Long date); @Override List<IndicatorJson> findIndicatorsByRicAndDateGreaterThan(String ric, Long date); @Override List<IndicatorJson> findIndicatorsByRicAndNameAndDateGreaterThan(String ric, String name, Long date); @Override List<Ticker> findTickersByExchange(ExchangeEnum exchange); InfrastructureProperties getInfrastructureProperties(); void setInfrastructureProperties(InfrastructureProperties infrastructureProperties);  }
@Test public void testFindIndicatorsByTickerAndDateGreaterThan() throws Exception { int number = 7; int expected = 4; logger.info("given {} {} indicators", number, ricOne); long midpoint = populateElasticsearch(rdogOne, number, indexForIndicators, typeForIndicators, null, IndicatorJson.class).getDate(); logger.info("it should return only {} {} indicators after the midpoint", expected, ricOne); List<IndicatorJson> result = service.findIndicatorsByRicAndDateGreaterThan(ricOne, midpoint); logger.info(" *** findIndicatorsByTickerAndDateGreaterThan({}, {}): {}, expected: {}", ricOne, midpoint, result.size(), expected); assertThat(result).hasSize(expected); }