Dear all, I want to test liquibase changes throw Junit tests. I have used Mariadb4j like that :
Properties props = getRuntimeProperties();
if (useInMemoryDatabase()) { DBConfigurationBuilder config = DBConfigurationBuilder.newBuilder(); config.setPort(0); // 0 => autom. detect free port DB db = DB.newEmbeddedDB(config.build()); db.start(); String dbName = "openmrs"; // or just "test" if (!dbName.equals("test")) { // mysqld out-of-the-box already has a DB named "test" // in case we need another DB, here's how to create it first db.createDB(dbName); } String url = config.getURL(dbName); props.setProperty(Environment.URL, url); props.setProperty(Environment.USER, "root"); props.setProperty(Environment.PASS, ""); } Context.setRuntimeProperties(props);
I can see in the logs that the mysql database is installed and running, However, I got this error in my test method :
DatabaseUpdater.executeChangelog(“liquibase.xml”, null);
The error is :
java.sql.SQLException: Unknown system variable 'REFERENTIAL_INTEGRITY'
Here is my pom :
<dependency> <groupId>ch.vorburger.mariaDB4j</groupId> <artifactId>mariaDB4j</artifactId> <version>2.4.0</version> <scope>test</scope> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.8</version> <scope>test</scope> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> <version>1.7.30</version> <scope>test</scope> </dependency>
Thanks a lot in advance,
in cc @mksd @dkayiwa (I putted you in copy because I saw that you did some job with MariaDb4j )