🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Testing Spring Boot: all 10 questions

Quiz: Testing Spring Boot · Question 4 of 10

What does @DataJpaTest do after each test by default?

What does @DataJpaTest do after each test by default?

  1. A.Deletes the database file
  2. B.Rolls back the transaction
  3. C.Commits all changes
  4. D.Restarts the application
Answer & explanation

Correct answer: Rolls back the transaction

Each test starts with a clean state.

Can you get the rest right without peeking?

Take the timed Quiz: Testing Spring Boot quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →