Created
September 23, 2019 21:57
-
-
Save sebersole/7efa39414409e93af484c0f25edd9825 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testCustomProviderPassingIntegrationOverrides() { | |
PersistenceProvider provider = new HibernatePersistence() { | |
@Override | |
public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo info, Map properties) { | |
properties.putAll( ConnectionProviderBuilder.getConnectionProviderProperties() ); | |
return super.createContainerEntityManagerFactory( info, properties ); | |
} | |
}; | |
final EntityManagerFactory emf = provider.createContainerEntityManagerFactory( | |
new PersistenceUnitInfoAdapter(), | |
new HashMap() | |
); | |
try { | |
final Map<String, Object> properties = emf.getProperties(); | |
final Object jpaJdbcDriver = properties.get( AvailableSettings.JDBC_DRIVER ); | |
assertThat( jpaJdbcDriver, notNullValue() ); | |
final Object hibernateJdbcDriver = properties.get( org.hibernate.cfg.AvailableSettings.DRIVER ); | |
assertThat( hibernateJdbcDriver, notNullValue() ); | |
} | |
finally { | |
emf.close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment