TransactionUnit is a JUnit-5-Extension that provides advanced rollback-after-test behavior.
Database tests are one of the longest running tests in today's enterprise applications. Database startup and setup usually take a long amount of the time. On the other hand one normally wants to test against the database technology that is used in production. However using one database instance for the complete test suite has a major draw back. Tests are not independent any more and may affect future tests.
TransactionUnit addresses this problem by hooking into JPA, behave like transactions behave, but rolling back all transactions after the test.