ElasticsearchNativeServiceImpl implements ElasticsearchService { @Override public List<TickJson> findTicksByRicAndDateGreaterThan(String ric, Long date) { return queryElasticsearch(indexForTicks, typeForTicks, TickJson.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 testFindTicksByTickerAndDateGreaterThan() throws Exception { int number = 7; int expected = 4; logger.info("given {} {} ticks", number, ricOne); long midpoint = populateElasticsearch(rdogOne, number, indexForTicks, typeForTicks, null, TickJson.class).getDate(); logger.info("it should return only {} {} ticks after the midpoint", expected, ricOne); List<TickJson> result = service.findTicksByRicAndDateGreaterThan(ricOne, midpoint); logger.info(" *** findTicksByTickerAndDateGreaterThan({}, {}): {}, expected: {}", ricOne, midpoint, result.size(), expected); assertThat(result).hasSize(expected); }