0

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.

1 Answer 1

2

Quarkus dev mode doesn't use any of files under src/test.
If you want to have entities and Hibernate available only during test just add <scope>test</scope> to io.quarkus:quarkus-hibernate-orm dependency in pom.xml and all should be solved.

1
  • 1
    Many thanks! This is so obvious, yet so unobvious a fix. Jul 26 at 14:34

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.