I'm interested in what people are doing for testing their persistence layer with Quarkus - specifically Hibernate/Panache
1) There is an existing database with an existing schema that has a bunch of tables
2) I'm building an application and I'm going to use JPA, so I write some POJO classes and put all the JPA annotations on them
3) How do I test/validate/assert that those JPA annotations I put on my POJO classes actually bind to the schema/tables in the way I expect, without having to deploy my application into an "environment"?
In Spring, I would accomplish this by using H2. I would have H2 auto-create my schema in my tests based on my code. I would then run 2 test scenarios
1) Wire in my Spring Data JPA JpaRepository and use it to persist an entity, then use Spring's JdbcTemplate to run SELECTs queries based on the schema I expected to pull the data
2) Use Spring's JdbcTemplate to issue INSERTs into the appropriate tables, then use the JpaRepository to read the data inserted
How would I do something like this in Quarkus? Essentially this is a test that the JPA annotations on my entity classes are correct. I trust that Hibernate itself is working the way it should :) I haven't yet found a good way to accomplish the same thing in Quarkus. Do people not test this kind of capability? Or do I just not know of a better way?
I have a simple example [1] of a single entity with a single table, but think about multiple entities where there are foreign keys, join tables, column constraints, etc.
[1]
https://github.com/edeandrea/spring-boot-demo/blob/main/src/test/java/com/example/demo/repository/PersonRepositoryTests.java