@Test public void registersMultipleHealthChecks() throws Exception { jooqBundleMultiDS.run(new DropwizardConfig(), environment); ArgumentCaptor<JooqHealthCheck> captor = ArgumentCaptor.forClass(JooqHealthCheck.class); verify(healthChecks).register(eq(DATASOURCE_PRIMARY), captor.capture()); assertThat(captor.getValue().getValidationQuery()).isEqualTo(validationQueryPrimary); verify(healthChecks).register(eq(DATASOURCE_REPLICA), captor.capture()); assertThat(captor.getValue().getValidationQuery()).isEqualTo(validationQueryReplica); }
@Override public void run(C configuration, Environment environment) throws Exception { configureDataSourceFactory( configuration, environment, primaryDataSourceName(), getDataSourceFactory(configuration)); getSecondaryDataSourceFactories(configuration) .entrySet() .stream() .forEach( e -> configureDataSourceFactory( configuration, environment, e.getKey(), e.getValue() ) ); environment.jersey().register(new DSLContextFeature(jooqFactoryConfigurationMap)); environment.jersey().register(new LoggingDataAccessExceptionMapper()); }
JooqBundle implements ConfiguredBundle<C>, JooqConfiguration<C> { @Override public void run(C configuration, Environment environment) throws Exception { configureDataSourceFactory( configuration, environment, primaryDataSourceName(), getDataSourceFactory(configuration)); getSecondaryDataSourceFactories(configuration) .entrySet() .stream() .forEach( e -> configureDataSourceFactory( configuration, environment, e.getKey(), e.getValue() ) ); environment.jersey().register(new DSLContextFeature(jooqFactoryConfigurationMap)); environment.jersey().register(new LoggingDataAccessExceptionMapper()); } }
JooqBundle implements ConfiguredBundle<C>, JooqConfiguration<C> { @Override public void run(C configuration, Environment environment) throws Exception { configureDataSourceFactory( configuration, environment, primaryDataSourceName(), getDataSourceFactory(configuration)); getSecondaryDataSourceFactories(configuration) .entrySet() .stream() .forEach( e -> configureDataSourceFactory( configuration, environment, e.getKey(), e.getValue() ) ); environment.jersey().register(new DSLContextFeature(jooqFactoryConfigurationMap)); environment.jersey().register(new LoggingDataAccessExceptionMapper()); }  }
JooqBundle implements ConfiguredBundle<C>, JooqConfiguration<C> { @Override public void run(C configuration, Environment environment) throws Exception { configureDataSourceFactory( configuration, environment, primaryDataSourceName(), getDataSourceFactory(configuration)); getSecondaryDataSourceFactories(configuration) .entrySet() .stream() .forEach( e -> configureDataSourceFactory( configuration, environment, e.getKey(), e.getValue() ) ); environment.jersey().register(new DSLContextFeature(jooqFactoryConfigurationMap)); environment.jersey().register(new LoggingDataAccessExceptionMapper()); }  void initialize(Bootstrap<?> bootstrap); @Override void run(C configuration, Environment environment); String primaryDataSourceName(); @Override JooqFactory getJooqFactory(C configuration); Configuration getConfiguration(); Map<String,Configuration> getConfigurationMap(); }
JooqBundle implements ConfiguredBundle<C>, JooqConfiguration<C> { @Override public void run(C configuration, Environment environment) throws Exception { configureDataSourceFactory( configuration, environment, primaryDataSourceName(), getDataSourceFactory(configuration)); getSecondaryDataSourceFactories(configuration) .entrySet() .stream() .forEach( e -> configureDataSourceFactory( configuration, environment, e.getKey(), e.getValue() ) ); environment.jersey().register(new DSLContextFeature(jooqFactoryConfigurationMap)); environment.jersey().register(new LoggingDataAccessExceptionMapper()); }  void initialize(Bootstrap<?> bootstrap); @Override void run(C configuration, Environment environment); String primaryDataSourceName(); @Override JooqFactory getJooqFactory(C configuration); Configuration getConfiguration(); Map<String,Configuration> getConfigurationMap();  }