StellarServiceImpl implements StellarService { @Override public Map<String, Boolean> validateRules(List<String> rules) { Map<String, Boolean> results = new HashMap<>(); StellarProcessor stellarProcessor = new StellarProcessor(); for(String rule: rules) { try { boolean result = stellarProcessor.validate(rule, Context.EMPTY_CONTEXT()); results.put(rule, result); } catch (ParseException e) { results.put(rule, false); } } return results; } @Autowired  StellarServiceImpl(CuratorFramework client); @Override Map<String, Boolean> validateRules(List<String> rules); @Override Map<String, Object> applyTransformations(SensorParserContext sensorParserContext); @Override FieldTransformations[] getTransformations(); @Override List<StellarFunctionDescription> getStellarFunctions(); @Override List<StellarFunctionDescription> getSimpleStellarFunctions();  }
@Test public void validateRulesShouldProperlyValidateRules() { List<String> rules = Arrays.asList("TO_LOWER(test)", "BAD_FUNCTION(test)"); Map<String, Boolean> results = stellarService.validateRules(rules); assertEquals(2, results.size()); assertEquals(true, results.get("TO_LOWER(test)")); assertEquals(false, results.get("BAD_FUNCTION(test)")); }