HibernateSessionSourceImpl implements HibernateSessionSource { @Override public Configuration getConfiguration() { return configuration; } HibernateSessionSourceImpl(Logger logger, List<HibernateConfigurer> hibernateConfigurers); @PostInjection void listenForShutdown(RegistryShutdownHub hub); @Override Session create(); @Override SessionFactory getSessionFactory(); @Override Configuration getConfiguration();  }
@Test public void get_configuration() { HibernateConfigurer configurer = new HibernateConfigurer() { @Override public void configure(Configuration configuration) { configuration.setProperty("foo", "bar"); configuration.configure(); } }; HibernateSessionSource source = new HibernateSessionSourceImpl(log, Arrays.asList(configurer)); Configuration config = source.getConfiguration(); Assert.assertNotNull(config); Assert.assertEquals("bar", config.getProperty("foo")); }