Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save emmanuelbernard/890394 to your computer and use it in GitHub Desktop.
Save emmanuelbernard/890394 to your computer and use it in GitHub Desktop.
try {
cfg.configure(
adapter,
Collections.singletonMap( AvailableSettings.VALIDATION_FACTORY, token )
);
+ cfg.buildEntityManagerFactory();
fail( "Was expecting error as token did not implement ValidatorFactory" );
}
catch ( HibernateException e ) {
// probably the condition we want but unfortunately the exception is not specific
// and the pertinent info is in a cause
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment