← 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?
- A.To make tests run faster in parallel
- B.Because MockMvc needs it
- C.To commit test data permanently
- 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 →