use of io.vertx.ext.web.templ.handlebars.HandlebarsTemplateEngine in project vertx-web by vert-x3.
the class HandlebarsTemplateTest method testCustomResolver.
@Test
public void testCustomResolver() throws Exception {
HandlebarsTemplateEngine engine = HandlebarsTemplateEngine.create();
engine.setResolvers(new ValueResolver() {
@Override
public Object resolve(Object context, String name) {
return "custom";
}
@Override
public Object resolve(Object context) {
return "custom";
}
@Override
public Set<Entry<String, Object>> propertySet(Object context) {
return Collections.emptySet();
}
});
testTemplateHandlerWithContext(engine, "src/test/filesystemtemplates", "test-handlebars-template3.hbs", "Goodbye custom and custom", context -> {
context.put("foo", "Badger");
context.put("bar", "Fox");
context.next();
});
}
use of io.vertx.ext.web.templ.handlebars.HandlebarsTemplateEngine in project vertx-web by vert-x3.
the class HandlebarsTemplateTest method testGetHandlebars.
@Test
public void testGetHandlebars() throws Exception {
HandlebarsTemplateEngine engine = HandlebarsTemplateEngine.create();
assertNotNull(engine.getHandlebars());
}
Aggregations