@TestTransaction in combination with Junit5 @Nested does not roll back
See original GitHub issueDescribe the bug
In a @QuarkusTest placing @TestTransaction on methods inside a Junit5 @Nested class does not roll back the transaction - the test data stays in the database. Moving the test method out of the @Nested class makes it work.
Expected behavior
No response
Actual behavior
No response
How to Reproduce?
No response
Output of uname -a or ver
No response
Output of java -version
No response
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.0.2.Final and latest
Build tool (ie. output of mvnw --version or gradlew --version)
No response
Additional information
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Transaction roll back is not working in test case in @Nested ...
Rollback ; import org.springframework.transaction.annotation.Transactional; // JUnit5 @SpringBootTest public class TestClass { @Resource ...
Read more >Transaction roll back is not working in test case in @Nested ...
when use spring-boot, JUnit5 and Mybatis, Rollback of test case in nested class is not working. @SpringJUnitJupiterConfig(classes ...
Read more >Testing - Spring
You may not need this section of the testing chapter to help you ... By default, the framework creates and rolls back a...
Read more >Automatic Rollback of Transactions in Spring Tests
What Does @Transactional Do? Beware: Only Test-Managed Transactions Are Rolled Back; Set Up or Tear Down Outside of a Transaction; Spring Boot ...
Read more >JUnit 5 Tutorial: Writing Nested Tests - Petri Kainulainen
By default, a nested test class can contain test methods, one @BeforeEach method, and one @AfterEach method. Because Java doesn't allow static ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Well, non-static nested classes (i.e. inner classes) just to be precise… static nested classes are just fine 😉
Yeah that’s still the case. Nested classes are not managed beans as per spec https://jakarta.ee/specifications/cdi/2.0/cdi-spec-2.0.html#what_classes_are_beans