use of io.dropwizard.views.ViewMessageBodyWriter 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.ViewMessageBodyWriter in project dropwizard by dropwizard.
the class MustacheViewRendererTest method configure.
@Override
protected Application configure() {
ResourceConfig config = DropwizardResourceConfig.forTesting();
final ViewRenderer renderer = new MustacheViewRenderer();
config.register(new ViewMessageBodyWriter(new MetricRegistry(), Collections.singletonList(renderer)));
config.register(new ViewRenderExceptionMapper());
config.register(new ExampleResource());
return config;
}
use of io.dropwizard.views.ViewMessageBodyWriter in project dropwizard by dropwizard.
the class FreemarkerViewRendererTest method configure.
@Override
protected Application configure() {
ResourceConfig config = new ResourceConfig();
final ViewRenderer renderer = new FreemarkerViewRenderer(Configuration.VERSION_2_3_30);
config.register(new ViewMessageBodyWriter(new MetricRegistry(), Collections.singletonList(renderer)));
config.register(new ExampleResource());
config.register(new ViewRenderExceptionMapper());
return config;
}
use of io.dropwizard.views.ViewMessageBodyWriter in project dropwizard by dropwizard.
the class MustacheViewRendererFileSystemTest method configure.
@Override
protected Application configure() {
ResourceConfig config = DropwizardResourceConfig.forTesting();
final ViewRenderer renderer = new MustacheViewRenderer();
renderer.configure(Collections.singletonMap("fileRoot", "src/test/resources"));
config.register(new ViewMessageBodyWriter(new MetricRegistry(), Collections.singletonList(renderer)));
config.register(new ViewRenderExceptionMapper());
config.register(new ExampleResource());
return config;
}
Aggregations