use of io.dropwizard.assets.AssetsBundle in project irontest by zheng-wang.
the class IronTestApplication method initialize.
@Override
public void initialize(Bootstrap<IronTestConfiguration> bootstrap) {
bootstrap.addBundle(new AssetsBundle("/assets/app", "/ui", "index.htm", "ui"));
bootstrap.addBundle(new AssetsBundle("/META-INF/resources/webjars", "/ui/lib", null, "lib"));
bootstrap.addBundle(new AssetsBundle("/assets/mockserver", "/ui/mockserver", "mockserver.htm", "mockserver"));
bootstrap.addBundle(new AssetsBundle("/assets/common", "/ui/common", null, "common"));
bootstrap.addBundle(jaxWsBundle);
bootstrap.addBundle(new MultiPartBundle());
bootstrap.addBundle(new ViewBundle<IronTestConfiguration>() {
@Override
public Map<String, Map<String, String>> getViewConfiguration(IronTestConfiguration config) {
return config.getViewRendererConfiguration();
}
});
Configuration.setDefaults(new Configuration.Defaults() {
private final JsonProvider jsonProvider = new JacksonJsonProvider();
private final MappingProvider mappingProvider = new JacksonMappingProvider();
@Override
public JsonProvider jsonProvider() {
return jsonProvider;
}
@Override
public MappingProvider mappingProvider() {
return mappingProvider;
}
@Override
public Set<Option> options() {
return EnumSet.noneOf(Option.class);
}
});
// configure the Jackson ObjectMapper used by JAX-RS (Jersey)
ObjectMapper objectMapper = bootstrap.getObjectMapper();
objectMapper.disable(MapperFeature.DEFAULT_VIEW_INCLUSION);
IronTestUtils.addMixInsForWireMock(objectMapper);
}
Aggregations