I have a project that will do plain, rather generic SQL in the main code for merging two equivalent tenant databases (e.g. having the same schema but different data). I want to be able to test this application and generate schema's and data in the (unit) tests and use Hibernate for that, so I create a mini JPA model in src/test/java/entities, but when I run quarkus dev, Hibernate complains that it is disabled because it can't find any entities:
WARN [io.qua.hib.orm.dep.HibernateOrmProcessor] (build-27) Hibernate ORM is disabled because no JPA entities were found
I don't want to pollute my application with these model classes that exist purely for testing purposes. Is there a way to bind the Hibernate bootstrap to the test class path?
Searching for the usual terms (e.g. hibernate quarkus test class path) give no relevant results.
Quarkus
dev modedoesn't use any of files undersrc/test.If you want to have entities and Hibernate available only during test just add
<scope>test</scope>toio.quarkus:quarkus-hibernate-ormdependency in pom.xml and all should be solved.