I have created a Spring web project using Spring Boot. Would like to understand the practice around testing. I require an in memory embedded database say hsql or h2 for my junits with initial schema.sql. And on the main application the database could be say mysql or oracle
In a non Spring Boot project, we would normally have a separate applicationcontext.xml one which is referred by the web app and for testing we would use applicationContext-text.xml
Now, in Spring boot as everything is created automatically and Spring Boot is opiniated too. Would like to know how do I setup having an embedded inmemory db for Junits and an external db like MySQL for the application.
One solution I can think of is using Profiles. with 2 properties file application.properties and application-test.properties. and use test profile for my junits.
Any recommendation on the approach I should take.