0

Given I am in a Springboot JUnit integration test which calls a REST controller method of the same spring application context using a TestRestTemplate, how can I make sure that the application server calls to the database are in the same transaction as the unit test and are rolled back after the test?

My test is marked as @Transactional, and in the log of the test I can see that a transaction is started and rolled back later. Still I see records created/changed on the database by the application under test.

Kai
  • 2,145
  • 1
  • 20
  • 35

0 Answers0