Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 68dbc253 authored by Joze RIHTARSIC's avatar Joze RIHTARSIC
Browse files

enable two datasources for test - old configured by maven and new h2 for unit testing

parent 5bfd9633
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,7 @@ public class SmpServicesTestConfig {
private String url;
@Bean
public DataSource dataSource() {
public DataSource smpDataSource() {
DriverManagerDataSource driverManagerDataSource = new DriverManagerDataSource();
driverManagerDataSource.setDriverClassName(driver);
driverManagerDataSource.setUrl(url);
......@@ -66,7 +66,7 @@ public class SmpServicesTestConfig {
Properties prop = new Properties();
prop.setProperty("org.hibernate.envers.store_data_at_delete", "true");
LocalContainerEntityManagerFactoryBean lef = new LocalContainerEntityManagerFactoryBean();
lef.setDataSource(dataSource());
lef.setDataSource(smpDataSource());
lef.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
lef.setJpaProperties(prop);
lef.setPackagesToScan("eu.europa.ec.edelivery.smp.data.model");
......
jdbc.driverClassName=org.h2.Driver
jdbc.url=jdbc:h2:mem:myDb;DB_CLOSE_DELAY=-1
jdbc.url=jdbc:h2:file:./target/myDb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=TRUE;AUTO_SERVER=TRUE
jdbc.user=smp-dev
jdbc.pass=smp-dev
hibernate.dialect=org.hibernate.dialect.H2Dialect
......@@ -9,4 +9,5 @@ schema.sql=schema.sql
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.generate-ddl=true
logging.level.org.hibernate.type=trace
\ No newline at end of file
logging.level.org.hibernate.type=trace
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment