I'm in the process of creating unit tests for our Spring Boot REST API with Hibernate. I'm just wondering if it's a problem when I use @Transactional. Do I see it right that if I annotate the test with @Transactional, the data will never really end up in the database and a potential source of error will be bypassed? Since certain errors only occur during commit? Or do I see it wrong?
Rollback transaction after @Test - The following question does not quite correspond to my question. Because I wanted to know how to trigger a commit and still do a rollback. What is possible with EntityManager.flush(). I know how to reset the database after each test.