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

Which annotation starts only the web layer for one controller?

Which annotation starts only the web layer for one controller?

  1. A.@SpringBootTest
  2. B.@WebMvcTest
  3. C.@DataJpaTest
  4. D.@ExtendWith(MockitoExtension.class)
Answer & explanation

Correct answer: @WebMvcTest

Services and repositories are not loaded — mock them with @MockitoBean.

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 →