TurbineService { public String listIndicators() { String result = null; try { result = json.writeValueAsString(new Object() { @JsonProperty("indicators") List<IndicatorClientDefinition> indicatorz = indicatorInstances.stream().map(i -> i.getClientIndicator()).collect(toList()); }); } catch (JsonProcessingException e) { logger.error(e.getMessage(), e); } return result; }  @PostConstruct void init(); List<Ticker> findTickers(ExchangeEnum exchange); List<EnableTurbineStrategy> findStrategies(); String listStocks(String exchange); String listStrategies(); String listIndicators(); List<IndicatorInstance> getIndicatorInstances(); ResourceLoader getResource(); void setResource(ResourceLoader resource); public List<IndicatorInstance> indicatorInstances; }
@Test public void testListIndicators() throws Exception { String indicators = turbineService.listIndicators(); logger.info("{}", indicators); assertThat(indicators).contains(BollingerBands.class.getSimpleName()); IndicatorClientDefinitions definitions = json.readValue(indicators, IndicatorClientDefinitions.class); assertThat(definitions.getIndicators().size()).isGreaterThan(0); }