79790610

Date: 2025-10-14 20:43:49
Score: 2.5
Natty:
Report link

Thanks to @jaco0646:

Note that @DataJpaTest is itself annotated with @Transactional causing the whole test to run in a single transaction. Try using @SpringBootTest to see if that makes a difference.

– jaco0646

Infact with @SpringBootTest it works, basically the @DataJpaTest are itself @Transactional, so it performes rollback only at the end of the test, not at the end of the method orderService.insertNewOrder.

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Has code block (-0.5):
  • User mentioned (1): @jaco0646
  • User mentioned (0): @SpringBootTest
  • User mentioned (0): @DataJpaTest
  • User mentioned (0): @Transactional
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: VezzoLayer