use of io.vertx.ext.web.templ.pebble.impl.PebbleVertxLoader in project vertx-web by vert-x3.
the class PebbleTemplateTest method customBuilderShouldRender.
@Test
public void customBuilderShouldRender() throws Exception {
final TemplateEngine engine = PebbleTemplateEngine.create(new PebbleEngine.Builder().extension(new TestExtension()).loader(new PebbleVertxLoader(vertx)).build());
testTemplateHandler(engine, "src/test/filesystemtemplates", "test-pebble-template5.peb", "Hello badger and foxString is TESTRequest path is /test-pebble-template5.peb");
}
use of io.vertx.ext.web.templ.pebble.impl.PebbleVertxLoader in project vertx-web by vert-x3.
the class PebbleTemplateTest method customBuilderShouldRender.
@Test
public void customBuilderShouldRender(TestContext should) {
final TemplateEngine engine = PebbleTemplateEngine.create(vertx, new PebbleEngine.Builder().extension(new TestExtension()).loader(new PebbleVertxLoader(vertx)).build());
final JsonObject context = new JsonObject().put("foo", "badger").put("bar", "fox").put("context", new JsonObject().put("path", "/test-pebble-template5.peb"));
engine.render(context, "src/test/filesystemtemplates/test-pebble-template5.peb", should.asyncAssertSuccess(render -> {
should.assertEquals("Hello badger and foxString is TESTRequest path is /test-pebble-template5.peb", normalizeCRLF(render.toString()));
}));
}
Aggregations