@Test public void undefinedVariable() throws Exception { exception.expect(TemplateException.class); exception.expectMessage(containsString("ReferenceError")); exception.expectMessage(containsString("no_such_var")); engine.eval(newConfig().set("key", "${no_such_var}"), params()); }
protected Config eval(Config config, Config params) throws TemplateException { ObjectNode object = config.convert(ObjectNode.class); ObjectNode built = new Context(params).evalObjectRecursive(object); return config.getFactory().create(built); }
ConfigEvalEngine implements TemplateEngine { protected Config eval(Config config, Config params) throws TemplateException { ObjectNode object = config.convert(ObjectNode.class); ObjectNode built = new Context(params).evalObjectRecursive(object); return config.getFactory().create(built); } }
ConfigEvalEngine implements TemplateEngine { protected Config eval(Config config, Config params) throws TemplateException { ObjectNode object = config.convert(ObjectNode.class); ObjectNode built = new Context(params).evalObjectRecursive(object); return config.getFactory().create(built); } @Inject  ConfigEvalEngine(); }
ConfigEvalEngine implements TemplateEngine { protected Config eval(Config config, Config params) throws TemplateException { ObjectNode object = config.convert(ObjectNode.class); ObjectNode built = new Context(params).evalObjectRecursive(object); return config.getFactory().create(built); } @Inject  ConfigEvalEngine(); @Override String template(String content, Config params); }
ConfigEvalEngine implements TemplateEngine { protected Config eval(Config config, Config params) throws TemplateException { ObjectNode object = config.convert(ObjectNode.class); ObjectNode built = new Context(params).evalObjectRecursive(object); return config.getFactory().create(built); } @Inject  ConfigEvalEngine(); @Override String template(String content, Config params);  }