🎙 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 8 of 10

Why does the integration test class have @Transactional?

Why does the integration test class have @Transactional?

  1. A.To make tests run faster in parallel
  2. B.Because MockMvc needs it
  3. C.To commit test data permanently
  4. D.So each test's database changes are rolled back and tests do not affect each other
Answer & explanation

Correct answer: So each test's database changes are rolled back and tests do not affect each other

Each test starts from the same seeded data.

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 →