ElasticsearchNativeServiceImpl implements ElasticsearchService { @Override public List<IndicatorJson> findIndicatorsByRic(String ric) { return queryElasticsearch(indexForIndicators, typeForIndicators, IndicatorJson.class, matchQuery("ric", ric)); }  @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 testFindIndicatorsByTicker() throws Exception { int numberOne = 5; int numberTwo = 7; logger.info("given {} {} indicators and {} {} indicators", numberOne, ricOne, numberTwo, ricTwo); String name = "indicator-name"; populateElasticsearch(rdogOne, numberOne, indexForIndicators, typeForIndicators, name, IndicatorJson.class); populateElasticsearch(rdogTwo, numberTwo, indexForIndicators, typeForIndicators, name, IndicatorJson.class); logger.info("it should return {} {} indictors, {} {} indicators and 0 {} indicators", numberOne, ricOne, numberTwo, ricTwo, ricThree); List<IndicatorJson> resultOne = service.findIndicatorsByRic(ricOne); List<IndicatorJson> resultTwo = service.findIndicatorsByRic(ricTwo); List<IndicatorJson> resultThree = service.findIndicatorsByRic(ricThree); logger.info(" *** findIndicatorsByTicker({}): {}, expected: {}", ricOne, resultOne.size(), numberOne); logger.info(" *** findIndicatorsByTicker({}): {}, expected: {}", ricTwo, resultTwo.size(), numberTwo); logger.info(" *** findIndicatorsByTicker({}): {}, expected: {}", ricThree, resultThree.size(), 0); assertThat(resultOne).hasSize(numberOne); assertThat(resultTwo).hasSize(numberTwo); assertThat(resultThree).hasSize(0); }