HibernateFeature implements Feature { @Override public boolean configure(final FeatureContext context) { context.register(new SearchIndexContainerLifecycleListener.Binder()); context.register(new CreatedUpdatedListener.Binder()); context.register(new LiquibaseMigration.Binder()); context.register(new HibernateSessionFactory.Binder()); context.register(new HibernateSessionFactoryFactory.Binder()); context.register(new HibernateServiceRegistryFactory.Binder()); context.register(new FulltextSearchFactoryFactory.Binder()); context.register(new FulltextSessionFactory.Binder()); context.register(new PooledDataSourceFactory.Binder()); context.register(new QueryExceptionMapper.Binder()); context.register(new HibernateExceptionMapper.Binder()); context.register(new ConstraintViolationExceptionMapper.Binder()); context.register(new PersistenceExceptionMapper.Binder()); context.register(new PropertyValueExceptionMapper.Binder()); context.register(new SearchExceptionMapper.Binder()); context.register(new TransactionFilter.Binder()); context.register(Base16BigIntegerConverterProvider.class); return true; }  @Override boolean configure(final FeatureContext context);  }
@Test public void testInjections() { HibernateFeature f = new HibernateFeature(); FeatureContext context = mock(FeatureContext.class); f.configure(context); verify(context, times(1)) .register(any(SearchIndexContainerLifecycleListener .Binder.class)); verify(context, times(1)) .register(any(CreatedUpdatedListener .Binder.class)); verify(context, times(1)) .register(any(LiquibaseMigration .Binder.class)); verify(context, times(1)) .register(any(HibernateSessionFactory .Binder.class)); verify(context, times(1)) .register(any(HibernateSessionFactoryFactory .Binder.class)); verify(context, times(1)) .register(any(HibernateServiceRegistryFactory .Binder.class)); verify(context, times(1)) .register(any(FulltextSearchFactoryFactory .Binder.class)); verify(context, times(1)) .register(any(FulltextSessionFactory .Binder.class)); verify(context, times(1)) .register(any(PooledDataSourceFactory .Binder.class)); verify(context, times(1)) .register(any(QueryExceptionMapper .Binder.class)); verify(context, times(1)) .register(any(HibernateExceptionMapper .Binder.class)); verify(context, times(1)) .register(any(ConstraintViolationExceptionMapper .Binder.class)); verify(context, times(1)) .register(any(PersistenceExceptionMapper .Binder.class)); verify(context, times(1)) .register(any(PropertyValueExceptionMapper .Binder.class)); verify(context, times(1)) .register(any(SearchExceptionMapper .Binder.class)); verify(context, times(1)) .register(any(TransactionFilter .Binder.class)); verify(context, times(1)) .register(Base16BigIntegerConverterProvider.class); }