← 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?
- A.@SpringBootTest
- B.@WebMvcTest
- C.@DataJpaTest
- 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 →