Aleksandr opened SPR-16550 and commented
When trying to autowire Spring Boot's TestEntityManager in method annotated as @BeforeAll, the following exception is thrown:
java.lang.IllegalStateException: No transactional EntityManager found
Other beans are autowired into this method without problems.
The case is following - since I have one test class instance for all tests in it, and they require the same prepopulated DB, why not fill the DB once after test class instantiation?
Sample project is referenced in the issue.
Reference URL: https://gitlab.com/AleksandrSl/spring-sandbox/blob/junit-5-security/src/test/kotlin/pro/parseq/springsandbox/entities/UserItemsSecurityTests.kt
Issue Links: