use of io.dropwizard.views.ViewRenderer in project dropwizard by dropwizard.
the class MultipleContentTypeTest method configure.
@Override
protected Application configure() {
forceSet(TestProperties.CONTAINER_PORT, "0");
final ViewRenderer renderer = new FreemarkerViewRenderer();
return DropwizardResourceConfig.forTesting(new MetricRegistry()).register(new ViewMessageBodyWriter(new MetricRegistry(), ImmutableList.of(renderer))).register(new InfoMessageBodyWriter()).register(new ExampleResource());
}
use of io.dropwizard.views.ViewRenderer in project dropwizard by dropwizard.
the class MustacheViewRendererTest method configure.
@Override
protected Application configure() {
forceSet(TestProperties.CONTAINER_PORT, "0");
ResourceConfig config = new ResourceConfig();
final ViewRenderer renderer = new MustacheViewRenderer();
config.register(new ViewMessageBodyWriter(new MetricRegistry(), ImmutableList.of(renderer)));
config.register(new ViewRenderExceptionMapper());
config.register(new ExampleResource());
return config;
}
use of io.dropwizard.views.ViewRenderer in project dropwizard by dropwizard.
the class FreemarkerViewRendererTest method configure.
@Override
protected Application configure() {
ResourceConfig config = new ResourceConfig();
final ViewRenderer renderer = new FreemarkerViewRenderer();
config.register(new ViewMessageBodyWriter(new MetricRegistry(), ImmutableList.of(renderer)));
config.register(new ExampleResource());
config.register(new ViewRenderExceptionMapper());
return config;
}
use of io.dropwizard.views.ViewRenderer in project dropwizard by dropwizard.
the class MustacheViewRendererFileSystemTest method configure.
@Override
protected Application configure() {
forceSet(TestProperties.CONTAINER_PORT, "0");
ResourceConfig config = new ResourceConfig();
final ViewRenderer renderer = new MustacheViewRenderer();
renderer.configure(ImmutableMap.of("fileRoot", "src/test/resources"));
config.register(new ViewMessageBodyWriter(new MetricRegistry(), ImmutableList.of(renderer)));
config.register(new ViewRenderExceptionMapper());
config.register(new ExampleResource());
return config;
}
Aggregations