Search in sources :

Example 11 with AssetsBundle

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);
}
Also used : MultiPartBundle(io.dropwizard.forms.MultiPartBundle) EnumSet(java.util.EnumSet) Set(java.util.Set) Configuration(com.jayway.jsonpath.Configuration) JacksonJsonProvider(com.jayway.jsonpath.spi.json.JacksonJsonProvider) AssetsBundle(io.dropwizard.assets.AssetsBundle) JacksonMappingProvider(com.jayway.jsonpath.spi.mapper.JacksonMappingProvider) MappingProvider(com.jayway.jsonpath.spi.mapper.MappingProvider) JsonProvider(com.jayway.jsonpath.spi.json.JsonProvider) JacksonJsonProvider(com.jayway.jsonpath.spi.json.JacksonJsonProvider) JacksonMappingProvider(com.jayway.jsonpath.spi.mapper.JacksonMappingProvider) Option(com.jayway.jsonpath.Option) Map(java.util.Map) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Aggregations

AssetsBundle (io.dropwizard.assets.AssetsBundle)11 EnvironmentVariableSubstitutor (io.dropwizard.configuration.EnvironmentVariableSubstitutor)2 SubstitutingSourceProvider (io.dropwizard.configuration.SubstitutingSourceProvider)2 DataSourceFactory (io.dropwizard.db.DataSourceFactory)2 MultiPartBundle (io.dropwizard.forms.MultiPartBundle)2 ViewBundle (io.dropwizard.views.ViewBundle)2 Map (java.util.Map)2 RenderCommand (com.example.helloworld.cli.RenderCommand)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 YAMLFactory (com.fasterxml.jackson.dataformat.yaml.YAMLFactory)1 GuavaModule (com.fasterxml.jackson.datatype.guava.GuavaModule)1 ImportCommand (com.graphhopper.application.cli.ImportCommand)1 MatchCommand (com.graphhopper.application.cli.MatchCommand)1 GraphHopperBundle (com.graphhopper.http.GraphHopperBundle)1 RealtimeBundle (com.graphhopper.http.RealtimeBundle)1 GuiceBundle (com.hubspot.dropwizard.guicier.GuiceBundle)1 ProtobufModule (com.hubspot.jackson.datatype.protobuf.ProtobufModule)1 CorsBundle (com.hubspot.singularity.bundles.CorsBundle)1 MergingSourceProvider (com.hubspot.singularity.config.MergingSourceProvider)1 SingularityConfiguration (com.hubspot.singularity.config.SingularityConfiguration)1