use of io.dropwizard.jdbi3.bundles.JdbiExceptionsBundle in project dropwizard by dropwizard.
the class JdbiExceptionsBundleTest method test.
@Test
void test() {
Environment environment = mock(Environment.class);
JerseyEnvironment jerseyEnvironment = mock(JerseyEnvironment.class);
when(environment.jersey()).thenReturn(jerseyEnvironment);
new JdbiExceptionsBundle().run(new Configuration(), environment);
verify(jerseyEnvironment).register(isA(LoggingSQLExceptionMapper.class));
verify(jerseyEnvironment).register(isA(LoggingJdbiExceptionMapper.class));
}
use of io.dropwizard.jdbi3.bundles.JdbiExceptionsBundle in project consent by DataBiosphere.
the class ConsentApplication method initialize.
@Override
public void initialize(Bootstrap<ConsentConfiguration> bootstrap) {
bootstrap.addBundle(new AssetsBundle("/assets/", "/api-docs", "index.html"));
bootstrap.addBundle(new MultiPartBundle());
bootstrap.addBundle(new JdbiExceptionsBundle());
}
use of io.dropwizard.jdbi3.bundles.JdbiExceptionsBundle in project pay-ledger by alphagov.
the class LedgerApp method initialize.
@Override
public void initialize(Bootstrap<LedgerConfig> bootstrap) {
bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false)));
bootstrap.addBundle(new MigrationsBundle<>() {
@Override
public DataSourceFactory getDataSourceFactory(LedgerConfig configuration) {
return configuration.getDataSourceFactory();
}
});
bootstrap.addBundle(new JdbiExceptionsBundle());
bootstrap.addCommand(new DependentResourceWaitCommand());
bootstrap.getObjectMapper().getSubtypeResolver().registerSubtypes(LogstashConsoleAppenderFactory.class);
bootstrap.getObjectMapper().getSubtypeResolver().registerSubtypes(GovUkPayDropwizardRequestJsonLogLayoutFactory.class);
}
use of io.dropwizard.jdbi3.bundles.JdbiExceptionsBundle in project pay-publicauth by alphagov.
the class PublicAuthApp method initialize.
@Override
public void initialize(Bootstrap<PublicAuthConfiguration> bootstrap) {
bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false)));
bootstrap.addBundle(new JdbiExceptionsBundle());
bootstrap.addBundle(new MigrationsBundle<PublicAuthConfiguration>() {
@Override
public DataSourceFactory getDataSourceFactory(PublicAuthConfiguration configuration) {
return configuration.getDataSourceFactory();
}
});
bootstrap.addCommand(new DependentResourceWaitCommand());
bootstrap.getObjectMapper().getSubtypeResolver().registerSubtypes(LogstashConsoleAppenderFactory.class);
bootstrap.getObjectMapper().getSubtypeResolver().registerSubtypes(GovUkPayDropwizardRequestJsonLogLayoutFactory.class);
}
use of io.dropwizard.jdbi3.bundles.JdbiExceptionsBundle in project FrameworkBenchmarks by TechEmpower.
the class HelloJDBIService method initialize.
@Override
public void initialize(Bootstrap<HelloWorldConfiguration> bootstrap) {
bootstrap.addBundle(new ViewBundle<>());
// Provides automatic unwrapping of SQLException and DBIException
bootstrap.addBundle(new JdbiExceptionsBundle());
}
Aggregations